Hi Mark,
Your use of the "bounds" attribute looks correct to me. If the edges of
your plot are at the dateline and poles then I'd have to agree with you
that the bounds attribute info is apparently being ignored.
Brian
On Tue, Nov 21, 2006 at 12:35:07PM -0700, Mark Ohrenschall wrote:
> I think I'm writing a netCDF file using the CF-1.0 cell boundaries
> convention properly --
> http://www.cgd.ucar.edu/cms/eaton/cf-metadata/CF-1.0.html#bnds -- and
> I'd welcome any corrections or suggestions, but in particular my problem
> is that I'm finding that my data is not being displayed as I would
> expect it to be in the IDV.
>
> So I'm trying out for the first time using the CF-1.0 cell boundaries
> convention to signify that I have not a grid of point data, but a grid
> of "cell averages" -- actually, occurrences of measurements anywhere
> within a given grid cell. These are 5-degree grid cells whose boundaries
> align with +/- 180 and +/- 90 and all the intervening 5-degree
> increments, i.e., your typical, run-of-the-mill 5-degree grid.
>
> Given that these data are not points at 5-degree intervals but areas
> that span 5-degrees in both latitude and longitude, I believe that it's
> essentially arbitrary what scheme I choose for setting the values in my
> latitude and longitude coordinate variables, e.g., -90, -85, -80, ...,
> 85 or -85, -80, -75, ..., 90 or -87.5, -82.5, -77.5, ..., 87.5 or
> whatever -- what's salient is what values I set for the bounds variables
> for each of latitude and longitude, i.e., the bounds variables must
> express the edge coordinates, which for latitude would be: -90, -85;
> -85, -80; -80, -75; ...; 80, 85; 85, 90.
>
> Here's the ncdump:
>
> [mao at panther mao]$ ncdump -v latitude,lat_bnds test.nc
> netcdf test {
> dimensions:
> obsdate = UNLIMITED ; // (52 currently)
> latitude = 36 ;
> longitude = 72 ;
> nv = 2 ;
> variables:
> float latitude(latitude) ;
> latitude:bounds = "lat_bnds" ;
> latitude:standard_name = "latitude" ;
> latitude:long_name = "Latitude" ;
> latitude:units = "degrees_north" ;
> latitude:valid_range = -9000s, 9000s ;
> latitude:valid_min = -9000s ;
> latitude:valid_max = 9000s ;
> float lat_bnds(latitude, nv) ;
> float longitude(longitude) ;
> longitude:bounds = "lon_bnds" ;
> longitude:standard_name = "longitude" ;
> longitude:long_name = "Longitude" ;
> longitude:units = "degrees_east" ;
> longitude:valid_range = -18000s, 18000s ;
> longitude:valid_min = -18000s ;
> longitude:valid_max = 18000s ;
> float lon_bnds(longitude, nv) ;
> int obsdate(obsdate) ;
> obsdate:standard_name = "obsdate" ;
> obsdate:long_name = "reference time" ;
> obsdate:units = "seconds since 1970-01-01 00:00:00 UTC" ;
> short type_151(obsdate, latitude, longitude) ;
> type_151:_FillValue = 0s ;
> type_151:coordinates = "latitude longitude obsdate" ;
> type_151:add_offset = 0.f ;
> type_151:scale_factor = 1.f ;
> type_151:standard_name = "Type_151" ;
> type_151:long_name = "Observation Type 151 counts in
> 5-degree squares" ;
> type_151:units = "count" ;
> short type_152(obsdate, latitude, longitude) ;
> type_152:_FillValue = 0s ;
> type_152:coordinates = "latitude longitude obsdate" ;
> type_152:add_offset = 0.f ;
> type_152:scale_factor = 1.f ;
> type_152:standard_name = "Type_152" ;
> type_152:long_name = "Observation Type 152 counts in
> 5-degree squares" ;
> type_152:units = "count" ;
> short type_159(obsdate, latitude, longitude) ;
> type_159:_FillValue = 0s ;
> type_159:coordinates = "latitude longitude obsdate" ;
> type_159:add_offset = 0.f ;
> type_159:scale_factor = 1.f ;
> type_159:standard_name = "Type_159" ;
> type_159:long_name = "Observation Type 159 counts in
> 5-degree squares" ;
> type_159:units = "count" ;
>
> // global attributes:
> :Conventions = "CF-1.0" ;
> :title = "Observation Type Counts for Five Degree Squares." ;
> :institution = "NOAA National Environmental Satellite, Data
> and Information Service" ;
> :source = "NOAA NESDIS Office of Satellite Data Processing
> and Distribution" ;
> :history = "2006-11-21 11:57:07 -0700 Translated from test
> into netCDF at NGDC" ;
> :references =
> "http://www2.ncdc.noaa.gov/docs/klm/html/c9/sec91-2.htm" ;
> :comment = "Miscellaneous information about the data or
> methods used to produce it." ;
> data:
>
> latitude = -87.5, -82.5, -77.5, -72.5, -67.5, -62.5, -57.5, -52.5, -47.5,
> -42.5, -37.5, -32.5, -27.5, -22.5, -17.5, -12.5, -7.5, -2.5, 2.5, 7.5,
> 12.5, 17.5, 22.5, 27.5, 32.5, 37.5, 42.5, 47.5, 52.5, 57.5, 62.5, 67.5,
> 72.5, 77.5, 82.5, 87.5 ;
>
> lat_bnds =
> -90, -85,
> -85, -80,
> -80, -75,
> -75, -70,
> -70, -65,
> -65, -60,
> -60, -55,
> -55, -50,
> -50, -45,
> -45, -40,
> -40, -35,
> -35, -30,
> -30, -25,
> -25, -20,
> -20, -15,
> -15, -10,
> -10, -5,
> -5, 0,
> 0, 5,
> 5, 10,
> 10, 15,
> 15, 20,
> 20, 25,
> 25, 30,
> 30, 35,
> 35, 40,
> 40, 45,
> 45, 50,
> 50, 55,
> 55, 60,
> 60, 65,
> 65, 70,
> 70, 75,
> 75, 80,
> 80, 85,
> 85, 90 ;
> }
> [mao at panther mao]$
>
> I've also attached a captured image of this data as displayed in the
> IDV, with some diagonal marker values I added to the data in each of the
> four corners. It appears that the IDV is doing a couple things that make
> the display suspicious-looking: first, each marker grid cell in the
> extreme corners are being clipped to perhaps one-quarter their size
> (compared to their diagonally adjacent marker buddies); and second, the
> reference map of coastlines appears offset from the data, as if the IDV
> thinks that the geographic boundaries of the data are given by the
> latitude and longitude coordinate variables (which makes perfect sense
> for point data, but not for cell area data).
>
> Any thoughts or suggestions, or observations about anything I'm doing wrong?
>
> Thanks *--* Mark
> _______________________________________________
> CF-metadata mailing list
> CF-metadata at cgd.ucar.edu
> http://www.cgd.ucar.edu/mailman/listinfo/cf-metadata
Received on Tue Nov 21 2006 - 14:11:33 GMT