Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The netCDF kickstarter is a very useful tool for creating template netCDF files and is available on http://zandmotor.citg.tudelft.nl/netcdfkickstarter/ This tool can be used to create template netCDF files or to create scripts that generate template netCDF files. In this tool the user can specify what data variables the netCDF file should contain and the netCDF kickstarter will create a template netCDF file that contains the corresponding metadata variables and empty data variables, fully compliant according to the CF conventions. Then the user only needs to add the actual data values to this template file in order to create a CF compliant netCDF file. The kickstarter can also generate a script (in one of several programming languages) to create a template netCDF file that contains the metadata variables and empty data variables specified by the user. Then the user only needs to extend the this script with commands to write the actual data values to the netCDF file.

...

Netcf data variables with attributes scale_factor and add_offset will be treated as compacted data and the values of these attributes will be used to uncompact the values of this variable.

How to import a netCDF file into Delft-FEWS

To import data from a netCDF file into Delft-FEWS you must first create the relevant configuration.

Import configuration

To import data from a netCDF file into Delft-FEWS, either create an import run (see 03 Import Module) or a netcdfImportActivity in a general adapter (see 05 General Adapter Module#05GeneralAdapterModule-importNetcdfActivity).

To import scalar time series you also need to configure the corresponding internal locations (see 01 Locations) and an id mapping (see 01 ID Mapping).

To import grid time series you also need to configure the grid definition in Delft-FEWS, see the next section.

Creating the correct grid definition

For irregular or unstructured grids the cell center (and cell boundaries) must be defined for each grid cell. See 06 Grids#06Grids-Irregulargrids for ways to do this.

For a grid that is regular in a certain coordinate system, follow these steps (also see 06 Grids#06Grids-Regulargrids):

  1. In the grids.xml config file create an empty regular grid definition.
  2. Open the netCDF file in your favorite viewer and find the details of the coordinate system in which the grid is a regular grid. This coordinate system is usually described in a grid mapping variable, which has an attribute called "grid_mapping_name". In your grid definition choose the geoDatum or grid projection that corresponds to this coordinate system.
  3. In the netCDF file find the variables that contain the coordinates of the grid cells in the system in which the grid is regular. These are usually the variables with standard names projection_x_coordinate and projection_y_coordinate or grid_longitude and grid_latitude. According to the CF conventions these coordinates are cell centers. Find the lowest x coordinate and use that as firstCellCenter x in your grid definition. Find the highest y coordinate and use that as firstCellCenter y in your grid definition.
  4. In the netCDF file look at the spacings between the x and y coordinates. If these spacings are constant, then use them as xCellSize and yCellSize in your grid definition.
  5. In the netCDF file find the sizes of the dimensions of the coordinate variables. Use these as the number of rows and columns in your grid definition.

Error messages from the Delft-FEWS NetCDF import

...