add_metadata

s100py.s111.v1_2.utils.add_metadata(metadata, data_file)

Updates an S111File object based on input metadata.

Parameters:
  • data_file – S111File object

  • metadata (dict) –

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

    • ”productSpecification”: The product specification used to create this dataset.

    • ”horizontalCRS”: Horizontal EPSG code or -1.

    • ”metadata”: File name for the associated discovery metadata (xml)

    • ”geographicIdentifier”: Location of the data, ex: “Chesapeake Bay”.

      An empty string (“”) is the default.

    • ”speedUncertainty”: In (knots) arises from the current meter data on which the model is verified,

      the hydrodynamic model, and the spatial interpolation method. The default, denoting a missing value, is -1.0.

    • ”directionUncertainty”: In (degrees) arises from the current meter data on which the model is verified,

      the hydrodynamic model, and the spatial interpolation method. The default, denoting a missing value, is -1.0.

    • ”verticalUncertainty”: Accuracy of vertical datum

      The default, denoting a missing value, is -1.0.

    • ”horizontalPositionUncertainty”: Accuracy of geolocation techniques, model grid accuracy

      The default, denoting a missing value, is -1.0.

    • ”timeUncertainty”: Sensor accuracy, ata time tagging accuracy

      The default, denoting a missing value, is -1.0.

    • ”surfaceCurrentDepth”: Depth or height (depthTypeIndex=1) or layer thickness (depthTypeIndex=2) (m)

    • ”depthTypeIndex”:
      • ’heightOrDepth’: 1

      • ’layerAverage’: 2

    • ”commonPointRule”:
      • ’average’: 1

      • ’low’: 2

      • ’high’: 3

      • ’all’: 4

    • ”interpolationType”:
      Interpolation method recommended for evaluation of the S100_GridCoverage.
      • ’nearestneighbor’: 1

      • ’linear’: 2

      • ’quadratic’: 3

      • ’cubic’: 4

      • ’bilinear’: 5

      • ’biquadratic’: 6

      • ’bicubic’: 7

      • ’lostarea’: 8

      • ’barycentric’: 9

      • ’discrete’: 10

    • ”dataDynamicity”:
      • ’observation’: 1

      • ’astronomicalPrediction’: 2

      • ’analysisOrHybrid’: 3

      • ’hydrodynamicHindcast’: 4

      • ’hydrodynamicForecast’: 5

    • ”methodCurrentsProduct”: Brief description of current meter type, forecast method or model, etc.

    • ”datetimeOfFirstRecord”: Valid time of the earliest value, ‘YYYYMMDDTHHMMSSZ’

    • ”datasetDeliveryInterval”: The expected time interval between availability of successive datasets

      for time-varying data. Must be formatted as ‘PnYnMnDTnHnMnS’ (ISO 8601 duration)

Returns:

An S111File object updated by this function.

Return type:

data_file