pyart.aux_io.write_odim_grid_h5#

pyart.aux_io.write_odim_grid_h5(filename, grid, field_names=None, physical=True, compression='gzip', compression_opts=6, time_ref='start', undefined_value=None, odim_convention='ODIM_H5/V2_2')[source]#

Write a Grid object to a EUMETNET OPERA compliant HDF5 file.

The files produced by this routine follow the EUMETNET OPERA information model: https://www.eumetnet.eu/wp-content/uploads/2021/07/ODIM_H5_v2.4.pdf

Parameters:
  • filename (str) – Filename of file to create.

  • grid (Grid) – Grid object to process.

  • field_names (list of str) – The list of fields from the radar object to save. If none all fields in the radar object will be saved.

  • physical (Bool) – If true the physical values are stored. nodata parameter is equal to the _FillValue parameter in the field metadata or the default Py-ART fill value. If false the data is converted into binary values using a linear conversion. The gain and offset are either specified in the metadata of the field with keywords ‘scale_factor’ and ‘add_offset’ or calculated on the fly. keyword ‘_Write_as_dtype’ specifies the datatype. It can be either ‘uint8’ or ‘uint16’. The default datatype is uint8. The ‘undetect’ parameter is not used

  • compression (str) – The type of compression for the datasets. Typical are “gzip” and “lzf”.

  • compression_opts (any) – The compression options. In the case of gzip is the level between 0 to 9 (recomended 1 to 6). In the case of lzf there are not options.

  • time_ref (str) – Time reference in the /what/time attribute. Can be either ‘start’, ‘mid’ or ‘end’. If ‘start’ the attribute is expected to be the starttime of the scan, if ‘mid’, the middle time, if ‘end’ the endtime.

  • undefined_value (float) – If an attribute is not defined in the data it will be replaced by this value (for example undetect, gain, offset…) If it is set to None, the attribute will NOT be written in the ODIM file

  • odim_convention (str) – Which ODIM convention is used, default is ODIM_H5/V2_2, but MeteoSwiss uses ODIM_H5/V2_3