Closed dopplershift closed 6 years ago
This issue is related to #450 and #337: NCSS NetCDF output files only include selected data variables and the variables that comprise their coordinate systems. NCSS is not smart enough to examine attributes to find other variables that should be included. Auxiliary coordinate variables (i.e. variables listed in the coordinates
attribute) are particularly tricky, because they would need to be subset in the same way that the primary coordinate variables are.
While I don't doubt the sentiment of your statement, the fact that this problem doesn't occur with e.g. Lambert Conformal output from HRRR on TDS would seems to indicate that the problem is specific to lat/lon coordinate systems, and not a more general NCSS issue.
Hmm, you're right. First, in addition to the variables I mentioned above, NCSS also includes the coordinate transform variables. However, when a GribCoverageDataset
creates its CoverageCollection
s, transforms of type LatLon_Projection
are explicitly excluded. So, as is often the case, the issue is upstream of NCSS.
Does anyone know why this decision was made? Perhaps John forgot that there are some cases where including a LatLon_Projection
transform is actually necessary, e.g. when using a non-standard Earth radius? The fix is simple, but I'd like to understand the reasoning a bit better before I make the change and potentially break a bunch of stuff.
I'm guessing that's right. CF doesn't require it, but it also doesn't mind if you do include it. My preference is to include it always, because it simplifies my code (though I'll probably have to deal with lat/lon data without it from other source); if we leave it out, then we just need to make sure that it doesn't list a grid_mapping
.
No idea why LatLon_Projection
is excluded. Given that CoverageCollecion
is so new, changing this behavior won't break anyone's code, and including it seems critical to actually using the data in a meaningful way. For example, without it, how is an end user going to compute spatial derivatives?
According to CF:
This grid mapping [
grid_mapping_name = latitude_longitude
] defines the canonical 2D geographical coordinate system based upon latitude and longitude coordinates on a spherical Earth. It is included so that the figure of the Earth can be described.
I'd say we should always include it for maximum clarity.
For a straightforward request for data from models on lat/lon grids (say: http://thredds.ucar.edu/thredds/ncss/grib/NCEP/GFS/Global_0p5deg/GFS_Global_0p5deg_20180302_0000.grib2?var=Temperature_isobaric&disableLLSubset=on&disableProjSubset=on&horizStride=1&time_start=2018-03-02T00%3A00%3A00Z&time_end=2018-03-18T00%3A00%3A00Z&timeStride=1&vertCoord=&accept=netcdf4), the return doesn't seem to be CF-compliant:
Specifically, the
grid_mapping
attribute references aLatLon_Projection
variable, which is not included in the file. While it's not necessary, it would probably be good to include this as alatitude_longitude
projection so that the assumed radius of the earth can be included.I have this this on 0.5 GFS and WW3 output. A netCDF file generated a year ago (for the 0.25 GFS) doesn't seem to have this problem--but only because there isn't a
grid_mapping
attribute. I'm not sure that's actually better.