darts_export
darts_export
¶
Dataset export for the DARTS dataset.
export_tile
¶
export_tile(
tile: xarray.Dataset,
out_dir: pathlib.Path,
bands: list[str] = [
"probabilities",
"binarized",
"polygonized",
"extent",
"thumbnail",
],
ensemble_subsets: list[str] = [],
metadata: dict = {},
debug: bool = False,
)
Export a tile into a inference dataset, consisting of multiple files.
Parameters:
-
tile(xarray.Dataset) –The tile to export.
-
out_dir(pathlib.Path) –The path where to export to.
-
bands(list[str], default:['probabilities', 'binarized', 'polygonized', 'extent', 'thumbnail']) –The bands to export. Defaults to ["probabilities"].
-
ensemble_subsets(list[str], default:[]) –The ensemble subsets to export. Defaults to [].
-
metadata(dict, default:{}) –Metadata to include in the export.
-
debug(bool, default:False) –Debug mode: will write a .netcdf with all of the tiles contents. Defaults to False.
Raises:
-
ValueError–If the band is not found in the tile.
Source code in darts-export/src/darts_export/export.py
missing_outputs
¶
missing_outputs(
out_dir: pathlib.Path,
bands: list[str] = [
"probabilities",
"binarized",
"polygonized",
"extent",
"thumbnail",
],
ensemble_subsets: list[str] = [],
) -> typing.Literal["all", "some", "none"]
Check for missing output files in the given directory.
Parameters:
-
out_dir(pathlib.Path) –The directory to check for missing files.
-
bands(list[str], default:['probabilities', 'binarized', 'polygonized', 'extent', 'thumbnail']) –The bands to export. Defaults to ["probabilities"].
-
ensemble_subsets(list[str], default:[]) –The ensemble subsets to export. Defaults to [].
Returns:
-
typing.Literal['all', 'some', 'none']–Literal["all", "some", "none"]: A string indicating the status of missing files: - "none": No files are missing. - "some": Some files are missing, which one will be logged to debug. - "all": All files are missing.
Raises:
-
ValueError–If the output path is not a directory.