[Thread Prev][Thread Next][Index]
[ferret_users] fill_between inconsistent sizes of data regions: can't label Z axis of FBYDN
Hey ferret user,
I have a vertical section and like to overlay the bathymetry with fill_between (see attached plots). But this causes an error, :-)
**ERROR: inconsistent sizes of data regions: can't label Z axis of FBYDN
here is the script and output:
use "/home/b/shkifmeb/_WORK/VIKING20/K301/AR7W_section_1990_2019/1_VIKING20-K301_1m_20190101_20191231_section.nc"
use "/home/b/shkifmeb/_WORK/VIKING20/K301/AR7W_section/section_mask.nc"
set mode verify: always
def ax/x/units=degrees_east xlon=nav_lon[d=2]
let bathy = E3T_PS[d=2,k=@sum,gx=xlon@asn]
set wi 1
plot bathy
set wi 2
shade/pal=blue_darkred/vlim=0:3200/nol/lev=(-inf)(33,36,.1)(inf) VOSALINE[d=1,l=@ave,gx=xlon@asn]
go fill_between poly/pal=grey/ov/nol bathy[gx=xlon@asn] xlon 3200
OUTPUT:
QUERY/IGNORE $1"<usage: yes? GO fill_between polygon_command data axis [base]"
!-> QUERY/IGNORE poly/pal=grey/ov/nol
QUERY/IGNORE $2"<usage: yes? GO fill_between polygon_command data axis [base]"
!-> QUERY/IGNORE bathy[gx=xlon@asn]
QUERY/IGNORE $3"<usage: yes? GO fill_between polygon_command data axis [base]"
!-> QUERY/IGNORE xlon
! save the input expressions into simple variable definitions
LET/QUIET FBy = $2
!-> DEFINE VARIABLE/QUIET FBy = bathy[gx=xlon@asn]
LET/QUIET FBbase = $4"0"
!-> DEFINE VARIABLE/QUIET FBbase = 3200
! determine the orientation of the data (and check that it is 1D)
DEFINE SYMBOL FBax `FBy,return=shape`
!-> DEFINE SYMBOL FBax X
DEFINE SYMBOL FBiax ($FBax"|X>i|Y>j|Z>k|T>l|<error: data is not a line")
!-> DEFINE SYMBOL FBiax i
DEFINE SYMBOL FBbar_ax ($FBax"|X>Z|Y>Z|Z>Y|T>Z|<error: data is not a line")
!-> DEFINE SYMBOL FBbar_ax Z
DEFINE SYMBOL FBbase_ax `FBbase,return=shape`
!-> DEFINE SYMBOL FBbase_ax POINT
DEFINE SYMBOL FBbase_iax ($FBbase_ax"|X>i|Y>j|Z>k|T>l|POINT>i|<error: base is not a line")
!-> DEFINE SYMBOL FBbase_iax i
DEFINE SYMBOL FBbase_bar_ax ($FBbase_ax"|X>Z|Y>Z|Z>Z|T>Z|POINT>Z|<error: base is not a line")
!-> DEFINE SYMBOL FBbase_bar_ax Z
! get the independent axis out as a separate variable
DEFINE SYMBOL FBilo `FBy,return=($FBiax)start`
!-> DEFINE SYMBOL FBilo 1
DEFINE SYMBOL FBihi `FBy,return=($FBiax)end`
!-> DEFINE SYMBOL FBihi 1000
! Define a new non-depth axis in case of a depth axis: the poly overlay
! with /transpose is incorrect on a depth axis.
define axis/($FBax) FBaxis=($FBax)[G($FBax)=$3]
!-> define axis/X FBaxis=X[GX=xlon]
LET/QUIET FBx = ($FBax)[G($FBax)=FBaxis,($FBiax)=($FBilo):($FBihi)] !FBx=X[GX=ax,i=lo:hi]
!-> DEFINE VARIABLE/QUIET FBx = X[GX=FBaxis,i=1:1000]
LET/QUIET FBx = ($FBax)[G($FBax)=$3,($FBiax)=($FBilo):($FBihi)] !FBx=X[GX=ax,i=lo:hi]
!-> DEFINE VARIABLE/QUIET FBx = X[GX=xlon,i=1:1000]
! assemble the vertices above and below
LET/QUIET FBxup = FBx
LET/QUIET FByup = FBy
LET/QUIET FBxdn = FBx
LET FBydn = 0.*FBy + FBbase
LET/QUIET FBpindex = ($FBbar_ax)[($FBbar_ax)=1:4]
!-> DEFINE VARIABLE/QUIET FBpindex = Z[Z=1:4]
LET/QUIET FBx4_0 = IF FBpindex EQ 1 OR FBpindex EQ 4 then FBxdn ELSE FBxup
LET/QUIET FBy4_0 = IF FBpindex EQ 1 OR FBpindex EQ 4 then FBydn ELSE FByup
LET/QUIET FBx4_1 = IF FBpindex LE 2 then FBx4_0 ELSE FBx4_0[($FBax)=@shf:-1]
!-> DEFINE VARIABLE/QUIET FBx4_1 = IF FBpindex LE 2 then FBx4_0 ELSE FBx4_0[X=@shf:-1]
LET/QUIET FBy4_1 = IF FBpindex LE 2 then FBy4_0 ELSE FBy4_0[($FBax)=@shf:-1]
!-> DEFINE VARIABLE/QUIET FBy4_1 = IF FBpindex LE 2 then FBy4_0 ELSE FBy4_0[X=@shf:-1]
! for Z -axis plot, transpose the overlay
! if it is a depth axis, need to also multiply by -1.
DEFINE SYMBOL FB_orient ($FBax"|X>fill|Y>fill|T>fill|Z>transpose|")
!-> DEFINE SYMBOL FB_orient fill
DEFINE SYMBOL FB_mult ($FBax"|X>1|Y>1|T>1|Z>-1|")
!-> DEFINE SYMBOL FB_mult 1
$1/($FB_orient)/coord_ax=($FBbar_ax) FBx4_1, FBy4_1
!-> poly/pal=grey/ov/nol/fill/coord_ax=Z FBx4_1, FBy4_1
**ERROR: inconsistent sizes of data regions: can't label Z axis of FBYDN
poly/pal=grey/ov/nol/fill/coord_ax=Z FBx4_1, FBy4_1
Command file, command group, or REPEAT execution aborted
Any help is welcome.
Sometimes in other scripts I also get problems with an error message that the input data is not a line, while it is a line. How can I avoid such errors using fill_between in general?
Best
Erik
Attachment:
ferret_fill_between_problem.jnl
Description: Binary data
Attachment:
salt.png
Description: PNG image
Attachment:
bathy.png
Description: PNG image
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
Ferret
Privacy Policy | Disclaimer | Accessibility Statement