Reading-eScience-Centre / ncwms

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

DataReadingException: No grids found in underlying NetCDF dataset #43

Closed zq322cfd closed 5 years ago

zq322cfd commented 5 years ago

Hi,guygriffiths I use a ncWMS hosted in Tomcat. I am trying to load my netcdf files(which is created by FVCOM) into ncWMS. however, the following errors occurred.

Caused by: 
uk.ac.rdg.resc.edal.exceptions.DataReadingException: No grids found in underlying NetCDF dataset
uk.ac.rdg.resc.edal.util.cdm.CdmUtils.getGridDataset(CdmUtils.java:123)
uk.ac.rdg.resc.edal.dataset.cdm.CdmGridDatasetFactory.getNonStaggeredGriddedVariableMetadata(CdmGridDatasetFactory.java:143)
uk.ac.rdg.resc.edal.dataset.cdm.CdmGridDatasetFactory.generateGridDataset(CdmGridDatasetFactory.java:134)
uk.ac.rdg.resc.edal.dataset.cdm.CdmGridDatasetFactory.generateDataset(CdmGridDatasetFactory.java:124)
uk.ac.rdg.resc.edal.dataset.cdm.CdmDatasetFactory.createDataset(CdmDatasetFactory.java:88)
uk.ac.rdg.resc.edal.dataset.cdm.CdmDatasetFactory.createDataset(CdmDatasetFactory.java:1)
uk.ac.rdg.resc.edal.catalogue.jaxb.DatasetConfig.createDataset(DatasetConfig.java:254)
uk.ac.rdg.resc.edal.catalogue.jaxb.DatasetConfig.refresh(DatasetConfig.java:213)
uk.ac.rdg.resc.edal.catalogue.jaxb.CatalogueConfig$1.run(CatalogueConfig.java:154)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)

The structure of the nc files as follows:

Format:
           64bit
Global Attributes:
           title                      = 'dyw modelling'
           institution                = 'School for Marine Science and Technology'
           source                     = 'FVCOM_3.0'
           history                    = 'model started at: 23/10/2014   04:20'
           references                 = 'http://fvcom.smast.umassd.edu, http://codfish.smast.umassd.edu'
           Conventions                = 'CF-1.0'
           CoordinateSystem           = 'Cartesian'
           CoordinateProjection       = 'none'
           Tidal_Forcing              = 'Tidal Forcing Time Series Title: JULIAN FVCOM TIDAL FORCING DATA CREATED FROM OLD FILE TYPE: anything'
           River_Forcing              = 'THERE ARE NO RIVERS IN THIS MODEL'
           GroundWater_Forcing        = 'GROUND WATER FORCING IS OFF!'
           Surface_Heat_Forcing       = 'SURFACE HEAT FORCING IS OFF'
           Surface_Wind_Forcing       = 'SURFACE WIND FORCING IS OFF'
           Surface_PrecipEvap_Forcing = 'SURFACE PRECIPITATION FORCING IS OFF'
Dimensions:
           nele       = 90758
           node       = 46339
           siglay     = 14
           siglev     = 15
           three      = 3
           time       = 24    (UNLIMITED)
           DateStrLen = 26
           maxnode    = 12
           maxelem    = 10
           four       = 4
Variables:
    nprocs            
           Size:       1x1
           Dimensions: 
           Datatype:   int32
           Attributes:
                       long_name = 'number of processors'
    partition         
           Size:       90758x1
           Dimensions: nele
           Datatype:   int32
           Attributes:
                       long_name = 'partition'
    x                 
           Size:       46339x1
           Dimensions: node
           Datatype:   single
           Attributes:
                       long_name = 'nodal x-coordinate'
                       units     = 'meters'
    y                 
           Size:       46339x1
           Dimensions: node
           Datatype:   single
           Attributes:
                       long_name = 'nodal y-coordinate'
                       units     = 'meters'
    lon               
           Size:       46339x1
           Dimensions: node
           Datatype:   single
           Attributes:
                       long_name     = 'nodal longitude'
                       standard_name = 'longitude'
                       units         = 'degrees_east'
    lat               
           Size:       46339x1
           Dimensions: node
           Datatype:   single
           Attributes:
                       long_name     = 'nodal latitude'
                       standard_name = 'latitude'
                       units         = 'degrees_north'
    xc                
           Size:       90758x1
           Dimensions: nele
           Datatype:   single
           Attributes:
                       long_name = 'zonal x-coordinate'
                       units     = 'meters'
    yc                
           Size:       90758x1
           Dimensions: nele
           Datatype:   single
           Attributes:
                       long_name = 'zonal y-coordinate'
                       units     = 'meters'
    lonc              
           Size:       90758x1
           Dimensions: nele
           Datatype:   single
           Attributes:
                       long_name     = 'zonal longitude'
                       standard_name = 'longitude'
                       units         = 'degrees_east'
    latc              
           Size:       90758x1
           Dimensions: nele
           Datatype:   single
           Attributes:
                       long_name     = 'zonal latitude'
                       standard_name = 'latitude'
                       units         = 'degrees_north'
    siglay            
           Size:       46339x14
           Dimensions: node,siglay
           Datatype:   single
           Attributes:
                       long_name     = 'Sigma Layers'
                       standard_name = 'ocean_sigma/general_coordinate'
                       positive      = 'up'
                       valid_min     = -1
                       valid_max     = 0
                       formula_terms = 'sigma: siglay eta: zeta depth: h'
    siglev            
           Size:       46339x15
           Dimensions: node,siglev
           Datatype:   single
           Attributes:
                       long_name     = 'Sigma Levels'
                       standard_name = 'ocean_sigma/general_coordinate'
                       positive      = 'up'
                       valid_min     = -1
                       valid_max     = 0
                       formula_terms = 'sigma:siglay eta: zeta depth: h'
    h                 
           Size:       46339x1
           Dimensions: node
           Datatype:   single
           Attributes:
                       long_name     = 'Bathymetry'
                       standard_name = 'sea_floor_depth_below_geoid'
                       units         = 'm'
                       positive      = 'down'
                       grid          = 'Bathymetry_Mesh'
                       coordinates   = 'x y'
                       type          = 'data'
    nv                
           Size:       90758x3
           Dimensions: nele,three
           Datatype:   int32
           Attributes:
                       long_name = 'nodes surrounding element'
    iint              
           Size:       24x1
           Dimensions: time
           Datatype:   int32
           Attributes:
                       long_name = 'internal mode iteration number'
    time              
           Size:       24x1
           Dimensions: time
           Datatype:   single
           Attributes:
                       long_name = 'time'
                       units     = 'days since 1858-11-17 00:00:00'
                       format    = 'modified julian day (MJD)'
                       time_zone = 'UTC'
    Itime             
           Size:       24x1
           Dimensions: time
           Datatype:   int32
           Attributes:
                       units     = 'days since 1858-11-17 00:00:00'
                       format    = 'modified julian day (MJD)'
                       time_zone = 'UTC'
    Itime2            
           Size:       24x1
           Dimensions: time
           Datatype:   int32
           Attributes:
                       units     = 'msec since 00:00:00'
                       time_zone = 'UTC'
    Times             
           Size:       26x24
           Dimensions: DateStrLen,time
           Datatype:   char
           Attributes:
                       time_zone = 'UTC'
    zeta              
           Size:       46339x24
           Dimensions: node,time
           Datatype:   single
           Attributes:
                       long_name     = 'Water Surface Elevation'
                       units         = 'meters'
                       positive      = 'up'
                       standard_name = 'sea_surface_height_above_geoid'
                       grid          = 'Bathymetry_Mesh'
                       coordinates   = 'time lat lon'
                       type          = 'data'
                       location      = 'node'
    file_date         
           Size:       26x24
           Dimensions: DateStrLen,time
           Datatype:   char
           Attributes:
                       time_zone = 'UTC'
    nbe               
           Size:       90758x3
           Dimensions: nele,three
           Datatype:   int32
           Attributes:
                       long_name = 'elements surrounding each element'
    ntsn              
           Size:       46339x1
           Dimensions: node
           Datatype:   int32
           Attributes:
                       long_name = '#nodes surrounding each node'
    nbsn              
           Size:       46339x12
           Dimensions: node,maxnode
           Datatype:   int32
           Attributes:
                       long_name = 'nodes surrounding each node'
    ntve              
           Size:       46339x1
           Dimensions: node
           Datatype:   int32
           Attributes:
                       long_name = '#elems surrounding each node'
    nbve              
           Size:       46339x10
           Dimensions: node,maxelem
           Datatype:   int32
           Attributes:
                       long_name = 'elems surrounding each node'
    a1u               
           Size:       90758x4
           Dimensions: nele,four
           Datatype:   single
           Attributes:
                       long_name = 'a1u'
    a2u               
           Size:       90758x4
           Dimensions: nele,four
           Datatype:   single
           Attributes:
                       long_name = 'a2u'
    aw0               
           Size:       90758x3
           Dimensions: nele,three
           Datatype:   single
           Attributes:
                       long_name = 'aw0'
    awx               
           Size:       90758x3
           Dimensions: nele,three
           Datatype:   single
           Attributes:
                       long_name = 'awx'
    awy               
           Size:       90758x3
           Dimensions: nele,three
           Datatype:   single
           Attributes:
                       long_name = 'awy'
    art2              
           Size:       46339x1
           Dimensions: node
           Datatype:   single
           Attributes:
                       long_name = 'Area of elements around a node'
    art1              
           Size:       46339x1
           Dimensions: node
           Datatype:   single
           Attributes:
                       long_name = 'Area of Node-Base Control volume'
    ua                
           Size:       90758x24
           Dimensions: nele,time
           Datatype:   single
           Attributes:
                       long_name = 'Vertically Averaged x-velocity'
                       units     = 'meters s-1'
                       grid      = 'fvcom_grid'
                       type      = 'data'
    va                
           Size:       90758x24
           Dimensions: nele,time
           Datatype:   single
           Attributes:
                       long_name = 'Vertically Averaged y-velocity'
                       units     = 'meters s-1'
                       grid      = 'fvcom_grid'
                       type      = 'data'
    wet_nodes         
           Size:       46339x24
           Dimensions: node,time
           Datatype:   int32
           Attributes:
                       long_name   = 'Wet_Nodes'
                       grid        = 'fvcom_grid'
                       type        = 'data'
                       coordinates = 'time lat lon'
                       mesh        = 'fvcom_mesh'
                       location    = 'node'
    wet_cells         
           Size:       90758x24
           Dimensions: nele,time
           Datatype:   int32
           Attributes:
                       long_name   = 'Wet_Cells'
                       grid        = 'fvcom_grid'
                       type        = 'data'
                       coordinates = 'time latc lonc'
                       mesh        = 'fvcom_mesh'
                       location    = 'face'
    wet_nodes_prev_int
           Size:       46339x24
           Dimensions: node,time
           Datatype:   int32
           Attributes:
                       long_name   = 'Wet_Nodes_At_Previous_Internal_Step'
                       grid        = 'fvcom_grid'
                       type        = 'data'
                       coordinates = 'time lat lon'
                       mesh        = 'fvcom_mesh'
                       location    = 'node'
    wet_cells_prev_int
           Size:       90758x24
           Dimensions: nele,time
           Datatype:   int32
           Attributes:
                       long_name   = 'Wet_Cells_At_Previous_Internal_Step'
                       grid        = 'fvcom_grid'
                       type        = 'data'
                       coordinates = 'time latc lonc'
                       mesh        = 'fvcom_mesh'
                       location    = 'face'
    wet_cells_prev_ext
           Size:       90758x24
           Dimensions: nele,time
           Datatype:   int32
           Attributes:
                       long_name = 'Wet_Cells_At_Previous_External_Step'
                       grid      = 'fvcom_grid'
                       type      = 'data'

Look forward to your reply. thanks

guygriffiths commented 5 years ago

That error means that you don't have any CF-compliant grids available in your data file.

The most obvious issue is that you have only defined one coordinate variable (time): https://www.unidata.ucar.edu/software/netcdf/workshops/2011/datamodels/NcCVars.html

but it looks like this may be an unstructured grid, in which case you will need to follow the UGRID conventions in addition to the CF conventions:

https://github.com/ugrid-conventions/ugrid-conventions

zq322cfd commented 5 years ago

Many thanks for your comments. But I am still not very clear how to adjust my nc files. I would greatly appreciate if you changed the format of the nc files for me . See the differences between the revised files and the original ones could give me more information to understand . Could you please give me your email address for sending my nc files to you. Thanks again.

guygriffiths commented 5 years ago

Sorry, I'm incredibly busy right now. I may get some free time to work on ncWMS in July, but I cannot guarantee it.