Re: [thredds] NetCDF subsetting

  • Subject: Re: [thredds] NetCDF subsetting
  • From: John Caron <caron@xxxxxxxxxxxxxxxx>
  • Date: Mon, 15 Feb 2010 09:52:48 -0700
Robb Kambic wrote:
On Tue, 9 Feb 2010, Kyle Shannon wrote:

Hello all,
I am using the netCDF subsetting service on ucar's motherlode thredds
server. I am having an issue with the projection of the subset.

I run ncdump on the entire ndfd grid (full spatial extents) and get:

kyle@Lucky13:~/nc_issue$ ncdump -h ndfd_all.nc | grep Lambert_Conformal
        Maximum_temperature:grid_mapping = "Lambert_Conformal" ;
    char Lambert_Conformal ;
        Lambert_Conformal:grid_mapping_name = "lambert_conformal_conic" ;
        Lambert_Conformal:standard_parallel = 25. ;
        Lambert_Conformal:longitude_of_central_meridian = 265. ;
        Lambert_Conformal:latitude_of_projection_origin = 25. ;
        Lambert_Conformal:earth_shape = "Earth spherical with radius
specified by producer in m" ;
        Lambert_Conformal:spherical_earth_radius_meters = 6371200. ;
        Lambert_Conformal:GRIB_param_Dx = 5079.361 ;
        Lambert_Conformal:GRIB_param_Dy = 5079.472 ;
        Lambert_Conformal:GRIB_param_GDSkey = 801839731 ;
        *Lambert_Conformal:GRIB_param_La1 = 20.192 ;
        Lambert_Conformal:GRIB_param_LaD = 25. ;
        Lambert_Conformal:GRIB_param_Latin1 = 25. ;
        Lambert_Conformal:GRIB_param_Latin2 = 25. ;
        *Lambert_Conformal:GRIB_param_Lo1 = 238.446 ;
        Lambert_Conformal:GRIB_param_LoV = 265. ;
        Lambert_Conformal:GRIB_param_NpProj = "true" ;
        Lambert_Conformal:GRIB_param_Nx = 1073 ;
        Lambert_Conformal:GRIB_param_Ny = 689 ;
        Lambert_Conformal:GRIB_param_ProjFlag = 0 ;
        Lambert_Conformal:GRIB_param_Quasi = "false" ;
        Lambert_Conformal:GRIB_param_ResCompFlag = 8 ;
        Lambert_Conformal:GRIB_param_SpLat = -90. ;
        Lambert_Conformal:GRIB_param_SpLon = 0. ;
Lambert_Conformal:GRIB_param_VectorComponentFlag = "gridRelative" ;
        Lambert_Conformal:GRIB_param_Winds = "Relative" ;
        Lambert_Conformal:GRIB_param_grid_name = "Lambert_Conformal" ;
Lambert_Conformal:GRIB_param_grid_radius_spherical_earth = 6371200.
;
        Lambert_Conformal:GRIB_param_grid_shape = "Earth spherical with
radius specified by producer in m" ;
        Lambert_Conformal:GRIB_param_grid_shape_code = 1 ;
        Lambert_Conformal:GRIB_param_grid_type = 30 ;
        Lambert_Conformal:GRIB_param_grid_units = "m" ;
        Lambert_Conformal:GRIB_param_scanning_mode = 64 ;
        Lambert_Conformal:_CoordinateTransformType = "Projection" ;
        Lambert_Conformal:_CoordinateAxisTypes = "GeoX GeoY" ;

and when I run it on the subsetted data, I get:

kyle@Lucky13:~/nc_issue$ ncdump -h ndfd.nc | grep Lambert_Conformal
        Maximum_temperature:grid_mapping = "Lambert_Conformal" ;
    char Lambert_Conformal ;
        Lambert_Conformal:grid_mapping_name = "lambert_conformal_conic" ;
        Lambert_Conformal:standard_parallel = 25. ;
        Lambert_Conformal:longitude_of_central_meridian = 265. ;
        Lambert_Conformal:latitude_of_projection_origin = 25. ;
        Lambert_Conformal:earth_shape = "Earth spherical with radius
specified by producer in m" ;
        Lambert_Conformal:spherical_earth_radius_meters = 6371200. ;
        Lambert_Conformal:GRIB_param_Dx = 5079.361 ;
        Lambert_Conformal:GRIB_param_Dy = 5079.472 ;
        Lambert_Conformal:GRIB_param_GDSkey = 801839731 ;
        Lambert_Conformal:GRIB_param_La1 = 20.192 ;
        Lambert_Conformal:GRIB_param_LaD = 25. ;
        Lambert_Conformal:GRIB_param_Latin1 = 25. ;
        Lambert_Conformal:GRIB_param_Latin2 = 25. ;
        Lambert_Conformal:GRIB_param_Lo1 = 238.446 ;
        Lambert_Conformal:GRIB_param_LoV = 265. ;
        Lambert_Conformal:GRIB_param_NpProj = "true" ;
        Lambert_Conformal:GRIB_param_Nx = 1073 ;
        Lambert_Conformal:GRIB_param_Ny = 689 ;
        Lambert_Conformal:GRIB_param_ProjFlag = 0 ;
        Lambert_Conformal:GRIB_param_Quasi = "false" ;
        Lambert_Conformal:GRIB_param_ResCompFlag = 8 ;
        Lambert_Conformal:GRIB_param_SpLat = -90. ;
        Lambert_Conformal:GRIB_param_SpLon = 0. ;
Lambert_Conformal:GRIB_param_VectorComponentFlag = "gridRelative" ;
        Lambert_Conformal:GRIB_param_Winds = "Relative" ;
        Lambert_Conformal:GRIB_param_grid_name = "Lambert_Conformal" ;
Lambert_Conformal:GRIB_param_grid_radius_spherical_earth = 6371200.
;
        Lambert_Conformal:GRIB_param_grid_shape = "Earth spherical with
radius specified by producer in m" ;
        Lambert_Conformal:GRIB_param_grid_shape_code = 1 ;
        Lambert_Conformal:GRIB_param_grid_type = 30 ;
        Lambert_Conformal:GRIB_param_grid_units = "m" ;
        Lambert_Conformal:GRIB_param_scanning_mode = 64 ;
        Lambert_Conformal:_CoordinateTransformType = "Projection" ;
        Lambert_Conformal:_CoordinateAxisTypes = "GeoX GeoY" ;
        Total_cloud_cover:grid_mapping = "Lambert_Conformal" ;
Wind_direction_from_which_blowing:grid_mapping = "Lambert_Conformal"
;
        Wind_speed:grid_mapping = "Lambert_Conformal" ;

My question is, how can the latitude and longitude of the 1st cell not
change after the subsetting?  It appears that the meta data from the full
dataset is just copied to the subset data. Is this correct?

Kyle,

As Robb says, all the Lambert_Conformal:GRIB_XXXX attributes are simply copied over to 
the netcdf file from the GRIB GDS. We dont use these GRIB parameters for anything. Robb 
failed to mention that the actual coordinates are stored in the x and y coordinate 
variables in the netcdf file. In this case these are projection coordinates, which are 
converted to lat/lon values through the lambert conformal projection.  If you check the 
"include lat/lon" box, the 2D lat/lon coordinates will also be included in the 
file, as Robb indicates. This is needed to be in strict compliance with CF conventions, 
but is not needed by the CDM software.



Yes. The GDS parameters that you are looking at are the parameters for the model, so they are copied over to the resulting file. Usually users make the subsetting file name contain the latitude and longitude information of the subset.

How can I
figure out where my subset data is on the world?


Click the check box on the sub-set page for "Add Lat/Lon to file"
to the resulting file. Now the ncdump on the Lat and Lon variables will be available.

When you open/display the file the information will also be available.

On a programming level:

If you open the file as a GridDataset, you should be able to access the needed information. Here's an url about GridDatasets:

http://www.unidata.ucar.edu/software/netcdf-java/tutorial/GridDatatype.html

You will also need to to look at the java-docs on the GridDataset.


RObb...


Thanks, sorry for the messy message.

kss
# ===================
Kyle Shannon
Physical Science Technician
RMRS Fire Sciences Lab
Fire, Fuels & Smoke - RWU 4405
5775 Highway 10 W.
Missoula, MT 59808
(406) 829-6954
kshannon@xxxxxxxxx
# ===================



===============================================================================
Robb Kambic                       Unidata Program Center
Software Engineer III               Univ. Corp for Atmospheric Research
rkambic@xxxxxxxxxxxxxxxx           WWW: http://www.unidata.ucar.edu/
===============================================================================


------------------------------------------------------------------------

_______________________________________________
thredds mailing list
thredds@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/



  • 2010 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the thredds archives: