[Thread Prev][Thread Next][Index]
[ferret_users] Aspect, bad values using poly_vector.jnl
- To: ferret_users@xxxxxxxx
- Subject: [ferret_users] Aspect, bad values using poly_vector.jnl
- From: Serena Illig <serena.illig.ird@xxxxxxxxx>
- Date: Tue, 21 Jun 2022 14:13:16 +0200
- Arc-authentication-results: i=4; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=apiiG0eE; arc=pass (i=2 dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of serena.illig.ird@xxxxxxxxx designates 209.85.222.200 as permitted sender) smtp.mailfrom=serena.illig.ird@xxxxxxxxx
- Arc-authentication-results: i=3; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=apiiG0eE; arc=pass (i=2 dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of serena.illig.ird@xxxxxxxxx designates 209.85.222.200 as permitted sender) smtp.mailfrom=serena.illig.ird@xxxxxxxxx
- Arc-authentication-results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=apiiG0eE; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=softfail (google.com: domain of transitioning serena.illig.ird@xxxxxxxxx does not designate 65.153.203.167 as permitted sender) smtp.mailfrom=serena.illig.ird@xxxxxxxxx
- Arc-authentication-results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=apiiG0eE; spf=pass (google.com: domain of serena.illig.ird@xxxxxxxxx designates 209.85.220.41 as permitted sender) smtp.mailfrom=serena.illig.ird@xxxxxxxxx; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
- Arc-message-signature: i=4; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-archive:list-help:list-post:list-id:mailing-list:precedence:to :subject:message-id:date:from:mime-version:sender:dkim-signature; bh=bSfYpeCiiR40Y56jZxuILwhd9764r2M09wHHMcNZrhs=; b=S47aJONlGyU2/MP19EH5p0nGTwRQExI6/U/pupGZaXvghaSAmaQeQV2qFn+lPhJOvo Qpf62NImpid7WT7U3N4hl6whw4n2STk7LG/rAcspzxhXLyQRhbFrUKxGHv72F7/HNw5g CZEIfhPH/LhMEOK5OtCy6dKzHGt3+5OUZD4QPA13AKF+arUDeGiRuKmHFt8yKqjRJSjN PekDIBKlF9qeNkpAUq4nizNEQqwKcNYvZ0L5uSFWEjPUwz7ad67Hvsc32qDaO7xuOvjz mG+SNi9pU3IzJAJ1Jz40SmzXC25gQWA0c600+PDocfUHIfeNssIR0lqArpSJHH44+JP6 TduA==
- Arc-message-signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=bSfYpeCiiR40Y56jZxuILwhd9764r2M09wHHMcNZrhs=; b=tc2vDS4EUnx3rNjGk7z7uWMe5/CBKDoujk2kucDveKf3mp6h2sr+I7zpLZ65WPrF+u ZG0zoD1IxD5yeZ8bH0aSyXc40PRpooS4DrMXZloyNzyTQeWrfXoq/ELftdVUjRPij/cp jDaVhOVLsZ24qKL63OrkcosRmmAf7bgKtqVssC2o1p4G0kt6/8HwxXDvs/5BKornV6Lz mmdeI7IfGxclHF3afcBWsiOHcqcoZJdv+w9A6N9n0aEX2+yBxYstREi7zRIPxKXnf9o0 4+lTvnWxD6BTtC1qHsiGU0dT++EOPNWX0nzqhd/2Wh7ePckhNP9CIWdj3cTfGAqqC/2x lagA==
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=bSfYpeCiiR40Y56jZxuILwhd9764r2M09wHHMcNZrhs=; b=qTLZkZ9fkszfE4YB9flBN50lJsWAeDeevRJrriRbNkVfL/2fLXqenbjCDgxgrKzl1+ NtKCEFsA5QVFgVnbhLS98EELzrF0RnmdauzKpD/G/O2FULk0OVewgk9Smw/+NO0zfJmm j7Vv4e+NbiOljTTwTlPj6eyVKfyWOQTlpci85USYdPKFf7ZzydnnW7E3zdgAzCY7DNX1 u5dCIkS1rfJh8mikqMpJ+yWzXdVWl6Rb/OjKUrllwEQxyMab2caa8L6YHqsdSdH2KRfl PQ3pLUR4r7GLKAYif+aikOpW0m8yy/t2S80MIG47Wt8gTj/AladcEYrLoPbUYuB5rDkW I41g==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=bSfYpeCiiR40Y56jZxuILwhd9764r2M09wHHMcNZrhs=; b=FIZRe3K6jHrNRsngWAVgnAey4Zhj6kRoE90Vdfr3ppGzzTYokVGk3ARAwUKWhd8tQj /Go9FgHEjqSPcwUeY8W0H4IzKN0CDfSm8VRH3Qr3p+OuH0CN7U14x2QVaNsTxte6B5Bz qnGJZqkjKNyvczZxMZLxrnMhOR7YqypMwZTrnEln4EiblhaSzrGwMQNWPVGgpPdb5Xsc f76rfbh4ai9ox8MIffaouyCgXAXBM3eGKW6MiuOX6uLmZ0UxVsK7Gc2BdgfI+iuIUHqO prV4SmBpRL6V7bFynlmZvSd8e6SXUQStLy5iKFumgGgMPPpGq9bTsVv/YhmdtR1MCB5A Vxpg==
- Arc-seal: i=4; a=rsa-sha256; t=1655813620; cv=pass; d=google.com; s=arc-20160816; b=B4S3+9gZ/wzvuF/ON4VkSYj9Fb9PWo2tc3WRbnUVgMi7Sxte5PVl6yhn5lA2y15+xy /poDE+lFkTiwR/13L0zyMr5BLSIlkg191Zw/WWj4o6Dh6m6GQZF8v+c4bHSKk1jzQqTv ZaaHpmo3p9NqK+2RSjiGBLolQCqQGhVGEjZd2VoC0S1veSVAB2YdMEmJdTttXZNBFLpW PD8V84Mt8vJgL4Vm6EsY5+gAqfmMf3gsykhOEWXo2MsQl9njy2QjzsiuH4cURPe+U8Fd T976co/iUZKoxlx8X7eGKZt5hRWzl7kXGfC+0dD33dWAs5xy/a3Djf+GniwsMHslBgtx i9PA==
- Arc-seal: i=3; a=rsa-sha256; t=1655813618; cv=pass; d=google.com; s=arc-20160816; b=hwbAMAulpkc85zlPXWhlzuQ1BzQs4S8+KxuoT17Wep4PyrUTjfZSQqwvJ/Ae70nunZ rTM/SItjncxSZxq+BpuYZIzsNcBJqBZr6GdrMNMj9ovpl1dR6ipqkVIlMag6MGPoex9P wQL1HroWQ9qNyAF1FJiM6jeis8DIZTPF/dKV0p08In/Tgm/5+oVMMMsy4VSipSbaDnHC 5P4j0lI1W+Yf8iprqnq5RyaBIXnn1E0ZD8gSv4XRmuMbnE0yOyOhBCVS5ZOJuhhGLrU8 LbLzNXhvS3qk1rWMoYuWS2hbqglQ4L5Y08EGNEfFGVvABl8mM52jagYBsSxo0YDJ1BDj K2+A==
- Arc-seal: i=2; a=rsa-sha256; t=1655813612; cv=pass; d=google.com; s=arc-20160816; b=omhj4uoPVUyOqyeWx/Mv//dJV7P2Yboow2gW6fess5xnZv6LwrjOix0MrgOwIm2PKF I1AFSH+j9BwBC1dsuaIKKaRzh+iL3h/uVPlqOZ4CRSQALOiH8ZbWL1eYpIwWJNuNAM5C xZYn8siY0LAraNojB2Dm1CqpA6eXxQ1FMrMEJ/EHbHkwffi4X0SO3QPSJumluu1tgMHP 8St/Hy0LeVGzni2dZ8egZPFIkr2fHnluHkJYrRXu3P9DPcBUwCx9zsZh1Bs3Gp7I5UiV XKb8YeRD/A8dtc//DBKLyZ/ZzFUv7HSt3Myj/WLAVW1AsJja8HvNuxvRe7viS5adOGRH W+NQ==
- Arc-seal: i=1; a=rsa-sha256; t=1655813610; cv=none; d=google.com; s=arc-20160816; b=iiugcb1+hu4ewNM3dVhWyZ7D0lSpA0urKu/7tRQdBShB1WDe61PZvzsNL8zbiAIBZV vvmuyqUj3cQN7R3HhGZRZrIYRicHmAZrK1TqJDdIETlqBkbhDInUhsz43SWlF3dHVQpw S+Cx3jxb1PFxRPJtSGctibX+oyQOz41U17rpRFYMQVqjNVzmCbqo500aOrijcDl51i99 E+RfCDhz0m1JlHRdZSVTTd4xCXoauP4ha4LE1NelnnTjhDsY5zlI6tzh60mqL7N4ukGb eVWLAzIF59IC3EQviCNd/rNB3Enbjo4luBaQpl5XftaX1WVYG8DUBO50EwxeKeb46IK7 q0Ew==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=noaa.gov; s=google; h=sender:mime-version:from:date:message-id:subject:to :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive; bh=bSfYpeCiiR40Y56jZxuILwhd9764r2M09wHHMcNZrhs=; b=U52X1GiMCc7OGSSC6xqDvpL88H/nEg8LirLRhGIsfFj9zitCjg6b4xVzMgG3jadBKu xBmtOLIuu3QEoxFZPZMyxARzADQcR+fInVpu4FXW8hyoHg+Z1KNla3y5Rq5v0l5lWT+T xg6H5QAjzqhRsgSUkNEWHr8wcyk5TdEnM0ePgCsmPEQ/p33JSC+DitMlx31xfQinuBur 6zv2JHp2aEKtQNtA53UgVO1d8YUZ/f1s43vquwfzO/umXvPR2RzsF8DWHUbgnnnl55rg f3it1CCJy1M/Vq6hBSZrDZcwhQBs2dY7DNH3mHGZaxGdZ7te06tLz1Zj74uZQ/mIXGcx OcFg==
- List-archive: <https://groups.google.com/a/noaa.gov/group/ferret_users/>
- List-help: <https://support.google.com/a/noaa.gov/bin/topic.py?topic=25838>, <mailto:ferret_users+help@noaa.gov>
- List-id: <ferret_users.noaa.gov>
- List-post: <https://groups.google.com/a/noaa.gov/group/ferret_users/post>, <mailto:ferret_users@noaa.gov>
- Mailing-list: list ferret_users@xxxxxxxx; contact ferret_users+owners@xxxxxxxx
- Sender: owner-ferret_users@xxxxxxxx
Dear Ferret users,
I hope this email finds you well.
I am writing regarding some vector plots. I am using PyFerret v7.63 on Linux Ubuntu (via miniconda) but I have the same issues with PyFerret v7.62 and ferret v6.71.
I am drawing an hovmuller vector plot (x-t plot) of the wind stress anomalies along the equator for 2021, overlaying SST anomalies.
I am pretty happy with the result of the command VECTOR/OV without specifying /ASPECT, because the time axis does not have a spatial scale. However, I prefer the look of the arrows drawn by the "go poly_vector.jnl" script, associated with POLYGON/OVER.
I encountered 2 problems using the poly_vector.jnl script:
1) Using go poly_vector.jnl, my first problem was the difference in the axis scaling (y_scale/x_scale) between the VECTOR/OV plot and the poly_vector.jnl script.
---> I thus modified the poly_vector scrip.jnl (
see script attached) to include the possibility to adjust the direction of the vectors just like with /ASPECT in the VECTOR/OV plot.
I created a 7th input argument, that corrects the direction of the arrows.
The script works with or without specifying the 7th argument and mimics the arrows drawn with the command VECTOR/OV (
I do not know why I had to scale with sqrt(2), see below).
let vect_aspect = $7"-1."
! Compute the vector direction on the plot
let vect_rotation= if vect_aspect lt 0 then plt_y_per_inch/plt_x_per_inch else vect_aspect*(plt_x_inch_span/plt_y_inch_span)*(2)^0.5
let pi = 4*atan(1)
let vect_dir = atan2(vect_rotation*vect_y_comp/plt_y_per_inch, vect_x_comp/plt_x_per_inch)2) My second problem was linked to bad values. I do not want to plot vectors if the arrows are too small. I thus masked the wind stress components using a simple if loop.
It works fine until I add a value to color the arrows.
*** POLYGON/OVER/NOLABEL/KEY/NOAXES/LINE PLT_X_ARROW, PLT_Y_ARROW, MY_VALUES[J=1:132] ***
I chose that the color is associated with the x-component of the wind stress anomalies that have large positive values in June 2021. I get a shift of the colors as if the bad values of MY_VALUES are used for the next arrow being transparent (
see the tiny arrow in March at 2.5°E in My_plot_shifted.png). I get the same behavior if I do not mask MY_VALUES, except that the color is white (according to my color scale).
To solve my problem I created an external function (keep_good.F) that removes the bad values by shifting the valid data (
see function attached and My_plot_corrected.png).
Maybe this issue has already been reported?
Have a nice day,
Serena Illig
.¸. , . .·´¯`·
><(((º> `·.¸.·´¯`·...¸><(((º>¸.¸. , . .·´¯`· ><(((º> .
`·.¸.·´¯`·...¸><(((º> .
.
Serena ILLIG-THEVENIN LEGOS/IRD .
.
Editorial Board Member for Scientific Reports .
.
14 Av. E. Belin .
31400 Toulouse .
FRANCE .
.
Phone : +33 5 61 33 29 26 .
.
<º)))><..·
Attachment:
poly_vectors2.jnl
Description: Binary data
Attachment:
My_plot_shifted.png
Description: PNG image
Attachment:
My_plot_corrected.png
Description: PNG image
*
* keep_good.F in 6D
*
* Serena Illig
* June 2022
*
* Remove the bad values by shifting the data !!!
*
SUBROUTINE keep_good_init(id)
INCLUDE 'EF_Util.cmn'
INTEGER id, arg
*
* **********************************************************************
* USER CONFIGURABLE PORTION |
* |
*
CALL ef_set_desc(id,'Keep good data and remove bad values')
*
CALL ef_set_num_args(id, 1)
CALL ef_set_has_vari_args(id, NO)
CALL ef_set_axis_inheritance_6d(id, NORMAL,
. IMPLIED_BY_ARGS, IMPLIED_BY_ARGS, IMPLIED_BY_ARGS,
. IMPLIED_BY_ARGS, IMPLIED_BY_ARGS)
CALL ef_set_piecemeal_ok_6d(id, YES, YES, YES, YES, YES, YES)
*
arg = 1
CALL ef_set_arg_name(id, arg, 'A')
CALL ef_set_arg_desc(id, arg, 'Field to be Processed')
CALL ef_set_axis_influence_6d(id, arg, YES, YES, YES, YES, YES, YES)
*
* ^
* |
* USER CONFIGURABLE PORTION |
* **********************************************************************
RETURN
END
*
* In this subroutine we compute the result
*
SUBROUTINE keep_good_compute(id, arg_1, result)
IMPLICIT none
INCLUDE 'EF_Util.cmn'
INCLUDE 'EF_mem_subsc.cmn'
INTEGER id, arg
REAL bad_flag(EF_MAX_ARGS), bad_flag_result
REAL arg_1(mem1lox:mem1hix, mem1loy:mem1hiy, mem1loz:mem1hiz,
. mem1lot:mem1hit, mem1loe:mem1hie, mem1lof:mem1hif)
REAL result(memreslox:memreshix, memresloy:memreshiy,
. memresloz:memreshiz, memreslot:memreshit,
. memresloe:memreshie, memreslof:memreshif)
*
* After initialization, the 'res_' arrays contain indexing information
* for the result axes. The 'arg_' arrays will contain the indexing
* information for each variable's axes.
*
INTEGER res_lo_ss(6), res_hi_ss(6), res_incr(6)
INTEGER arg_lo_ss(6,EF_MAX_ARGS), arg_hi_ss(6,EF_MAX_ARGS),
. arg_incr(6,EF_MAX_ARGS)
*
* **********************************************************************
* USER CONFIGURABLE PORTION |
* |
* V
INTEGER i,j,k,l,m,n
INTEGER i1,j1,k1,l1,m1,n1
*
CALL ef_get_res_subscripts_6d(id, res_lo_ss, res_hi_ss, res_incr)
CALL ef_get_arg_subscripts_6d(id, arg_lo_ss, arg_hi_ss, arg_incr)
CALL ef_get_bad_flags(id, bad_flag, bad_flag_result)
*
DO 105 n=res_lo_ss(F_AXIS), res_hi_ss(F_AXIS)
DO 104 m=res_lo_ss(E_AXIS), res_hi_ss(E_AXIS)
DO 103 l=res_lo_ss(T_AXIS), res_hi_ss(T_AXIS)
DO 102 k=res_lo_ss(Z_AXIS), res_hi_ss(Z_AXIS)
DO 101 j=res_lo_ss(Y_AXIS), res_hi_ss(Y_AXIS)
DO 100 i=res_lo_ss(X_AXIS), res_hi_ss(X_AXIS)
result(i,j,k,l,m,n)=bad_flag_result
100 ENDDO
101 ENDDO
102 ENDDO
103 ENDDO
104 ENDDO
105 ENDDO
DO 205 n1=arg_lo_ss(F_AXIS,ARG1), arg_hi_ss(F_AXIS,ARG1)
DO 204 m1=arg_lo_ss(E_AXIS,ARG1), arg_hi_ss(E_AXIS,ARG1)
i=res_lo_ss(X_AXIS)
j=res_lo_ss(Y_AXIS)
k=res_lo_ss(Z_AXIS)
l=res_lo_ss(T_AXIS)
DO 203 l1=arg_lo_ss(T_AXIS,ARG1), arg_hi_ss(T_AXIS,ARG1)
DO 202 k1=arg_lo_ss(Z_AXIS,ARG1), arg_hi_ss(Z_AXIS,ARG1)
DO 201 j1=arg_lo_ss(Y_AXIS,ARG1), arg_hi_ss(Y_AXIS,ARG1)
DO 200 i1=arg_lo_ss(X_AXIS,ARG1), arg_hi_ss(X_AXIS,ARG1)
if (arg_1(i1,j1,k1,l1,m1,n1).ne.bad_flag(1)) then
result(i,j,k,l,m1,n1)=arg_1(i1,j1,k1,l1,m1,n1)
if (i.ne.res_hi_ss(X_AXIS)) then
i=i+1
else
i=res_lo_ss(X_AXIS)
if (j.ne.res_hi_ss(Y_AXIS)) then
j=j+1
else
j=res_lo_ss(Y_AXIS)
if (k.ne.res_hi_ss(Z_AXIS)) then
k=k+1
else
k=res_lo_ss(Z_AXIS)
l=l+1
endif
endif
endif
endif
*
200 ENDDO
201 ENDDO
202 ENDDO
203 ENDDO
204 ENDDO
205 ENDDO
* ^
* |
* USER CONFIGURABLE PORTION |
* **********************************************************************
RETURN
END
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
Ferret
Privacy Policy | Disclaimer | Accessibility Statement