datacube.Datacube.load_data#
- static Datacube.load_data(sources, geobox, measurements, resampling=None, fuse_func=None, dask_chunks=None, skip_broken_datasets=False, progress_cbk=None, extra_dims=None, patch_url=None, driver=None, **extra)[source]#
Load data from
group_datasets()
into anxarray.Dataset
.- Parameters:
sources (xarray.DataArray) – DataArray holding a list of
datacube.model.Dataset
, grouped along the time dimensiongeobox (GeoBox) – A GeoBox defining the output spatial projection and resolution
measurements (
Mapping
[str
,Measurement
] |list
[Measurement
]) – list of Measurement objectsThe resampling method to use if re-projection is required. This could be a string or a dictionary mapping band name to resampling mode. When using a dict use
'*'
to indicate “apply to all other bands”, for example{'*': 'cubic', 'fmask': 'nearest'}
would use cubic for all bands exceptfmask
for which nearest will be used.Valid values are:
'nearest', 'cubic', 'bilinear', 'cubic_spline', 'lanczos', 'average', 'mode', 'gauss', 'max', 'min', 'med', 'q1', 'q3'
Default is to use
nearest
for all bands.fuse_func (
Callable
[[ndarray
,ndarray
],Any
] |Mapping
[str
,Callable
[[ndarray
,ndarray
],Any
] |None
] |None
) – function to merge successive arrays as an output. Can be a dictionary just like resampling.dask_chunks (dict) –
If provided, the data will be loaded on demand using
dask.array.Array
. Should be a dictionary specifying the chunking size for each output dimension. Unspecified dimensions will be auto-guessed, currently this means use chunk size of 1 for non-spatial dimensions and use whole dimension (no chunking unless specified) for spatial dimensions.See the documentation on using xarray with dask for more information.
skip_broken_datasets (
bool
) – do not include broken datasets in the result.progress_cbk (
Callable
[[int
,int
],Any
] |None
) – Int, Int -> None if supplied will be called for every file read with files_processed_so_far, total_files. This is only applicable to non-lazy loads, ignored when using dask.extra_dims (ExtraDimensions) – A ExtraDimensions describing any additional dimensions on top of (t, y, x)
patch_url (Callable[[str], str],) – if supplied, will be used to patch/sign the url(s), as required to access some commercial archives.
driver (
Any
|None
) – Optional. If provided, use the specified driver to load the data.
- Return type:
See also