base_analyzer#

class arte.dataelab.base_analyzer.BaseAnalyzer(*args, **kwargs)#

Bases: object

Main analyzer object for adaptive optics data analysis.

The Analyzer is the primary interface for loading and analyzing data identified by a unique tag (typically a timestamp). It coordinates:

  • Data file discovery via FileWalker

  • Lazy loading of time series data

  • Caching of computed results to disk

  • Access to raw and processed data streams

Analyzers are typically accessed via the get() classmethod which maintains an internal cache, ensuring that multiple requests for the same tag return the same instance.

Parameters:
  • snapshot_tag (str) – Unique identifier for this dataset (e.g., ‘20240101_120000’)

  • recalc (bool, optional) – If True, clear all cached data and recompute on access (default: False)

_snapshot_tag#

The tag identifying this dataset

Type:

str

Examples

>>> analyzer = MyAnalyzer.get('20240101_120000')
>>> modes = analyzer.residual_modes.get_data()
>>> std_per_mode = analyzer.residual_modes.time_std()
>>> # Force recalculation of cached data
>>> analyzer = MyAnalyzer.get('20240101_120000', recalc=True)

Notes

When creating a derived class:

  1. Define data streams as attributes (e.g., self.residual_modes)

  2. Use DataLoaders for lazy file loading

  3. Methods returning expensive computations can use @cache_on_disk

  4. The _post_init() method is called automatically after __init__

See also

BaseAnalyzerSet

For analyzing multiple tags together

cache_on_disk

Decorator for persistent caching

Methods

date_in_seconds()

Tag date as seconds since the epoch

get(tag, *args[, recalc])

Get the Analyzer instance (or derived class) corresponding to tag.

help([search, prefix])

Interactive help

info()

Info dictionary

recalc()

Force recalculation of this analyzer data

snapshot_tag()

Snapshot tag for this Analyzer object

summary([keywidth])

Print info dictionary on stdout

wiki([header])

Print info dictionary in wiki format on stdout

date_in_seconds()#

Tag date as seconds since the epoch

classmethod get(tag, *args, recalc=False, **kwargs)#

Get the Analyzer instance (or derived class) corresponding to tag.

This method mantains an internal cache. If a tag is requested multiple times, the same Analyzer instance is returned.

Parameters:
  • tag (str) – snapshot tag

  • recalc (bool, optional) – if set to True, any cached data for this tag will be deleted and computed again when requested

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.

info()#

Info dictionary

recalc()#

Force recalculation of this analyzer data

snapshot_tag()#

Snapshot tag for this Analyzer object

summary(keywidth=None)#

Print info dictionary on stdout

wiki(header=True)#

Print info dictionary in wiki format on stdout

class arte.dataelab.base_analyzer.PostInitCaller#

Bases: type

Meta class with a _post_init() method.

Used to initialize the disk cache, since DiskCacher objects are available only after all child/member objects have been initialized

Methods

__call__(*args, **kwargs)

Call self as a function.

mro(/)

Return a type's method resolution order.