, radar, uf_field_names=None, radar_field_names=False, exclude_fields=None, field_write_order=None, volume_start=None, templates_extra=None)[source]#

Write a Radar object to a UF file.

Create a UF file containing data from the provided radar instance. The UF file will contain instrument parameters from the following dictionaries if they contained in radar.instrument_parameters:

  • radar_beam_width_h

  • radar_beam_width_v

  • radar_receiver_bandwidth

  • frequency

  • pulse_width

  • prt

  • polarization_mode

  • nyquist_velocity

If any of these parameter are not present a default or sentinel value will be written in the UF file in the place of the parameter. This is also true for the data in the scan_rate attribute.

Radar fields will be scaled and rounded to integer values when writing to UF files. The scale factor for each field can be specified in the _UF_scale_factor key for each field dictionary. If not specified the default scaling (100) will be used.

  • filename (str or file-like object.) – Filename of UF file to create. If a file-like object is specified data will be written using the write method.

  • radar (Radar) – Radar object from which to create UF file.

  • uf_field_names (dict or None, optional) – Mapping between radar fields and two character UF data type names. Field names mapped to None or with no mapping will be excluded from writing. If None, the default mappings for UF files will be used.

  • radar_field_names (bool, optional) – True to use the radar field names as the field names of the UF fields. False to use the uf_field_names mapping to generate UF field names. The exclude_fields argument can still be used to exclude fields from the UF file when this parameter is True. When reading a UF file using file_field_names=True set this parameter to True to write a UF file with the same field names.

  • exclude_fields (list or None, optional) – List of radar fields to exclude from writing.

  • field_write_order (list or None, optional) – Order in which radar fields should be written out in the UF file. None, the default, will determine a valid order automatically.

  • volume_start (datetime, optional) – Start of volume used to set UF volume structure elements.

  • templates_extra (dict of dict or None) – Advanced usage parameter for setting UF structure templates. Elements defined in dictionaries with keys ‘mandatory_header’, ‘optional_header’, and ‘field_header’ will be used to build the structure template.