[Thread Prev][Thread Next][Index]

Re: [ferret_users] gridxy and (orthographic) map projection



Hi Paulo,
The script mp_graticule.jnl can be used to draw lines at any set of x and y locations on a map-projection plot.  If you look at the script,
go/help mp_graticule
here are the arguments.

! Usage:              arg1      arg2      arg3        arg4      arg5      arg6      arg7  arg8
!  go mp_graticule [lon_min] [lon_max] [lon_delta] [lat_min] [lat_max] [lat_delta] [pen]  [winflag]

To plot lines at the grid boundaries, you could use pseudo-variables xboxlo, xboxhi, xbox, etc to set the min, max, and delta values so the lines will be drawn atthe edges of the x and y axis cells of your original variable , e.g. if the variable you're plotting is called "var",
go mp_graticule `xboxlo[gx=var,x=20]` `xboxhi[gx=var,x=300]` `xbox[gx=var,x=1]` `yboxlo ...  
Where you'd put in the particular range of longitudes and latitudes you're using or get the range from the grid of the variable.



To put dots at the CENTERS of the grid boxes is easy.  Say your map projection plot command is:
shade/noax mp_mask*sst, x_page, y_page
Then just
plot/over/vs mp_mask*x_page, mp_mask*y_page
If you look at the map projection scripts,
go/help mp_orthographic
you'll see these commands at the start of all the scripts:
let/quiet mp_x = x
let/quiet mp_y = y

The x and y here refer to the x and y coordinates of the variable you specified with the "SET GRID var". (This is why that SET GRID command is needed).  After running mp_orthographic.jnl, a bunch of variables have been set up based on this mp_x and mp_y.  If you now say,
let/quiet mp_x = xboxlo
let/quiet mp_y = yboxlo
then when any of the map projection variables are used, they are still defined in terms of mp_x and mp_y, but these now refer to the edges of the grid cells of your original variable. Do this AFTER making the color plot of the variable. So, this command will put dots at the grid cell corners:
plot/over/vs/sym  mp_mask*x_page, mp_mask*y_page
Try this quick script to illustrate this:  I've zoomed in and used SHADE so we can see the grid cells easily
use coads_climatology
set region/x=280:325/y=30:60
set grid sst

go mp_orthographic 300 45
shade/noax/title=SST mp_mask*sst[l=1], x_page, y_page

plot/nolab/vs/over/sym=3  mp_mask*x_page, y_page

 ! Redefine x_page and y_page so they refer to cell corners

let/quiet mp_x = xboxlo
let/quiet mp_y = yboxlo
plot/nolab/vs/over/sym=3/color=lightblue mp_mask*x_page, y_page

go mp_graticule      ! here just draw lines at default locations
frame/file=dots.gif

the image from the above script

Or use sym=dot which makes a tiny dot  and looks particularly nice when you run Ferret in gif mode.

Ansley

Paulo Santiago wrote:
Hi Ferreters,

I would like to fill/shade a variable on a orthographic map projection, and I would like to illustrate my horizontal grid. "go gridxy" doesn`t work in this case. Is there a ready tool to do this task?

Also I would like to know how to replace the gridxy lines by single points (placed at xy gridlines interceptions).

Any suggestion is welcome!


Cheers,
Paulo Santiago


[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement