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, **extra)[source]#

Load data from group_datasets() into an xarray.Dataset.

Parameters
  • sources (xarray.DataArray) – DataArray holding a list of datacube.model.Dataset, grouped along the time dimension

  • geobox (GeoBox) – A GeoBox defining the output spatial projection and resolution

  • measurements – list of Measurement objects

  • resampling (str|dict) –

    The 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 except fmask 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 – 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 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.

  • progress_cbk – 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 the 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.

Return type

xarray.Dataset