Reading-eScience-Centre / ncwms

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

One variable of netCDF file is missing while the other is loaded to ncWMS #62

Closed nuds-zhao closed 3 years ago

nuds-zhao commented 3 years ago

I'm trying to load a nc file with two variables, and there is no error loading it. But only one of the variables are loaded successfully.

QFX is loaded and can be displayed in Godiva interface, but SOIL_M is missing.

Thanks a lot in advance. Any help will be appreciated.

Here is header of the file:

` dimensions: south_north = 741 ; Time = UNLIMITED ; // (1 currently) DateStrLen = 19 ; west_east = 1481 ; soil_layers_stag = 4 ; variables: char albers_conical_equal_area ; albers_conical_equal_area:false_northing = 0s ; albers_conical_equal_area:false_easting = 0s ; albers_conical_equal_area:latitude_of_projection_origin = 23.f ; albers_conical_equal_area:longitude_of_central_meridian = 264.f ; albers_conical_equal_area:standard_parallel = 29.5f, 45.5f ; albers_conical_equal_area:grid_mapping_name = "albers_conical_equal_area" ; albers_conical_equal_area:_FillValue = "" ; double south_north(south_north) ; south_north:units = "m" ; south_north:long_name = "y coordinate of projection" ; south_north:standard_name = "projection_y_coordinate" ; south_north:_FillValue = 9.96920996838687e+36 ; char Times(Time, DateStrLen) ; float QFX(Time, south_north, west_east) ; QFX:description = "Total latent heat to atmosphere" ; QFX:units = "mm" ; QFX:stagger = "-" ; QFX:coordinates = "south_north west_east" ; QFX:grid_mapping = "albers_conical_equal_area" ; QFX:_FillValue = 9.96921e+36f ; float SOIL_M(Time, south_north, soil_layers_stag, west_east) ; SOIL_M:coordinates = "south_north west_east" ; SOIL_M:grid_mapping = "albers_conical_equal_area" ; SOIL_M:description = "volumetric soil moisture" ; SOIL_M:units = "m3" ; SOIL_M:_FillValue = 9.96921e+36f ; SOIL_M:MemoryOrder = "XZY" ; SOIL_M:stagger = "z" ; double west_east(west_east) ; west_east:units = "m" ; west_east:standard_name = "projection_x_coordinate" ; west_east:long_name = "x coordinate of projection" ; west_east:_FillValue = 9.96920996838687e+36 ; double Time(Time) ; Time:units = "hours since 2020-03-19 23:00:00" ; Time:_FillValue = 9.96920996838687e+36 ;

// global attributes: :TITLE = "OUTPUT FROM HRLDAS v20150506" ; :missing_value = -1.e+33f ; :START_DATE = "2017-10-01_00:00:00" ; :MAP_PROJ = 1 ; :LAT1 = 39.71886f ; :LON1 = -103.9488f ; :DX = 1000.f ; :DY = 1000.f ; :TRUELAT1 = 45.f ; :TRUELAT2 = 45.f ; :STAND_LON = 45.f ; :MMINLU = "MODIFIED_IGBP_MODIS_NOAH" ; :NCO = "4.7.2" ; :nco_openmp_thread_number = 1 ; :Conventions = "CF-1.5" ;`

guygriffiths commented 3 years ago

The issue is that SOIL_M does not have clearly defined geo-spatial co-ordinates. soil_layers_stag is just a dimension, it needs to be a co-ordinate variable before it can be interpreted as representing z-height.

We would also usually expect the dimensions of SOIL_M to be in the order t, z, y, x, but I'm not sure whether this is necessary or not (those details are abstracted away by a third-party library).

nuds-zhao commented 3 years ago

Thank you so much!

I first added soil_layers_stag variable just like south_north and west_east, but it still doesn't work. Then I was told that axis and positive attributes are necessary for z-height variable. Now I can see SOIL_M in ncWMS server.

Following is the metadata looks like now:

dimensions: Time = UNLIMITED ; // (1 currently) DateStrLen = 19 ; south_north = 741 ; west_east = 1481 ; soil_layers_stag = 4 ; variables: char albers_conical_equal_area ; albers_conical_equal_area:grid_mapping_name = "albers_conical_equal_area" ; albers_conical_equal_area:standard_parallel = 29.5f, 45.5f ; albers_conical_equal_area:longitude_of_central_meridian = 264.f ; albers_conical_equal_area:latitude_of_projection_origin = 23.f ; albers_conical_equal_area:false_easting = 0. ; albers_conical_equal_area:false_northing = 0. ; albers_conical_equal_area:_FillValue = "" ; char Times(Time, DateStrLen) ; float QFX(Time, south_north, west_east) ; QFX:MemoryOrder = "XY" ; QFX:description = "Total latent heat to atmosphere" ; QFX:units = "mm" ; QFX:stagger = "-" ; QFX:coordinates = "south_north west_east" ; QFX:grid_mapping = "albers_conical_equal_area" ; QFX:_FillValue = 9.96921e+36f ; float SOIL_M(Time, soil_layers_stag, south_north, west_east) ; SOIL_M:MemoryOrder = "TZXY" ; SOIL_M:description = "volumetric soil moisture" ; SOIL_M:units = "m3" ; SOIL_M:stagger = "Z" ; SOIL_M:coordinates = "soil_layers_stag south_north west_east" ; SOIL_M:grid_mapping = "albers_conical_equal_area" ; SOIL_M:_FillValue = 9.96921e+36f ; double south_north(south_north) ; south_north:standard_name = "projection_y_coordinate" ; south_north:long_name = "y coordinate of projection" ; south_north:units = "m" ; south_north:_FillValue = 9.96920996838687e+36 ; double west_east(west_east) ; west_east:long_name = "x coordinate of projection" ; west_east:standard_name = "projection_x_coordinate" ; west_east:units = "m" ; west_east:_FillValue = 9.96920996838687e+36 ; double soil_layers_stag(soil_layers_stag) ; soil_layers_stag:standard_name = "soil_layers" ; soil_layers_stag:long_name = "layers of soil moisture" ; soil_layers_stag:units = "m" ; soil_layers_stag:axis = "Z" ; soil_layers_stag:positive = "down" ; soil_layers_stag:_FillValue = 9.96920996838687e+36 ; double Time(Time) ; Time:units = "hours since 2020-03-19 23:00:00" ; Time:_FillValue = 9.96920996838687e+36 ;

// global attributes: :TITLE = "OUTPUT FROM HRLDAS v20150506" ; :missing_value = -1.e+33f ; :START_DATE = "2017-10-01_00:00:00" ; :MAP_PROJ = 1 ; :LAT1 = 39.71886f ; :LON1 = -103.9488f ; :DX = 1000.f ; :DY = 1000.f ; :TRUELAT1 = 45.f ; :TRUELAT2 = 45.f ; :STAND_LON = 45.f ; :MMINLU = "MODIFIED_IGBP_MODIS_NOAH" ; :NCO = "4.7.2" ; :nco_openmp_thread_number = 1 ; :Conventions = "CF-1.5" ;