Re: adding lat/lon variables from projected coordinate variables

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Tue Feb 19 2013 - 17:21:46 MST

Hi Leif,

It can be difficult trying to interpret all the various ways of specifying pre-projected grids to be able to plot them in NCL, and this one took awhile. But there is always something to learn.
In this case it is that ESPG (from wikipedia -- the European Petroleum Survey Group), which is referenced multiple times in the "spatial_ref" attribute has a useful web site that allows you to search for particular grids. And that this grid is known on their site as ESPG 3412. Searching on their site for 3412 (eventually) leads to this page:

http://spatialreference.org/ref/epsg/3412/

There among other things, you can see the parameters to provide to the proj4 map projection tool. Using these parameters I believe I have produced an accurate plot of the data -- both
using the native projection, and using a complete set of lat/lon coordinates that I generated, a plot in another projection of the same data. I am attaching some png files that demonstrate, along
with the NCL script I used to produce the plots. I also produced a modified version of your data file that contains the lat/lon coordinate arrays. This is too big to attach, but you can get it
from ftp.cgd.ucar.edu as incoming/leif_ice_llcoords.nc. I will also include the script I used to add the coordinates to the original NetCDF file. This depended on creating an ascii file with the
lat/lon coordinates using 'invproj' first. There is a bit more explanation in the comments of the script. Hope this helps.
 -dave

On Feb 18, 2013, at 12:17 PM, Leif Truelsen wrote:

> Hello,
>
> I have data that in a polar stereographic projection. However, there are no associated latitude and longitude variables, so when I attempt to plot with ncl I get the errors about not having valid coordinate arrays (e.g., check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all.). I think the most clear solution would be if I created latitude and longitude variables, no? Can anyone help direct me how to do this, or of the way to plot/manipulate the data as they are?
>
> Best regards,
> Leif
>
>
> Here's my data:
> dimensions:
> x = 1779;
> y = 1854;
> time = 10;
> variables:
> char polar_stereographic;
> :grid_mapping_name = "polar_stereographic";
> :straight_vertical_longitude_from_pole = 0.0; // double
> :false_easting = 0.0; // double
> :false_northing = 0.0; // double
> :latitude_of_projection_origin = -90.0; // double
> :standard_parallel = -70.0; // double
> :longitude_of_prime_meridian = 0.0; // double
> :semi_major_axis = 6378273.0; // double
> :inverse_flattening = 298.279411123061; // double
> :spatial_ref = "PROJCS[\"NSIDC Sea Ice Polar Stereographic South\",GEOGCS[\"Unspecified datum based upon the Hughes 1980 ellipsoid\",DATUM[\"Not_specified_based_on_Hughes_1980_ellipsoid\",SPHEROID[\"Hughes 1980\",6378273,298.279411123061,AUTHORITY[\"EPSG\",\"7058\"]],AUTHORITY[\"EPSG\",\"6054\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4054\"]],PROJECTION[\"Polar_Stereographic\"],PARAMETER[\"latitude_of_origin\",-70],PARAMETER[\"central_meridian\",0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH],AUTHORITY[\"EPSG\",\"3412\"]]";
> :GeoTransform = "-3966250 4450 0 4119400 0 -4450 ";
> :_CoordinateTransformType = "Projection";
> :_CoordinateAxisTypes = "GeoX GeoY";
> float ice(time=10, y=1854, x=1779);
> :_FillValue = -3.4028235E38f; // float
> :grid_mapping = "polar_stereographic";
> double time(time=10);
> :calendar = "365_day";
> :standard_name = "time";
> :units = "hours since 2001-00-00 00:00:00";
> double x(x=1779);
> :standard_name = "projection_x_coordinate";
> :long_name = "x coordinate of projection";
> :units = "m";
> :_CoordinateAxisType = "GeoX";
> double y(y=1854);
> :standard_name = "projection_y_coordinate";
> :long_name = "y coordinate of projection";
> :units = "m";
> :_CoordinateAxisType = "GeoY";
> _______________________________________________
> 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 Tue Feb 19 17:22:01 2013

This archive was generated by hypermail 2.1.8 : Fri Feb 22 2013 - 17:42:16 MST