save_list

ndmapper.io.save_list(*args, **kwargs)[source] [edit on github]

Save a list of data arrays and associated meta-data to a file (overwriting any existing data).

Where data and array_meta are both None at a given list index, any data already present at the corresponding location within the file will be preserved, avoiding redundant writes where possible (it is the caller’s responsibility to determine what needs re-writing and what can be kept).

Parameters:

filename : str

Name of the (new or existing) file to which the data should be saved.

data : list of ndarray or None

Ndarray instances to be saved to each location within the file.

array_meta : list of dict-like or None, optional

Header/meta-data dictionaries associated with each data array.

identifiers : list of (str or None, int or str or None), optional

Name and group identifier for each array within the file (eg. FITS EXTNAME & EXTVER), where applicable overriding any such information in array_meta.

types : list of str, optional

Type of each data item to be saved: ‘image’ or ‘table’ (where the applicable file format makes such a distinction). Defaults to ‘image’ for each item.

common_meta : dict-like, optional

Header/meta-data dictionary common to all the arrays within the file.