add_data_from_arrays

s100py.s104.v1_1.utils.add_data_from_arrays(height, trend, data_file, grid_properties, datetime_value, data_coding_format)

Updates an S104File object based on numpy array/h5py datasets. Calls create_s104 then fills in the HDF5 datasets with the supplied water level height and trend numpy.arrays.

Raises an S104Exception if the shapes of the water level height and trend (if not None) grids are not equal.

Parameters:
  • height (Union[ndarray, Dataset]) – 1d or 2d array containing water level heights

  • trend – 1d or 2d array containing water level trends

  • data_file – S104File object

  • datetime_value – datetime object

  • grid_properties (dict) –

    a dictionary of metadata describing the grids 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

  • data_coding_format

    • ‘Time Series at fixed stations’: 1

    • ’Regularly-Gridded arrays’: 2

    • ’Ungeorectified Grid’: 3

    • ’TIN’: 7

    • ’Time Series at fixed stations (stationwise)’: 8

Returns:

An S104File object updated by this function.

Return type:

data_file