update_metadata

s100py.s111.utils.update_metadata(data_file, grid_properties, update_meta)

Updates an S111File object based on dynamic metadata.

Parameters
  • speed – 1d or 2d array containing surface current speeds.

  • direction – 1d or 2d array containing surface current directions.

  • data_file – S111File object

  • grid_properties (dict) –

    a dictionary of metadata describing the grids passed in, metadata can have the following key/value pairs:

    • ”maxx”: West bound longitude

    • ”minx”: East bound longitude

    • ”miny”: South bound latitude

    • ”maxy”: North bound latitude

    • ”cellsize_x”: Only for DCF2, grid spacing longitude

    • ”cellsize_y”: Only for DCF2, grid spacing latitude

    • ”nx”: Only for DCF2, number of points longitudinal

    • ”ny”: Only for DCF2, number of points latitudinal

    • ”latitude”: Only for DCF3, latitude of nodes

    • ”longitude”: Only for DCF3, longitudes of nodes

    • ”nodes”: Only for DCF3, number of nodes

  • update_meta (dict) –

    a dictionary of dynamic metadata, metadata can have the following key/value pairs:
    • ”dateTimeOfLastRecord”: West bound longitude

    • ”numberOfGroups”: East bound longitude

    • ”numberOfTimes”: South bound latitude

    • ”timeRecordInterval”: North bound latitude

    • ”num_instances”: Only for DCF2, grid spacing longitude

Returns

An S111File object updated by this function.

Return type

data_file