update_metadata

s100py.s104.v1_1.utils.update_metadata(data_file, grid_properties, update_meta)

Updates an S104File object based on dynamic metadata.

Parameters:
  • data_file – S104File object

  • grid_properties (dict) –

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

    • ”minx”: West bound longitude

    • ”maxx”: 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”: Valid ISO 8601 time of latest value

    • ”numberOfGroups”: Number of forecasts

    • ”numberOfTimes”: Number of valid times

    • ”timeRecordInterval”: Time between forecasts in seconds

    • ”num_instances”: Number of water level feature instances

Returns:

An S104File object updated by this function.

Return type:

data_file