example_unstructured_grid_config.zip
scrollbar |
---|
Wiki Markup |
What | Required | Description | schema location |
---|---|---|---|
Grids.xml | no | Grid definitions, either regular or irregular |
DELFT-FEWS is a location oriented system. All time series data must be referenced to a (geographic) location. Scalar time series need no additional information. For grid time series data, each point in the grid must be referenced to a location in a grid structure.
...
In irregular grids the grid has a fixed number of rows and columns, but the cell height and width is not equal in each row and column. For these grids additional information is required on the location of each individual cell in the grid to allow display in the grids display as well as for use in the spatial interpolation routine.
When available on the file system, the name of the XML file is for example:
Grids 1.00 default.xml
Grids Fixed file name for the Grids configuration
1.00 Version number
default Flag to indicate the version is the default configuration (otherwise omitted).
Figure 28 Elements of the grids configuration
regular
Definition of a regular grid. One or more regular grids may be defined.
Attributes;
- locationId; location Id of the grid. This locationId must be included in the locations definition.
irregular
Definition of a irregular grid. One or more irregular grids may be defined.
Attributes;
- locationId; location Id of the grid. This locationId must be included in the locations definition.
Regular grids
Figure 29 Elements of the Regular Grid in the Grids configuration
description
Optional description of the grid. Used only for reference purposes
rows, columns
Number of rows and columns in the grid
geoDatum
Coordinate system the grid is defined in. This may be a different coordinate system to that used in the main map display. The coordinate system may also differ per grid, as a grid may be regular in one coordinate system, but may be irregular in another. Defining the grid in the regular coordinate system is easier.
firstCellCenter
Coordinates of the center of the first grid cell. The convention in DELFT-FEWS is that this is the center point of the top left cell in the grid (Upper-Left).
firstCellCenter: x
Geographic coordinate of the first cell center point (Easting)
firstCellCenter: y
Geographic coordinate of the first cell center point (Northing)
firstCellCenter: z
Optional elevation of the first cell center point (Easting). If only this elevation is defined , then all cells in the grid are assumed to have the same elevation.
xCellSize / columnWidth
Cell width of each column in the grid. The cell width is given in the unit of the coordinate system referred to in the geoDatum. Generally this is metres, but in WGS 1984 this is decimal degrees.
The xCellSize-element is used when all cells are equal in width. Please use the columnWidth-element to define cells with variable columnWidth.
yCellSize / rowHeigt
Cell height of each row in the grid. The cell height is given in the unit of the coordinate system referred to in the geoDatum. Generally this is metres, but in WGS 1984 this is decimal degrees.
The yCellSize-element is used when all cells are equal in height. Please use the rowHeight-element to define cells with variable height.
z / zBottom / zTop
Optional definition of the elevation of each point in the grid. This definition is only necessary where a datum is required in for example 3-dimensional interpolation. This may be applied in for example interpolating temperature grids in high mountain areas. Alternative uses are the display of elevation in a cross section of the Spatial Display. The bottom/top layer is only displayed if the parameter unit is meters and if the corresponding displayOptions are configured in the TimeSeriesDisplayConfig file and if the layer contains non-NaN values. The useDatum property is not used here.
Use 'z' for the average elevation, and zBottom and zTop in case a model layer needs to be defined
zMapLayerName / zBottomMapLayerName / zTopMapLayerName
For regular grids it is sometimes not required to add the location to the grids.xml when you only want to import/export the grid. Most grid transformations will not work when the output location is missing in the grids.xml. Regular grids that need a custom projection (projectionFile, polarStereoGraphic, geostationarySatelliteView, transverseMercator, mercator, albersEqualArea, azimuthalEquidistant, lambertAzimuthalEqualArea, rotatedCartesian, lambertConformalConic, rotatedSouthPole, rotatedNorthPole, rotatedCartesian, azimuthalEquidistant) should ALWAYS be listed in the grids.xml. The grid geometry should be available in the imported file (netcdf/grib).
When available on the file system, the name of the XML file is for example:
Grids 1.00 default.xml
Grids Fixed file name for the Grids configuration
1.00 Version number
default Flag to indicate the version is the default configuration (otherwise omitted).
Figure 28 Elements of the grids configuration
Table of Contents |
---|
regular
Definition of a regular grid. One or more regular grids may be defined.
Attributes;
- locationId; location Id of the grid. This locationId must be included in the locations definition.
irregular
Definition of a irregular grid. One or more irregular grids may be defined.
Attributes;
- locationId; location Id of the grid. This locationId must be included in the locations definition.
Regular grids
Figure 29 Elements of the Regular Grid in the Grids configuration
description
Optional description of the grid. Used only for reference purposes
rows, columns
Number of rows and columns in the grid
geoDatum
Coordinate system the grid is defined in. This may be a different coordinate system to that used in the main map display. The coordinate system may also differ per grid, as a grid may be regular in one coordinate system, but may be irregular in another. Defining the grid in the regular coordinate system is easier.
firstCellCenter
Coordinates of the center of the first grid cell. The convention in DELFT-FEWS is that this is the center point of the top left cell in the grid (Upper-Left).
firstCellCenter: x
Geographic coordinate of the first cell center point (Easting)
firstCellCenter: y
Geographic coordinate of the first cell center point (Northing)
firstCellCenter: z
Optional elevation of the first cell center point (Easting). If only this elevation is defined , then all cells in the grid are assumed to have the same elevation.
xCellSize / columnWidth
Cell width of each column in the grid. The cell width is given in the unit of the coordinate system referred to in the geoDatum. Generally this is metres, but in WGS 1984 this is decimal degrees.
The xCellSize-element is used when all cells are equal in width. Please use the columnWidth-element to define cells with variable columnWidth.
yCellSize / rowHeigt
Cell height of each row in the grid. The cell height is given in the unit of the coordinate system referred to in the geoDatum. Generally this is metres, but in WGS 1984 this is decimal degrees.
The yCellSize-element is used when all cells are equal in height. Please use the rowHeight-element to define cells with variable height.
z / zBottom / zTop
Optional definition of the elevation of each point in the gridOptional definition of the elevation by reference to an ASC or BIL file stored in the MapLayerFiles-directory. This definition is only necessary where a datum is required in for example 3-dimensional interpolation. This may be applied in for example interpolating temperature grids in high mountain areas. Alternative uses are the display of elevation in a cross section of the Spatial Display. The bottom/top layer is only displayed if the parameter unit is meters and if the corresponding displayOptions are configured in the TimeSeriesDisplayConfig file and if the layer contains non-NaN values. The useDatum property is not used here.
Use 'zMapLayerNAmez' for the average elevation, and zBottomMapLayerName zBottom and zTopMapLayerName zTop in case a model layer needs to be defined.
Irregular grids
Figure 30 Elements of the irregular grid in the Grids configuration
description
Optional description of the grid. Used only for reference purposes
rows, columns
Optional, when specified the grid cell boundaries can be based on the neighbour cells. Number of rows and columns in grid, at least two rows and two columns. Don't configure this for scattered point grids.
geoDatum
Coordinate system the grid is defined in. This may be a different coordinate system to that used in the main map display. The coordinate system may also differ per grid. A grid may be regular in one coordinate system, but may be irregular in another. Defining the grid in the regular coordinate system is generally easier.
cellCentre
Definition of the cell centre points of all cells in the irregular grid. The number of cellCentre points defined must be the same as the number of cells in the grid (rows x columns).
cellCentre: x, cellCentre: y
zMapLayerName / zBottomMapLayerName / zTopMapLayerName
Optional definition of the elevation by reference to an ASC or BIL file stored in the MapLayerFiles-directory. This definition is only necessary where a datum is required in for example 3-dimensional interpolation. This may be applied in for example interpolating temperature grids in high mountain areas. Alternative uses are the display of elevation in a cross section of the Spatial Display. The bottom/top layer is only displayed if the parameter unit is meters and if the corresponding displayOptions are configured in the TimeSeriesDisplayConfig file and if the layer contains non-NaN values. The useDatum property is not used here.
Use 'zMapLayerNAme' for the average elevation, and zBottomMapLayerName and zTopMapLayerName in case a model layer needs to be defined.
Irregular grids
Figure 30 Elements of the irregular grid in the Grids configuration
description
Optional description of the grid. Used only for reference purposes
rows, columns
Optional, when specified the grid cell boundaries can be based on the neighbor cells. Number of rows and columns in grid, at least two rows and two columns. Don't configure this for scattered point grids.
geoDatum
Coordinate system the grid is defined in. This may be a different coordinate system to that used in the main map display. The coordinate system may also differ per grid. A grid may be regular in one coordinate system, but may be irregular in another. Defining the grid in the regular coordinate system is generally easier.
You can also use the EPGS codes
cellCentre
Definition of the cell centre points of all cells in the irregular grid. The number of cellCentre points defined must be the same as the number of cells in the grid (rows x columns).
cellCentre: x, cellCentre: y
Geographic coordinates of the cell centre point (x: EastingGeographic coordinates of the cell centre point (x: Easting, y: Northing).
cellCentre: z
...
Since 2013.01. Csv file with cell centers.
netcdfFile
Csv file should contain an "x" and "y" column. The cell centers should be listed from the upper left to the lower right, row by row. For regular grids always try to use a regular grid with a (custom) geodatum. For config example see: 06Grids-ConfigExamples
netcdfFile
Since 2015.02. Reference to a UGRID NetCDF file that contains only grid geometry meta data. This only supports mesh topologies (unstructured grids) with Since 2015.02. Reference to a NetCDF file that contains only grid geometry meta data. This only supports mesh topologies (unstructured grids) with 2D coordinates. This can be 1D network, 2D triangular, 2D flexible or 3D layered mesh topologies. This currently only works for files that are compliant to the UGRID 1.0 conventions. For more information see httpshttp://ugrid-conventions.github.comio/ugrid-conventions/ugrid-conventions
Irregular grid definition from a UGRID NetCDF file
file
Name of a UGRID NetCDF file in the map layer files folder or a full absolute path to a UGRID NetCDF file. The file must have extension ".nc".
...
Name of a mesh topology variable in the UGRID NetCDF file that contains the meta-data attributes of the mesh on which the data is defined.
...
To import/export unstructured grid/flexible mesh data in Delft-FEWS, use a timeSeriesImport/ExportRun with type "NETCDF-CF_GRID" or use a generalAdapter import/exportNetcdfActivity. For this to work you need to add an irregular grid definition to the grids.xml configuration file. The easiest way to do this, is by using the option "netcdfFile" (see above) that refers to a NetCDF file that contains a UGRID mesh topology (and no data).
It is possible to use a D-Flow flexible mesh (D-Flow FM) flowgeom UGRID NetCDF file, produced by a D-Flow FM model run, as grid definition in Delft-FEWS. If your D-Flow FM model run does not produce a flowgeom file, then add the following line in the D-Flow FM .mdu file in the output section, e.g.:
Code Block |
---|
[output]
...
FlowGeomFile = f34_flowgeom.nc # *_flowgeom.nc Flow geometry file in NetCDF format.
... |
If the produced flowgeom file is not in UGRID NetCDF format, then you can change the format to UGRID NetCDF by changing the MapFormat to 4 in the D-Flow FM .mdu file in the output section:
Code Block |
---|
[output]
...
MapFormat = 4 # Map file format, 1: netCDF, 2: Tecplot, 3: netCFD and Tecplot, 4: NetCDF-UGRID
... |
The flowgeom file format matches the map file format.
Config Examples
In an unstructured grid the data can be defined either on the nodes, the edges or the faces of the mesh (staggerLocations). Also see http://ugrid-conventions.github.io/ugrid-conventions/#data-defined-on-unstructured-meshes.
An example configuration can be downloaded here: example_unstructured_grid_config.zip. The example shows what is minimally needed to be present in the UGRID NetCDF file and how one can configure it in FEWS.
Each grid definition in grids.xml is valid for only one staggerLocation and this should match the staggerLocation of the data that you are going to import using the grid definition. The staggerLocation on which the data is defined can be deduced from the data variable in a netcdf file that contains the data to import. The data variable (e.g. "water_level") has an attribute called "location" and a dimension (e.g. nmesh2d_face) that both indicate its staggerLocation. In the grid geometry choose the corresponding staggerLocation. If you want to import different data variables that are defined on different staggerLocations in the same mesh, then you will have to create separate grid definitions for different staggerLocations using the same mesh from the same netcdf file, e.g.:
Code Block | ||
---|---|---|
| ||
<irregular locationId="SFBayFM_data_on_faces">
<netcdfFile>
<file>sfbay_flowgeom.nc</file>
<geoDatum>UTM10N</geoDatum>
<meshTopologyVariableName>mesh2d</meshTopologyVariableName>
<staggerLocation>face</staggerLocation>
</netcdfFile>
</irregular>
<irregular locationId="SFBayFM_data_on_nodes">
<netcdfFile>
<file>sfbay_flowgeom.nc</file>
<geoDatum>UTM10N</geoDatum>
<meshTopologyVariableName>mesh2d</meshTopologyVariableName>
<staggerLocation>node</staggerLocation>
</netcdfFile>
</irregular> |
D-Flow FM (Dutch: D-HYDRO)
It is possible to use a D-Flow flexible mesh (D-Flow FM) flowgeom UGRID NetCDF file, produced by a D-Flow FM model run, as grid definition in Delft-FEWS. If your D-Flow FM model run does not produce a flowgeom file, then add the following line in the D-Flow FM .mdu file in the output section, e.g.:
Code Block |
---|
[output]
...
FlowGeomFile = f34_flowgeom.nc # *_flowgeom.nc Flow geometry file in NetCDF format.
... |
The produced flowgeom file must be in UGRID 1.0 NetCDF format. Therefore you must use MapFormat = 4 in the D-Flow FM .mdu file in the output section:
Code Block |
---|
[output]
...
MapFormat = 4 # Map file format, 1: netCDF, 2: Tecplot, 3: netCFD and Tecplot, 4: NetCDF-UGRID
... |
The flowgeom file format will match the configured map file format. If MapFormat is set to 4, then D-Flow FM will produce a valid UGRID file. With MapFormat set to 1 it will produce a format that looks very much like UGRID, but is not the same. Delft-FEWS can only use valid UGRID files. Using MapFormat 1 files with Delft-FEWS may cause problems.
If you have set MapFormat = 4, but the flowgeom file produced by D-Flow FM still causes errors in Delft-FEWS, then you may need to update to a newer version of DFlow-FM (1.2.2 or later). Note that in that case, you can manually create a valid flowgeom from the map file by removing all variables that depend on time from the netcdf file. This can be done using the third party command line tool nccopy, using a command like this (with uppercase -V):
nccopy -V mesh2d,wgs84,mesh2d_node_x,mesh2d_node_y,mesh2d_node_z,mesh2d_edge_nodes,mesh2d_edge_x,mesh2d_edge_y,mesh2d_edge_x_bnd,mesh2d_edge_y_bnd,mesh2d_face_nodes,mesh2d_face_x,mesh2d_face_y,mesh2d_face_x_bnd,mesh2d_face_y_bnd,mesh2d_FlowElem_ba,mesh2d_FlowElem_bl,mesh2d_edge_type map.nc flowgeom.nc
The tool nccopy is part of the NetCDF library binary distribution.
Config Examples
Code Block | ||||
---|---|---|---|---|
| ||||
<irregular locationId="meshLocation">
<netcdfFile>
<file>simplebox_hex7_map.nc</file>
<meshTopologyVariableName>insert_mesh_variable_name_here</meshTopologyVariableName>
<staggerLocation>face</staggerLocation>
</netcdfFile>
</irregular> |
Code Block | ||||
---|---|---|---|---|
| ||||
<irregular locationId="Swan2D_G2_cellcenters">
<rows>1318</rows>
<columns>317</columns>
<esriShapeFile>
<file>swan2D_G2_cellcenters.shp</file>
<geoDatum>WGS 1984</geoDatum>
<x>%X%</x>
<y>%Y%</y>
</esriShapeFile>
</irregular>
| ||||
Code Block | ||||
| ||||
<irregular locationId="meshLocation">
<netcdfFile>
<file>simplebox_hex7_map.nc</file>
<meshTopologyVariableName>mesh2d</meshTopologyVariableName>
<staggerLocation>face</staggerLocation>
</netcdfFile>
</irregular> |
Code Block | ||||
---|---|---|---|---|
| ||||
<irregular locationId="Swan2D_G2_cellcenters"> <rows>1318</rows> <columns>317</columns> <esriShapeFile> <file>swan2D_G2_cellcenters.shp</file> <geoDatum>WGS 1984<<projectionFileAvailable>true</geoDatum>projectionFileAvailable> <x>%X%</x> <y>%Y%</y> </esriShapeFile> </irregular> |
Code Block | ||||
---|---|---|---|---|
| ||||
<irregular locationId="Swan2DGrid_G2Waqua_cellcentersZeedelta"> <rows>1318< <rows>1539</rows> <columns>317< <columns>501</columns> <esriShapeFile> <file>swan2D_G2_cellcenters.shp</file> <projectionFileAvailable>true</projectionFileAvailable> <x>%X%</x> <y>%Y%</y> </esriShapeFile> </irregular> <csvFile> <file>Grid_Waqua_Zeedelta.csv</file> <geoDatum>Rijks Driehoekstelsel</geoDatum> <x>%X%</x> <y>%Y%</y> </csvFile> </irregular> |
Code Block | ||||
---|---|---|---|---|
| ||||
<regular locationId="KNMI-HIRLAM-V70"> <description>grid def. for KNMI-HIRLAM v7.0 with rotated pole</description> <rows>226</rows> <columns>136</columns> <rotatedSouthPole> <latitude>-30</latitude> <longitude>-15</longitude> </rotatedSouthPole> <gridCorners> <geoDatum>WGS 1984</geoDatum> <upperLeft> <x>-30.8688</x> <y>79.63847</y> </upperLeft> <lowerRight> <x>10.29617</x> <y>26.065</y> </lowerRight> </gridCorners> </regular> |
...
Code Block | ||||
---|---|---|---|---|
| ||||
<regular locationId="QPF"> <description>QPF Grid for ABRFC</description> <rows>159</rows> <columns>335</columns> <polarStereographic> <originLatitude>90.0</originLatitude> <originLongitude>-105.0</originLongitude> <scaleAtOrigin>0.933</scaleAtOrigin> <equatorRadius>6367470.0</equatorRadius> <poleRadius>6367470.0</poleRadius> </polarStereographic> <gridCorners> <geoDatum>WGS 1984</geoDatum> <upperLeft> <x>-106.67471389477944</x> <y>39.37455858318055</y> <z>0.0</z> </upperLeft> <lowerRight> <x>-92.34455929643786</x> <y>32.390342856654044</y> <z>0.0</z> </lowerRight> </gridCorners> </regular> |
Generating XML
...
For NetCDF and GRIB files you can generate the grids.xml with F12>Clipboard>Copy grib geometry form file