base_data#
- class arte.dataelab.base_data.BaseData(data, astropy_unit=None, data_label=None, axes=None)#
Bases:
objectGeneric static data container with lazy loading.
BaseData represents static (non-time-series) data such as calibration matrices, reference frames, or configuration parameters. It supports:
Lazy loading from files or direct numpy arrays
Optional physical units via astropy.units
Automatic unit conversion
Integration with NotAvailable pattern for missing data
- Parameters:
data (DataLoader, str, Path, or ndarray) – Data source. Can be: - DataLoader instance for lazy loading - Filename (string or Path) to load from - Numpy array for direct initialization
astropy_unit (astropy.units.Unit, optional) – Physical unit for the data
data_label (str, optional) – Human-readable label for plots (e.g., ‘Interaction Matrix’)
axes (sequence, optional) – Names for data axes
- _data_loader#
Internal data loader instance
- Type:
- _astropy_unit#
Unit for the data
- Type:
Unit
- _data_label#
Label for the data
- Type:
str
Examples
>>> # Load from file >>> interaction_matrix = BaseData('imat.npy', ... data_label='Interaction Matrix') >>> data = interaction_matrix.get_data()
>>> # Direct initialization >>> reference = BaseData(np.zeros((512, 512)), ... astropy_unit=u.nm, ... data_label='Reference Frame')
>>> # With lazy loading >>> from arte.dataelab.data_loader import NumpyDataLoader >>> loader = NumpyDataLoader('data.npy') >>> data = BaseData(loader)
See also
BaseTimeSeriesFor time-varying data
DataLoaderBase class for lazy data loading
- Attributes:
- shape
Methods
Data unit as an astropy unit
Long-form data label (for plots)
Data unit string (for plots)
filename()Data filename (full path)
get_data(*args[, axes])Raw data, selecting elements based on the indexer
get_display(*args, **kwargs)Data mapped in 2d
get_index_of(*args, **kwargs)Return data slice.
help([search, prefix])Interactive help
imshow([cut_wings, title, xlabel, ylabel])Display a 2d image.
- astropy_unit()#
Data unit as an astropy unit
- data_label()#
Long-form data label (for plots)
- data_unit()#
Data unit string (for plots)
- filename()#
Data filename (full path)
- get_data(*args, axes=None, **kwargs)#
Raw data, selecting elements based on the indexer
- get_display(*args, **kwargs)#
Data mapped in 2d
- get_index_of(*args, **kwargs)#
Return data slice. Override in derived classes if needed
- help(search='', prefix='')#
Interactive help
Prints on stdout a list of methods that match the search substring or all of them if search is left to the default value of an empty string, together with a one-line help taken from the first line of their docstring, if any.
The prefix argument is prepended to the method name and is used for recursive help of every class member.
- imshow(cut_wings=0, title='', xlabel='', ylabel='', **kwargs)#
Display a 2d image.
cut_wings=x means that colorbar is saturated for array values below x percentile and above 100-x percentile. Default is 0, i.e. all data are displayed; values below 0 are forced to 0, values above 50 are set to 50.
- property shape#