pysteps.io.exporters.initialize_forecast_exporter_netcdf

pysteps.io.exporters.initialize_forecast_exporter_netcdf#

pysteps.io.exporters.initialize_forecast_exporter_netcdf(outpath, outfnprefix, startdate, timestep, n_timesteps, shape, metadata, n_ens_members=1, datatype=<class 'numpy.float32'>, incremental=None, fill_value=None, scale_factor=None, offset=None, **kwargs)#

Initialize a netCDF forecast exporter. All outputs are written to a single file named as ‘<outfnprefix>_.nc’.

Parameters:
  • outpath (str) – Output path.

  • outfnprefix (str) – Prefix for output file names.

  • startdate (datetime.datetime) – Start date of the forecast.

  • timestep (int) – Time step of the forecast (minutes).

  • n_timesteps (int) – Number of time steps in the forecast this argument is ignored if incremental is set to ‘timestep’.

  • shape (tuple of int) – Two-element tuple defining the shape (height,width) of the forecast grids.

  • metadata (dict) – Metadata dictionary containing the projection, x1, x2, y1, y2, unit attributes (projection and variable units) described in the documentation of pysteps.io.importers.

  • n_ens_members (int) – Number of ensemble members in the forecast. This argument is ignored if incremental is set to ‘member’.

  • datatype (np.dtype, optional) – The datatype of the output values. Defaults to np.float32.

  • incremental ({None,'timestep','member'}, optional) –

    Allow incremental writing of datasets into the netCDF files.

    The available options are: ‘timestep’ = write a forecast or a forecast ensemble for a given time step; ‘member’ = write a forecast sequence for a given ensemble member. If set to None, incremental writing is disabled.

  • fill_value (int, optional) – Fill_value for missing data. Defaults to None, which means that the standard netCDF4 fill_value is used.

  • scale_factor (float, optional) – The scale factor to scale the data as: store_value = scale_factor * precipitation_value + offset. Defaults to None. The scale_factor can be used to reduce data storage.

  • offset (float, optional) – The offset to offset the data as: store_value = scale_factor * precipitation_value + offset. Defaults to None.

  • institution (str) – The instute, company or community that has created the nowcast. Default: the pySTEPS community (https://pysteps.github.io)

  • references (str) – Any references to be included in the netCDF file. Defaults to “ “.

  • comment (str) – Any comments about the data or storage protocol that should be included in the netCDF file. Defaults to “ “.

Returns:

exporter – The return value is a dictionary containing an exporter object. This c an be used with pysteps.io.exporters.export_forecast_dataset() to write datasets into the given file format.

Return type:

dict