swarmpal._api#

Attributes#

Functions#

make_process([process_name, config])

Instantiates a PalProcess object with a given name and a configuration.

apply_process(data[, process_name, config])

Create a SwarmPAL process and apply it on the given data.

apply_processes(data, process_params)

Apply a list of processes to a dataset.

_str_to_timedelta(time)

Convert strings that match 'HH:MM:SS' to datetime.timedelta objects.

_fetch_dataset([provider, config, options])

Helper that downloads a single dataset from a data provider with a specified configuration.

fetch_data(configurations)

Downloads list of datasets and returns a unified DataTree.

_detect_toolbox(→ str)

Inspect PAL_meta to determine which toolbox produced the output datasets.

quicklook(data[, toolbox])

Create a quicklook plot based on the toolbox processes recorded in PAL_meta.

Module Contents#

swarmpal._api.processes_by_name#
swarmpal._api.make_process(process_name=None, config={})[source]#

Instantiates a PalProcess object with a given name and a configuration.

Parameters:
  • process_name (Str) – The name of the process to apply. Must be one of [‘FAC_single_sat’].

  • config (dict) – Parameters passed to the Toolbox’ process.

swarmpal._api.apply_process(data, process_name=None, config={})[source]#

Create a SwarmPAL process and apply it on the given data.

Parameters:
  • data (DataTree) – the data on which the process will be applied to.

  • process_name (Str) – the name of the process to apply. See … for a list of Toolboxes and their Processes.

  • config (dict) – parameters passed to the Toolbox.

swarmpal._api.apply_processes(data, process_params)[source]#

Apply a list of processes to a dataset.

Parameters:
  • data (DataTree) – the data on which the process will be applied to.

  • process_params – a list of processes to apply to the input data.

swarmpal._api._str_to_timedelta(time)[source]#

Convert strings that match ‘HH:MM:SS’ to datetime.timedelta objects.

swarmpal._api._fetch_dataset(provider='', config={}, options=None)[source]#

Helper that downloads a single dataset from a data provider with a specified configuration. :param provider: The name of the data provider. Must be one of [‘vires’, ‘hapi’]. :type provider: Str :param config: A configuration passed to create_paldata.

TODO: describe the ‘schema’

Parameters:

options (dict or None) –

The option passed to create_paldata. When None, the following defaults are used:

Provider

Default Options

vires

dict(asynchronous=False, show_progress=False)

hapi

dict(logging=False)

swarmpal._api.fetch_data(configurations)[source]#

Downloads list of datasets and returns a unified DataTree.

Parameters:

configurations (List) – A list of configurations passed to create_paldata. TODO: describe the ‘schema’

swarmpal._api._TOOLBOX_QUICKLOOKS#
swarmpal._api._detect_toolbox(data: xarray.DataTree) str[source]#

Inspect PAL_meta to determine which toolbox produced the output datasets.

swarmpal._api.quicklook(data: xarray.DataTree, toolbox: str | None = None)[source]#

Create a quicklook plot based on the toolbox processes recorded in PAL_meta.

Parameters:
  • data (DataTree) – Data that has been processed by SwarmPAL

  • toolbox (str, optional) – Override toolbox selection (one of: ‘FAC’, ‘TFA’, ‘DSECS’). Case-insensitive. If omitted, the toolbox is auto-detected from PAL_meta.

Return type:

matplotlib.figure.Figure