[Thread Prev][Thread Next][Index]

Re: [ferret_users] shade/modulo every time



Hi Patrick,
/HLIM is intended to set the axis limits without impacting the context of the expression you're plotting. It lets you set up the plot axes independent of the data. It's also a way to handle curvilinear grids where specifying /X= isn't the right way to go. To get what you want, for data on a rectilinear grid, it would be

   shade/x=-180:180:30 temp[k=1]

and then the modulo character of the longitudes is applied. We have plans to make commands more seamless for users, to make better use of the coordinates attributes, so that you won't have to use the 3-argument form of the plot commands when your data is on a curvilinear grid.

For now, perhaps using symbols is a reasonable solution

   if ($curvilienar) then
      define symbol plot_qualifiers /hlim=-180:180:30
      define symbol plot_var = temp[k=1], x_coords, y_coords
   else
      define symbol plot_qualifiers /x=-180:180
      define symbol plot_var = temp[k=1]
   endif

   shade($plot_qualifiers)  ($plot_var)

Ansley


On 3/6/2012 9:00 AM, Brockmann Patrick wrote:
Hi all,

I am wondering if it could be possible to have the qualifier /modulo
for the shade command even if I use this command with 1 arg
(this qualifier is proposed only for the shade 3 args)

For now, the only way to get a correct plot is to specify var with var[x=-180:180]

yes? use levitus_climatology
yes? shade/hlim=-180:180:30 temp[k=1]
--> missing some part of the plot

You then must do
yes? shade/hlim=-180:180:30 temp[k=1,x=-180:180]

But I would like to do:
yes? shade/hlim=-180:180:30/modulo temp[k=1]

By this way, I can treat in the same way, variables that are with rectlinear grid
and the ones that are with curvilinear grids.
In both case, I will use:
shade/hlim=-180:180:30/modulo var [,...]

I can even think to a transparent way to swith between shade1arg and shade3args.
Bellow the script that does the switch.

let me know, if this request can be accpeted or if there is a good workaround.

Regards
Patrick

$ cat CMIP5_shade.jnl
!======================================
let allnames = ..varnames

def sym isexist_lon=`IS_ELEMENT_OF_STR (allnames, "lon")`
def sym isexist_lat=`IS_ELEMENT_OF_STR (allnames, "lat")`

if `($isexist_lon) AND ($isexist_lat)` then
       set variable/units="degrees_east"/title="Longitude" lon
       set variable/units="degrees_north"/title="Latitude" lat
       def sym nbpts=`lon,return=isize`
       set axis/modulo `lon,return=xaxis`
       ($01)/modulo/i=1:`($nbpts)+1` ($02),lon,lat

else
       ($01) ($02)

endif
!======================================

$ ferret
yes? go CMIP5_shade.jnl shade/lev=20 var2D




[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement