cedar.preard module¶
Convert “pre-ARD” to ARD
-
cedar.preard.
ard_netcdf_encoding
(ard_ds, metadata, **encoding_kwds)[source]¶ Return encoding for ARD NetCDF4 files
- Parameters
ard_ds (xr.Dataset) – ARD as a XArray Dataset
metadata (dict) – Metadata about ARD
- Returns
NetCDF encoding to use with
xarray.Dataset.to_netcdf()
- Return type
-
cedar.preard.
find_preard
(path, metadata_pattern='*.json')[source]¶ Match pre-ARD metadata with imagery in some location
- Parameters
- Returns
Pairs of metadata filename to image filename(s)
- Return type
-
cedar.preard.
preard_to_ard
(xarr, time, bands)[source]¶ Convert a “pre-ARD” DataArray to an ARD xr.Dataset
- Parameters
xarr (xarray.DataArray) – DataArray containing observations from all bands and time
time (np.ndarray) – Time information for each observation
bands (Sequence[str]) – Band names
- Returns
Dataset containing all observations split into subdatasets according to band
- Return type
xr.Dataset
- Raises
ValueError – Raised if the number of bands and times specified do not match the number of “bands” in the input DataArray
-
cedar.preard.
process_preard
(metadata, images, chunks=None)[source]¶ Open and process pre-ARD data to ARD
- Parameters
- Returns
pre-ARD processed to (in memory) ARD format that can be written to disk
- Return type
xr.Dataset