Template plugin for fluxes (flux / template)

Description

This is a template to write a flux plugin. It includes all required functions to run properly.

It generates random values and can be directly used with a working test case.

Warning

Please gradually document your plugin properly when starting from the template. It includes input_arguments (see here for details), as well as all information about the original data the plugin is supposed to accommodate.

Please include licensing information, permanent link to download the data (or a contact person if no link is publicly available), as well as data format (temporal and horizontal resolution, names and shape of the data files), and any specific treatment that prevents the plugin from working with another type of files.

Summary steps to integrate a new flux data plugin

First steps to integrate your own flux plugin from the template

To integrate your own flux plugin, please follow the steps:

  1. copy the flux_plugin_template directory into one with a name of your preference

  2. Start writing the documentation of your plugin by replacing the present docstring in the file __init__.py. Use rst syntax since this doctring will be automatically parsed for publication in the documentation

  3. Change the variables _name, _version (default is std) if not specified, and _fullname (optional, is used as a title when automatically generating the documentation here)

Now your new plugin is ready to be used in your test case with random data.

Further integration of your own plugin

Now that your plugin can be used in a yml and generate random values, you need to integrate the main functions feeding the plugin.

  • fetch: fetch data files

  • read: read data files

  • write: write data files

Please find further details here.

Yaml arguments

The following arguments are used to configure the plugin. pyCIF will return an exception at the initialization if mandatory arguments are not specified, or if any argument does not fit accepted values or type:

Optional arguments

dummy_arg: (optional): let’s say it’s not mandatory

document here the argument

accepted type: <class ‘str’>

file_freq: (optional): 1D

The time frequency at which data files are available.

accepted type: <class ‘str’>

lon_min: (optional): -180

Minimum longitude

accepted type: <class ‘float’>

lon_max: (optional): 180

Maximum longitude

accepted type: <class ‘float’>

lat_min: (optional): -90

Minimum latitude

accepted type: <class ‘float’>

lat_max: (optional): 90

Maximum latgitude

accepted type: <class ‘float’>

nlon: (optional): 90

Number of grid cells in the zonal direction

accepted type: <class ‘int’>

nlat: (optional): 45

Number of grid cells in the meridional direction

accepted type: <class ‘int’>

nlev: (optional): 1

Number of levels in the data

accepted type: <class ‘int’>

average_value: (optional): 1

Average value for the generation of random values

accepted type: <class ‘float’>

Yaml template

Please find below a template for a Yaml configuration:

 1datastream:
 2  plugin:
 3    name: flux
 4    version: template
 5    type: datastream
 6
 7
 8  # Optional arguments
 9  dummy_arg: XXXXX
10  file_freq: XXXXX
11  lon_min: XXXXX
12  lon_max: XXXXX
13  lat_min: XXXXX
14  lat_max: XXXXX
15  nlon: XXXXX
16  nlat: XXXXX
17  nlev: XXXXX
18  average_value: XXXXX