Re: polar stereographic grid mapping

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri, 12 Jun 2009 10:11:57 -0600 (MDT)

On Fri, 12 Jun 2009 debasish_at_gi.alaska.edu wrote:

> Hello,
>
> I am attaching the dimension of a variable below. I just want to know
> the best way to plot the variable "pcp". Do I need to transform the
> coordinate to plot the variable pcp.
>
> Thanks
>
> Debasish

Hi Debasish,

Given that you have lat, lon arrays on your file, you should be able
to use them to do the plotting.

Here's some bare minimum code to plot the first timestep:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"

begin
   a = addfile("file.nc","r")
   pcp = a->pcp(0,:,:)
   pcp_at_lat2d = a->lat2d
   pcp_at_lon2d = a->lon2d

   wks = gsn_open_wks("ps" ,"polar")
   res = True
   res_at_gsnPolar = "NH" ; This is the default; "SH" also valid.
   plot = gsn_csm_contour_map_polar(wks,pcp,res)
end

Note that using lat2d/lon2d can be slow.

If you can figure out the exact map projection from the information on
your file, then a quicker way is to not use lat2d/lon2d, and instead
set:

    res_at_tfDoNDCOverlay = True

But, you need to set one more "mp" resources to get the projection
exactly right. This may include setting one or more of mpProjection,
mpCenterLonF, mpCenterLatF, mpLimitMode (if not "LatLon"), etc.

--Mary

> float pcp(time, yc, xc) ;

> dimensions:
> xc = 180 ;
> yc = 172 ;
> time = UNLIMITED ; // (124 currently)
> variables:
> float xc(xc) ;
> xc:units = "m" ;
> xc:long_name = "x-coordinate of polar_stereographic
> projection" ;
> xc:standard_name = "projection_x_coordinate" ;
> xc:axis = "X" ;
> xc:coordinate_defines = "point" ;
> xc:actual_range = 22500., 8077500. ;
> float yc(yc) ;
> yc:units = "m" ;
> yc:long_name = "y-coordinate of polar_stereographic
> projection" ;
> yc:standard_name = "projection_y_coordinate" ;
> yc:axis = "Y" ;
> yc:coordinate_defines = "point" ;
> yc:actual_range = 22500., 7717500. ;
> double time(time) ;
> time:long_name = "time" ;
> time:standard_name = "time" ;
> time:axis = "T" ;
> time:units = "hours since 1958-01-01 00:00:0.0" ;
> time:delta_t = "0000-00-00 06:00:00" ;
> time:coordinate_defines = "point" ;
> time:actual_range = 26280., 27018. ;
> float lon(yc, xc) ;
> lon:units = "degrees_east" ;
> lon:long_name = "longitude" ;
> lon:standard_name = "longitude" ;
> lon:actual_range = 161.519805908203, 331.743162155151 ;
> float lat(yc, xc) ;
> lat:units = "degrees_north" ;
> lat:long_name = "latitude" ;
> lat:standard_name = "latitude" ;
> lat:actual_range = 11.9236116409302, 87.0431594848633 ;
> char polar_stereographic ;
> polar_stereographic:grid_mapping_name =
> "polar_stereographic" ;
>
> polar_stereographic:straight_vertical_longitude_from_pole = -115.f ;
> polar_stereographic:standard_parallel = 60.f ;
> polar_stereographic:false_easting = 2700000.f ;
> polar_stereographic:false_northing = 8023500.f ;
> polar_stereographic:latitude_of_projection_origin = 90.f ;
> polar_stereographic:resolution_at_standard_parallel =
> 45000.f ;
> float pcp(time, yc, xc) ;
> pcp:long_name = "Total precipitation rate" ;
> pcp:units = "kg m-2 s-1" ;
> pcp:statistic = "archiving period mean" ;
> pcp:standard_name = "precipitation_flux" ;
> pcp:actual_range = 5.24434976309962e-25, 0.0014852563617751 ;
> pcp:coordinates = "lon lat" ;
> pcp:grid_mapping = "polar_stereographic" ;
> pcp:level_desc = "Surface" ;
> pcp:grid_desc = "polar_stereographic" ;
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jun 12 2009 - 10:11:57 MDT

This archive was generated by hypermail 2.2.0 : Mon Jun 15 2009 - 08:53:05 MDT