libera_utils.io.netcdf.write_libera_data_product#

libera_utils.io.netcdf.write_libera_data_product(data_product_definition: str | CloudPath | Path, data: dict[str, ndarray[Any, dtype[_ScalarType_co]]], output_path: str | CloudPath | Path, time_variable: str, strict: bool = True) LiberaDataProductFilename#

Write a Libera data product NetCDF4 file that conforms to data product definition requirements

Parameters:
  • data_product_definition (str | PathType) – Path to the data product definition against which to verify conformance

  • data (dict[str, NDarray]) – Data mapping variable names to numpy data arrays

  • output_path (str | PathType) – Base path (directory or S3 prefix) at which to write the product file

  • time_variable (str) – Name of variable that indicates time. This is used to generate the start and end time for the filename.

  • strict (bool) – Default True. Raises an exception if the final Dataset doesn’t conform to the data product definition.

Returns:

Filename object containing the full path to the written NetCDF4 data product file.

Return type:

LiberaDataProductFilename