The Export Module

class sits.export.Sits_ds(nc_path)

handle xarray.dataset

ds2da(keep_bands=['B04', 'B03', 'B02'])

Transform xarray.dataset into xarray.dataarray with dimensions ordered as follows: ‘time’, ‘band’, ‘y’, ‘x’.

Parameters:

keep_bands (list, optional) – bands to keep (1 or 3 bands for gif export).

Returns:

xarray.dataarray.

Return type:

Sits_ds.da

Example

>>> geo_dc = Sits_ds(netcdf_file)
>>> geo_dc.ds2da()
export2gif(imgfile=None, fps=8, robust=True, **kwargs)

Create satellite timelapse, and export it as animated GIF file.

Parameters:
  • imgfile (string, optional) – GIF file path.

  • fps (int, optional) – frames per second

  • robust (bool, optional) – calculate vmin and vmax from the 2nd and 98th percentiles of the data. Defaults to True.

Returns:

IPython.display.Image if imgfile is None.

Return type:

Sits_ds.gif

Example

>>> geo_dc = Sits_ds(netcdf_file)
>>> geo_dc.ds2da()
>>> geo_dc.export2gif(imgfile='myTimeSeries.gif')