API Reference

This section provides a detailed reference for AQUA’s Application Programming Interface (API).

AQUA module

class aqua.LRAgenerator(catalog=None, model=None, exp=None, source=None, var=None, configdir=None, resolution=None, frequency=None, fix=True, outdir=None, tmpdir=None, nproc=1, loglevel=None, overwrite=False, definitive=False, performance_reporting=False, rebuild=False, exclude_incomplete=False, **kwargs)

Bases: object

Class to generate LRA data at required frequency/resolution

Initialize the LRA_Generator class

Parameters:
  • catalog (string) – The catalog you want to reader. If None, guessed by the reader.

  • model (string) – The model name from the catalog

  • exp (string) – The experiment name from the catalog

  • source (string) – The sourceid name from the catalog

  • var (str, list) – Variable(s) to be processed and archived in LRA.

  • resolution (string) – The target resolution for the LRA

  • frequency (string,opt) – The target frequency for averaging the LRA, if no frequency is specified, no time average is performed

  • fix (bool, opt) – True to fix the data, default is True

  • outdir (string) – Where the LRA is

  • tmpdir (string) – Where to store temporary files, default is None. Necessary for dask.distributed

  • configdir (string) – Configuration directory where the catalog are found

  • nproc (int, opt) – Number of processors to use. default is 1

  • loglevel (string, opt) – Logging level

  • overwrite (bool, opt) – True to overwrite existing files in LRA, default is False

  • definitive (bool, opt) – True to create the output file, False to just explore the reader operations, default is False

  • performance_reporting (bool, opt) – True to save an html report of the dask usage, default is False.

  • exclude_incomplete (bool,opt) – True to remove incomplete chunk when averaging, default is false.

  • rebuild (bool, opt) – Rebuild the weights when calling the reader

  • **kwargs – kwargs to be sent to the Reader, as ‘zoom’ or ‘realization’ please notice that realization will change the file name produced by the LRA

check_integrity(varname)

To check if the LRA entry is fine before running

create_catalog_entry()

Create an entry in the catalog for the LRA

create_zarr_entry(verify=True)

Create a Zarr entry in the catalog for the LRA

Parameters:

verify – open the LRA source and verify it can be read by the reader

property dask

Check if dask is needed

generate_lra()

Generate LRA data

get_filename(var, year=None, month=None, tmp=False)

Create output filenames

retrieve()

Retrieve data from the catalog

write_chunk(data, outfile)

Write a single chunk of data - Xarray Dataset - to a specific file using dask if required and monitoring the progress

class aqua.Reader(model=None, exp=None, source=None, catalog=None, fix=True, regrid=None, regrid_method=None, areas=True, datamodel=None, streaming=False, stream_generator=False, startdate=None, enddate=None, rebuild=False, loglevel=None, nproc=4, aggregation=None, chunks=None, preproc=None, convention='eccodes', **kwargs)

Bases: FixerMixin, RegridMixin, TimStatMixin

General reader for climate data.

Initializes the Reader class, which uses the catalog config/config.yaml to identify the required data.

Parameters:
  • model (str) – Model ID. Mandatory

  • exp (str) – Experiment ID. Mandatory.

  • source (str) – Source ID. Mandatory

  • catalog (str, optional) – Catalog where to search for the triplet. Default to None will allow for autosearch in the installed catalogs.

  • regrid (str, optional) – Perform regridding to grid regrid, as defined in config/regrid.yaml. Defaults to None.

  • regrid_method (str, optional) – CDO Regridding regridding method. Read from grid configuration. If not specified anywhere, using “ycon”.

  • fix (bool, optional) – Activate data fixing

  • areas (bool, optional) – Compute pixel areas if needed. Defaults to True.

  • datamodel (str, optional) – Destination data model for coordinates, overrides the one in fixes.yaml. Defaults to None.

  • streaming (bool, optional) – If to retrieve data in a streaming mode. Defaults to False.

  • stream_generator (bool, optional) – if to return a generator object for data streaming. Defaults to False

  • startdate (str, optional) – The starting date for reading/streaming the data (e.g. ‘2020-02-25’). Defaults to None.

  • enddate (str, optional) – The final date for reading/streaming the data (e.g. ‘2020-03-25’). Defaults to None.

  • rebuild (bool, optional) – Force rebuilding of area and weight files. Defaults to False.

  • loglevel (str, optional) – Level of logging according to logging module. Defaults to log_level_default of loglevel().

  • nproc (int,optional) – Number of processes to use for weights generation. Defaults to 4.

  • aggregation (str, optional) – the streaming frequency in pandas style (1M, 7D etc. or ‘monthly’, ‘daily’ etc.) Defaults to None (using default from catalog, recommended).

  • chunks (str or dict, optional) – chunking to be used for GSV access. Defaults to None (using default from catalog, recommended). If it is a string time chunking is assumed. If it is a dictionary the keys ‘time’ and ‘vertical’ are looked for. Time chunking can be one of S (step), 10M, 15M, 30M, h, 1h, 3h, 6h, D, 5D, W, M, Y. Vertical chunking is expressed as the number of vertical levels to be used.

  • preproc (function, optional) – a function to be applied to the dataset when retrieved. Defaults to None.

  • convention (str, optional) – convention to be used for reading data. Defaults to ‘eccodes’. (Only one supported so far)

  • **kwargs – Arbitrary keyword arguments to be passed as parameters to the catalog entry. ‘zoom’, meant for HEALPix grid, is a predefined one which will allow for multiple gridname definitions.

Returns:

A Reader class object.

Return type:

Reader

detrend(data, dim='time', degree=1, skipna=True)

A basic detrending routine based on polyfit and polyval xarray functions within AQUA. Given an xarray object, will provide the detrended timeseries, by default working along time coordinate If it is a Dataset, only variables with the required coordinate will be detrended.

Parameters:
  • data (DataArray, Dataset) – your dataset

  • dim (str) – The dimension along which apply detrending

  • degree (str, optional) – The degree of the polinominal fit. Default is 1, i.e. linear detrend

  • skinpna (bool, optional) – skip or not the NaN

Return

A detrended DataArray or a Dataset

fldmean(data, lon_limits=None, lat_limits=None, **kwargs)

Perform a weighted global average. If a subset of the data is provided, the average is performed only on the subset.

Parameters:
  • data (xr.DataArray or xarray.DataDataset) – the input data

  • lon_limits (list, optional) – the longitude limits of the subset

  • lat_limits (list, optional) – the latitude limits of the subset

Kwargs:
  • box_brd (bool,opt): choose if coordinates are comprised or not in area selection.

    Default is True

Returns:

the value of the averaged field

info()

Prints info about the reader

instance = None
reader_fdb(esmcat, var, startdate, enddate, dask=False, level=None)

Read fdb data. Returns an iterator or dask array.

Parameters:
  • esmcat (intake catalog) – the intake catalog to read

  • var (str, int or list) – the variable(s) to read

  • startdate (str) – a starting date and time in the format YYYYMMDD:HHTT

  • enddate (str) – an ending date and time in the format YYYYMMDD:HHTT

  • dask (bool) – return directly a dask array instead of an iterator

  • level (list, float, int) – level to be read, overriding default in catalog

Returns:

An xarray.Dataset or an iterator over datasets

reader_intake(esmcat, var, loadvar, keep='first')

Read regular intake entry. Returns dataset.

Parameters:
  • esmcat (intake.catalog.Catalog) – your catalog

  • var (list or str) – Variable to load

  • loadvar (list of str) – List of variables to load

  • keep (str, optional) – which duplicate entry to keep (“first” (default), “last” or None)

Returns:

Dataset

regrid(data)

Call the regridder function returning container or iterator

retrieve(var=None, level=None, startdate=None, enddate=None, history=True, sample=False)

Perform a data retrieve.

Parameters:
  • var (str, list) – the variable(s) to retrieve. Defaults to None. If None, all variables are retrieved.

  • level (list, float, int) – Levels to be read, overriding default in catalog source (only for FDB) .

  • startdate (str) – The starting date for reading/streaming the data (e.g. ‘2020-02-25’). Defaults to None.

  • enddate (str) – The final date for reading/streaming the data (e.g. ‘2020-03-25’). Defaults to None.

  • history (bool) – If you want to add to the metadata history information about retrieve. Defaults to True.

  • sample (bool) – read only one default variable (used only if var is not specified). Defaults to False.

Returns:

A xarray.Dataset containing the required data.

set_default()

Sets this reader as the default for the accessor.

vertinterp(data, levels=None, vert_coord='plev', units=None, method='linear')

A basic vertical interpolation based on interp function of xarray within AQUA. Given an xarray object, will interpolate the vertical dimension along the vert_coord. If it is a Dataset, only variables with the required vertical coordinate will be interpolated.

Parameters:
  • data (DataArray, Dataset) – your dataset

  • levels (float, or list) – The level you want to interpolate the vertical coordinate

  • units (str, optional,) – The units of your vertical axis. Default ‘Pa’

  • vert_coord (str, optional) – The name of the vertical coordinate. Default ‘plev’

  • method (str, optional) – The type of interpolation method supported by interp()

Return

A DataArray or a Dataset with the new interpolated vertical dimension

class aqua.Streaming(aggregation='S', startdate=None, enddate=None, loglevel=None)

Bases: object

Streaming class to be used in Reader and elsewhere

The Streaming constructor. The streamer is used to stream data by either a specific time interval or by a specific number of samples. If the unit parameter is specified, the data is streamed by the specified unit and stream_step (e.g. 1 month). If the unit parameter is not specified, the data is streamed by stream_step steps of the original time resolution of input data.

If the stream function is called a second time, it will return the subsequent chunk of data in the sequence. The function keeps track of the state of the streaming process through the use of an internal counter. This allows the user to stream through the entire dataset in multiple calls to the function, retrieving consecutive chunks of data each time.

If startdate is not specified, the method will use the first date in the dataset.

Parameters:
  • startdate (str) – the starting date for streaming the data (e.g. ‘2020-02-25’) (None)

  • enddate (str) – the ending date for streaming the data (e.g. ‘2021-01-01’) (None)

  • aggregation (str) – the streaming frequency in pandas style (1M, 7D etc.)

  • loglevel (string) – Level of logging according to logging module (default: log_level_default of loglevel())

Returns:

A Streaming class object.

generator(data, startdate=None, enddate=None, aggregation=None)

The generator method is designed to split data into smaller chunks of data for processing or analysis. It returns a generator object that yields the smaller chunks of data. The method can split the data based on either a specific time interval or by a specific number of samples. Aggregation (frequency/chunking) and starting and ending dates selected at class instantiation can be overwritten.

Parameters:
  • data (xr.Dataset) – the input xarray.Dataset

  • startdate (str) – the starting date for streaming the data (e.g. ‘2020-02-25’) (None)

  • enddate (str) – the ending date for streaming the data (e.g. ‘2021-01-01’) (None)

  • aggregation (str) – the streaming frequency in pandas style (1M, 7D etc.)

Returns:

A generator object that yields the smaller chunks of data.

reset()

Reset the state of the streaming process. This means that if the stream function is called again after calling reset_stream, it will start streaming the input data from the beginning.

stream(data, startdate=None, enddate=None, aggregation=None, timechunks=None, reset=False)

Stream a chunk of a dataset using startdate, enddate and aggregation defined by the constructor.

Parameters:
  • data (xr.Dataset) – the input xarray.Dataset

  • startdate (str) – the starting date for streaming the data (e.g. ‘2020-02-25’) (None)

  • enddate (str) – the ending date for streaming the data (e.g. ‘2021-01-01’) (None)

  • aggregation (str) – the streaming frequency in pandas style (1M, 7D etc.)

  • timechunks (DataArrayResample, optional) – a precomputed chunked time axis

  • reset (bool, optional) – reset the streaming

Returns:

A xarray.Dataset containing the subset of the input data that has been streamed.

stream_chunk(data, startdate=None, enddate=None, aggregation=None)

Compute chunks for a dataset using startdate, enddate and aggregation defined by the constructor.

Parameters:
  • data (xr.Dataset) – the input xarray.Dataset

  • startdate (str) – the starting date for streaming the data (e.g. ‘2020-02-25’) (None)

  • enddate (str) – the ending date for streaming the data (e.g. ‘2021-01-01’) (None)

  • aggregation (str) – the streaming frequency in pandas style (1M, 7D etc.)

Returns:

A DataArrayResample object for the time axis

aqua.catalog(verbose=True, configdir=None, catalog_name=None)

Catalog of available data.

Parameters:
  • verbose (bool, optional) – If True, prints the catalog information to the console. Defaults to True.

  • configdir (str, optional) – The directory containing the configuration files. If not provided, get_config_dir is used to find it.

Returns:

The catalog object

containing the data.

Return type:

cat (intake.catalog.local.LocalCatalog)

aqua.inspect_catalog(catalog_name=None, model=None, exp=None, source=None, verbose=True)

Basic function to simplify catalog inspection. If a partial match between model, exp and source is provided, then it will return a list of models, experiments or possible sources. If all three are specified it returns False if that combination does not exist, a list of variables if the source is a FDB/GSV source and it exists and True if it exists but is not a FDB source.

Parameters:
  • catalog_name (str, optional) – A string containing the catalog name.

  • model (str, optional) – The model ID to filter the catalog. If None, all models are returned. Defaults to None.

  • exp (str, optional) – The experiment ID to filter the catalog. If None, all experiments are returned. Defaults to None.

  • source (str, optional) – The source ID to filter the catalog. If None, all sources are returned. Defaults to None.

  • verbose (bool, optional) – Print the catalog information to the console. Defaults to True.

Returns:

A list of available items in the catalog, depending on the

specified model and/or experiment, a list of variables or True/False.

Return type:

list

Raises:

KeyError – If the input specifications are incorrect.

aqua.job(exclusive=False, max_resources=False, cores=None, memory=None, queue=None, account=None, walltime=None, jobs=None, path_to_output=None, loglevel='WARNING', machine_name=None, config_name='/home/docs/checkouts/readthedocs.org/user_builds/aqua/conda/v0.13-operational/lib/python3.12/site-packages/aqua/slurm/config-slurm.yml')

Submitting the Job to the SLURM queue

Parameters:
  • exclusive (bool, optional) – If True, the job will be submitted asking for exclusive access to the node. Defaults to False.

  • max_resources (bool, optional) – If True, the job will be submitted asking for the maximum resources available on the node. Defaults to False.

  • cores (int, optional) – The number of cores per socket. Defaults to None.

  • memory (str, optional) – The real memory required per node. Defaults to None.

  • queue (str, optional) – The name of the queue to which SLURM submits the job. Defaults to None.

  • walltime (str, optional) – The duration for which the nodes remain allocated to you. Defaults to None.

  • jobs (int, optional) – The factor of assignment scaling across multiple nodes. Defaults to None.

  • account (str, optional) – The account to which SLURM charges the job. Defaults to None.

  • path_to_output (str, optional) – The path to the directory, which will contain logs/errors and output of Slurm Jobs. Defaults is None.

  • loglevel (str, optional) – The level of logging. Defaults to ‘WARNING’.

  • machine_name (str, optional) – The name of the machine for which to retrieve configuration settings. Defaults to None.

  • config_name (str, optional) – The path to the YAML configuration file that contains machine specific settings. Defaults to ‘config-slurm.yml’.

aqua.max_resources_per_node(queue=None, machine_name=None, config_name='/home/docs/checkouts/readthedocs.org/user_builds/aqua/conda/v0.13-operational/lib/python3.12/site-packages/aqua/slurm/config-slurm.yml', loglevel='WARNING')

Extracting the maximum resources available on the node for the queue

Parameters:
  • queue (str, optional) – The name of the queue to which maximum resources available on the node are extracted. Defaults to None.

  • machine_name (str, optional) – The name of the machine for which to retrieve configuration settings. Defaults to None.

  • config_name (str, optional) – The path to the YAML configuration file that contains machine specific settings. Defaults to ‘config-slurm.yml’.

  • loglevel (str, optional) – The logging level to be used for the logger that reports issues or activities of the function. Defaults to ‘WARNING’.

Returns:

The maximum amount of memory available on the

node for the queue

max_walltime (str): The maximum amount of walltime available on the

node for the queue

max_cpus (str): The maximum number of cpus available on the

node for the queue

max_sockets (str): The maximum number of sockets available on the

node for the queue

max_cores (str): The maximum number of cores available on the

node for the queue

max_threads (str): The maximum number of threads available on the

node for the queue

Return type:

max_memory (str)

aqua.output_dir(path_to_output='.', loglevel='WARNING')

Creating the directory for output if it does not exist

Parameters:
  • path_to_output (str, optional) – The path to the directory, which will contain logs/errors and output of Slurm Jobs. Defaults is ‘.’

  • loglevel (str, optional) – The level of logging. Defaults to ‘WARNING’.

Returns:

The path to the directory for logs/errors output_path (str): The path to the directory for output

Return type:

logs_path (str)

aqua.plot_hovmoller(data: DataArray, invert_axis=False, invert_time=False, sym=False, contour=True, save=False, dim='lon', figsize=(8, 13), vmin=None, vmax=None, cmap='PuOr_r', nlevels=8, cbar_label=None, outputdir='.', filename='hovmoller.pdf', display=True, return_fig=False, loglevel: str = 'WARNING', **kwargs)

” Plot a hovmoller diagram of a DataArray.

Parameters:
  • data (xr.DataArray) – xr.DataArray to be plot

  • invert_axis (bool,opt) – enable or disable axis inversion, default is False

  • invert_time (bool,opt) – enable or disable time inversion, if False, time will increase with the increasing axis direction.

  • sym (bool,opt) – center the cbar around zero, default is False

  • contour (bool,opt) – True for contour plot, False for pcolormesh, default is True

  • save (bool,opt) – save the figure, default is False

  • dim (str,opt) – dimension to be averaged over, default is ‘lon’

  • figsize (tuple,opt) – figure size, default is (11, 8.5)

  • vmin (float,opt) – minimum value for the colorbar

  • vmax (float,opt) – maximum value for the colorbar

  • cmap (str,opt) – colormap, default is ‘RdBu_r’

  • nlevels (int,opt) – number of contour levels, default is 8

  • cbar_label (str,opt) – colorbar label, default is None

  • outputdir (str,opt) – output directory, default is ‘.’

  • filename (str,opt) – output filename, default is ‘hovmoller.png’

  • show_dim_values (bool,opt) – show the values of the dimension over which the mean was taken (round them to int) Default is True

  • display (bool, optional) – If True, display the figure. Defaults to True.

  • return_fig (bool, optional) – If True, return the figure (fig, ax). Defaults to False.

  • loglevel (str,opt) – log level for the logger, default is ‘WARNING’

Keyword Arguments:
  • format (str, optional) – Format of the figure. Defaults to ‘pdf’.

  • dpi (int, optional) – Dots per inch. Defaults to 100 for pcolormesh and 300 for contour plots.

Returns:

tuple with the figure and axes

Return type:

fig, ax

aqua.plot_maps(maps: list = None, titles: list = None, contour=True, save=False, sym=False, figsize=(11, 8.5), nlevels=11, outputdir='.', cmap='RdBu_r', gridlines=False, display=True, loglevel='WARNING', **kwargs)

Plot multiple maps. This is supposed to be used for maps to be compared together. A list of xarray.DataArray objects is expected and a map is plotted for each of them

Parameters:
  • maps (list) – list of xarray.DataArray objects

  • titles (list,opt) – list of titles for the maps

  • contour (bool,opt) – If True, plot a contour map,otherwise a pcolormesh. Defaults to True.

  • save (bool,opt) – save the figure, default is False

  • sym (bool,opt) – symetric colorbar, default is False

  • figsize (tuple,opt) – figure size, default is (11, 8.5)

  • nlevels (int,opt) – number of levels for the colorbar, default is 11

  • outputdir (str,opt) – output directory, default is ‘.’

  • vmin (float,opt) – minimum value for the colorbar, default is None

  • vmax (float,opt) – maximum value for the colorbar, default is None

  • cmap (str,opt) – colormap, default is ‘RdBu_r’

  • gridlines (bool,opt) – display gridlines, default is False

  • display (bool,opt) – display the figure, default is True

  • loglevel (str,opt) – log level, default is ‘WARNING’

  • **kwargs – additional arguments

Keyword Arguments:
  • title (str,opt) – super title for the figure

  • transform_first (bool, optional) – If True, transform the data before plotting. Defaults to False.

  • vmin (float, optional) – minimum value for the colorbar

  • vmax (float, optional) – maximum value for the colorbar

  • cbar_label (str,opt) – colorbar label

  • dpi (int,opt) – dots per inch, default is 100

  • models (list,opt) – list of models

  • exps (list,opt) – list of experiments

  • filename (str,opt) – filename for the figure, default is ‘maps.pdf’

  • format (str,opt) – format for the figure, default is ‘pdf’

  • nxticks (int,opt) – number of xticks, default is 7

  • nyticks (int,opt) – number of yticks, default is 7

  • ticks_rounding (int, optional) – Number of digits to round the ticks.

  • cyclic_lon (bool,opt) – add cyclic longitude, default is True

Raises:

ValueError – if nothing to plot, i.e. maps is None or not a list of xarray.DataArray

Returns:

fig, axs if more manipulations on the figure are needed

aqua.plot_single_map(data: DataArray, save=False, contour=True, sym=False, figsize=(11, 8.5), nlevels=11, outputdir='.', vmin=None, vmax=None, cmap='RdBu_r', gridlines=False, display=True, return_fig=False, loglevel='WARNING', **kwargs)

Plot contour or pcolormesh map of a single variable.

Parameters:
  • data (xr.DataArray) – Data to plot.

  • save (bool, optional) – If True, save the figure. Defaults to False.

  • contour (bool, optional) – If True, plot a contour map, otherwise a pcolormesh. Defaults to True.

  • figsize (tuple, optional) – Figure size. Defaults to (11, 8.5).

  • nlevels (int, optional) – Number of levels for the contour map. Defaults to 11.

  • outputdir (str, optional) – Output directory. Defaults to “.”.

  • vmin (float, optional) – Minimum value for the colorbar. Defaults to None.

  • vmax (float, optional) – Maximum value for the colorbar. Defaults to None.

  • cmap (str, optional) – Colormap. Defaults to ‘RdBu_r’.

  • gridlines (bool, optional) – If True, plot gridlines. Defaults to False.

  • display (bool, optional) – If True, display the figure. Defaults to True.

  • return_fig (bool, optional) – If True, return the figure (fig, ax). Defaults to False.

  • loglevel (str, optional) – Log level. Defaults to ‘WARNING’.

Keyword Arguments:
  • title (str, optional) – Title of the figure. Defaults to None.

  • transform_first (bool, optional) – If True, transform the data before plotting. Defaults to False.

  • cbar_label (str, optional) – Colorbar label. Defaults to None.

  • dpi (int, optional) – Dots per inch. Defaults to 100 for pcolormesh and 300 for contour plots.

  • model (str, optional) – Model name. Defaults to None.

  • exp (str, optional) – Experiment name. Defaults to None.

  • filename (str, optional) – Filename. Defaults to ‘map’.

  • format (str, optional) – Format of the figure. Defaults to ‘pdf’.

  • nxticks (int, optional) – Number of x ticks. Defaults to 7.

  • nyticks (int, optional) – Number of y ticks. Defaults to 7.

  • ticks_rounding (int, optional) – Number of digits to round the ticks. Defaults to 0 for full map, 1 if min-max < 10, 2 if min-max < 1.

  • cbar_ticks_rounding (int, optional) – Number of digits to round the colorbar ticks. Default is no rounding.

  • cyclic_lon (bool, optional) – If True, add cyclic longitude.

  • return_fig (bool, optional) – If True, return the figure (fig, ax). Defaults to False.

Raises:

ValueError – If data is not a DataArray.

aqua.plot_single_map_diff(data: DataArray, data_ref: DataArray, vmin_fill=None, vmax_fill=None, vmin_contour=None, vmax_contour=None, save=False, display=True, sym_contour=False, sym=True, outputdir='.', filename='map.png', title=None, loglevel='WARNING', **kwargs)

Plot the difference of data-data_ref as map and add the data as a contour plot.

Parameters:
  • data (xr.DataArray) – Data to plot.

  • data_ref (xr.DataArray) – Reference data to plot the difference.

  • vmin_fill (float, optional) – Minimum value for the colorbar of the fill.

  • vmax_fill (float, optional) – Maximum value for the colorbar of the fill.

  • vmin_contour (float, optional) – Minimum value for the colorbar of the contour.

  • vmax_contour (float, optional) – Maximum value for the colorbar of the contour.

  • save (bool, optional) – If True, save the figure. Defaults to False.

  • display (bool, optional) – If True, display the figure. Defaults to True.

  • sym_contour (bool, optional) – If True, set the contour levels to be symmetrical. Default to False

  • sym (bool, optional) – If True, set the colorbar for the diff to be symmetrical. Default to True

  • outputdir (str, optional) – Output directory. Defaults to “.”.

  • filename (str, optional) – Filename. Defaults to ‘map.png’.

  • title (str, optional) – Title of the figure. Defaults to None.

  • loglevel (str, optional) – Log level. Defaults to ‘WARNING’.

  • **kwargs – Keyword arguments for plot_single_map. Check the docstring of plot_single_map. return_fig will be used to return the figure and axes.

Raises:

ValueError – If data or data_ref is not a DataArray.

aqua.plot_timeseries(monthly_data=None, annual_data=None, ref_monthly_data=None, ref_annual_data=None, std_monthly_data=None, std_annual_data=None, data_labels: list = None, ref_label: str = None, loglevel: str = 'WARNING', **kwargs)

monthly_data and annual_data are list of xr.DataArray that are plot as timeseries together with their reference data and standard deviation.

Parameters:
  • monthly_data (list of xr.DataArray) – monthly data to plot

  • annual_data (list of xr.DataArray) – annual data to plot

  • ref_monthly_data (xr.DataArray) – reference monthly data to plot

  • ref_annual_data (xr.DataArray) – reference annual data to plot

  • std_monthly_data (xr.DataArray) – standard deviation of the reference monthly data

  • std_annual_data (xr.DataArray) – standard deviation of the reference annual data

  • data_labels (list of str) – labels for the data

  • ref_label (str) – label for the reference data

  • loglevel (str) – logging level

Keyword Arguments:
  • figsize (tuple) – size of the figure

  • title (str) – title of the plot

Returns:

tuple containing the figure and axis objects

Return type:

fig, ax (tuple)

aqua.scancel(all=True, Job_ID=None, loglevel='WARNING')

scancel() is used to signal or cancel jobs in the queue

Parameters:
  • all (bool, optional) – If all is True, the function cancels all user jobs in the queue.

  • Job_ID (str, optional) – The SLURM_JOB_ID of a job to cancel in the queue. Defaults to None.

  • loglevel (str, optional) – The level of logging. Defaults to ‘WARNING’.

aqua.squeue(username='$USER', verbose=True)

Checking the status of a SLURM job

Parameters:
  • username (str, optional) – Name of the user who submitted the job to the queue. Defaults to “$USER”.

  • verbose (bool, optional) – If True, more info are printed.

Returns:

The status of all jobs of the user

in a SLURM queue

Return type:

squeue_user (str)