pysteps.io.exporters.initialize_forecast_exporter_netcdf

pysteps.io.exporters.initialize_forecast_exporter_netcdf(filename, startdate, timestep, n_timesteps, shape, n_ens_members, metadata, incremental=None)

Initialize a netCDF forecast exporter.

Parameters:
filename : str

Name of the output file.

startdate : datetime.datetime

Start date of the forecast as datetime object.

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.

n_ens_members : int

Number of ensemble members in the forecast. This argument is ignored if incremental is set to ‘member’.

metadata: dict

Metadata dictionary containing the projection,x1,x2,y1,y2 and unit attributes described in the documentation of pysteps.io.importers.

incremental : {None,’timestep’,’member’}, optional

Allow incremental writing of datasets into the netCDF file.

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.

Returns:
exporter : dict

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.