[Thread Prev][Thread Next][Index]

Re: [ferret_users] polar stereographic projection



Hi Robert,

There's a FAQ on this, http://ferret.pmel.noaa.gov/Ferret/faq/curvilinear-data-in-map-projections


Working through it, you plot some ordinary gridded data using the map projection as an underlay.
yes? use etopo20
yes? set grid rose
yes? SET REGION/X=0:360/Y=50:90
yes? GO mp_stereographic_north 180 50
yes? GO mp_aspect
yes? set win/aspect=1:axis/siz=0.5
yes? let land = if rose gt 0 then 1
yes? let masked_land = land* mp_mask
yes? shade/noax/pal=gray/nolab/nokey masked_land, x_page, y_page
yes? frame/file=p1.png  ! see attached
Now open your dataset, and use the curvilinear coordinate variables in it to redefine the map projection variables as described in the FAQ.  We need to cancel the region so it doesn't get applied to the i,j indices of the curvilinear grid.
yes? use sample2_pop9km.nc
yes? SET grid temp
yes? LET masked_sst = temp * mp_mask
yes? let mp_lambda =  ulong*deg2rad
yes? let mp_phi = ulat*deg2rad
yes? cancel reg
yes? shade/over/nolab/key masked_sst, x_page, y_page
yes? frame/file=p2.png  ! see attached
So, what to do about the part of the grid hanging around the outside of the plot circle?   Define a mask using the latitude coordinate variable,
yes? let mask_for_region = if ulat gt 50 then 1
yes? let masked_sst_variable = masked_sst*mask_for_region
Start all over, first making the underlay to set up the plot, and then the overlay as we did just above, but this time,
yes? shade/over/nolab/key masked_sst_variable, x_page, y_page
Then you could go on as in the FAQ to restore the definitions of mp_lambda and mp_phi to make a graticule, etc.  and maybe add some labels
yes? let mp_lambda = mp_x * deg2rad
yes? let mp_phi    = mp_y * deg2rad
yes? SET REGION/X=0:360/Y=50:90
yes? GO mp_fland 20
yes? GO mp_land thick
yes? GO mp_graticule
yes? annotate/norm/x=0.5/y=-0.1/halign=0 "`temp,return=title` (`temp,return=units`)"
yes? frame/file=p3.png

(I did this using PyFerret, but it all works in Ferret too.  Just save the images as *.gif)


On 4/3/2017 2:07 PM, Osinski, Robert FORNATL, PL wrote:
Dear ferreters,
I'd like to create a figure with polar stereograpic projection. I've created a fig. stereo_test.tiff (attached) with commands:

use sample2_pop9km.nc
SET grid temp
SET REGION/X=0:360/Y=50:90/L=1
GO mp_stereographic_north 180 50
GO mp_aspect
LET masked_sst = temp * mp_mask
FILL/NOAXES/NOLAB masked_sst, x_page, y_page
GO mp_fland 20
 GO mp_land
GO mp_graticule

Unfortunately it looks like temperature distribution is not correct at  stereo_test.tiff. The fig1.tiff (attached) is what sst should be. I also put to google.drive a netCDF file which I used to create figures,


Thanks you for any advise,
Robert Osinski
NPS 

Attachment: p1.png
Description: PNG image

Attachment: p2.png
Description: PNG image

Attachment: p3.png
Description: PNG image


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

Privacy Policy | Disclaimer | Accessibility Statement