Reading-eScience-Centre / ncwms

ncWMS - A Web Map Service for displaying environmental data over the web
Other
63 stars 30 forks source link

Missing layers when adding NetCDF #27

Closed el95149 closed 6 years ago

el95149 commented 6 years ago

Hello, we have the following layers in a NetCDF file, as depicted by Panoply:

int tropopause_altitude(analysis_time=4, latitude=90, longitude=120);
  :standard_name = "tropopause_altitude";
  :long_name = "WMO lapse-rate tropopause altitude from analysis temperature field";
  :units = "m";
  :_ChunkSizes = 4, 90, 120; // int

float mole_concentration_of_ozone_in_air(analysis_time=4, latitude=90, longitude=120);
  :standard_name = "mole_concentration_of_ozone_in_air";
  :long_name = "Mole concentration of ozone from analysis field at surface altitude";
  :units = "mol m-3";
  :_ChunkSizes = 4, 90, 120; // int

float mole_content_of_ozone_in_atmosphere_layer(analysis_time=4, layers=20, latitude=90, longitude=120);
  :standard_name = "mole_content_of_ozone_in_atmosphere_layer";
  :long_name = "Mole content of ozone in subcolumns (surface_altitude per integer-km to tropopause_altitude) from analysis field";
  :units = "mmol m-2";
  :_ChunkSizes = 2, 20, 90, 120; // int

float troposphere_mole_content_of_ozone(analysis_time=4, latitude=90, longitude=120);
  :standard_name = "troposphere_mole_content_of_ozone";
  :long_name = "Mole content of ozone in troposphere below LRT (analysis_tp_altitude_wmo) from analysis field";
  :units = "mmol m-2";
  :_ChunkSizes = 4, 90, 120; // int

float longitude(longitude=120);
  :standard_name = "longitude";
  :long_name = "Longitude, from -180 (west) to +180 (east) given at gridcell centers";
  :units = "degrees_east";
  :_ChunkSizes = 120; // int
  :_CoordinateAxisType = "Lon";

float latitude(latitude=90);
  :standard_name = "latitude";
  :long_name = "Latitude, from -90 (south) to +90 (north) given at gridcell centers";
  :units = "degrees_north";
  :_ChunkSizes = 90; // int
  :_CoordinateAxisType = "Lat";

int analysis_time(analysis_time=4);
  :standard_name = "time";
  :long_name = "Analysis time";
  :units = "hours since midnight";
  :_ChunkSizes = 4; // int

int forecast_time(forecast_time=15);
  :standard_name = "time";
  :long_name = "Starting time of the forecasts";
  :units = "hours since midnight";
  :_ChunkSizes = 15; // int

int surface_altitude(latitude=90, longitude=120);
  :standard_name = "surface_altitude";
  :long_name = "Surface altitude from ECMWF orography";
  :units = "m";
  :_ChunkSizes = 90, 120; // int
  :_CoordinateAxisType = "Height";

However, when importing the NetCDF in ncWMS (v2.4.0) the only layer imported is the last one 'surface_altitude'. All other layers are completely ignored by ncWMS (no WMS capabilities for them, not included in Godiva interface etc). It's as if they don't even exist in the file. No errors are thrown in the Tomcat logs.

Any help would be really appreciated.

guygriffiths commented 6 years ago

Layers in ncWMS must to conform to the CF conventions, but your time coordinate does not (see here for details, but in brief your midnight needs to be a referenceable datetime). Hence it's only picking up the layer which does not depend on time.

el95149 commented 6 years ago

Thanks for the quick response. Indeed, that was the problem, we addressed it already!

And while we're at it, a similar things happens with the following layer:

05 Apr 19:12:50 WARN [netcdf.NetCDFGeoreferenceManager] - Unsupported axis: int model_level_number(model_level_number=20); :standard_name = "model_level_number"; :long_name = "model_level_number"; :units = "1"; :_ChunkSizes = 20; // int

Any idea on how to correct this one? What kind of 'units' should we set? Or, should we remove the 'units' definition altogether?

Once again, thanks.

guygriffiths commented 6 years ago

For a z axis, you need one of:

If I were you I'd remove the units and add the axis attribute. That should work, although that code is part of a 3rd party library and I haven't checked. If it doesn't work, adding the positive attribute certainly will.

el95149 commented 6 years ago

Alright, will do and get back to you as soon as I have something concrete.

el95149 commented 6 years ago

@guygriffiths Alright, managed to get it fixed, following your guidelines.

Turns out the declaration needed all the following attributes, for ncWMS to recognize and expose layers involving 'model_level_number'.

int model_level_number(model_level_number=20); :standard_name = "model_level_number"; :long_name = "model_level_number"; :positive = "up"; :axis = "Z"; :units = "1"; :_ChunkSizes = 20; // int

Hope it helps someone else in the future. Once again, thanks.