synthesizer.instruments.instrument_base

Shared abstract base class for observational instruments.

This module defines InstrumentBase, the common interface shared by all specialised instrument implementations in Synthesizer. It provides the small set of behaviour that is genuinely common across the hierarchy: identity, comparison, collection composition, and capability flags.

Specialised subclasses are responsible for owning their own observing-mode state, validation, serialisation, and observation-specific behaviour.

Classes

class synthesizer.instruments.instrument_base.InstrumentBase(label)[source]

Shared abstract base class for all instrument implementations.

Capability flags are declared explicitly here. When a new instrument capability is introduced, it should be added to this interface and then overridden by the relevant specialised instrument classes.

This base class deliberately does not attempt to represent every possible instrument configuration itself. Instead, it defines the common contract that specialised child classes must satisfy.

In practice this means the base class owns only the genuinely shared behaviour of the hierarchy, while child classes own the details of their own observing modes.

property can_do_imaging

Return whether this instrument supports imaging.

Returns:

True if the instrument supports image generation,

otherwise False.

Return type:

bool

property can_do_noisy_imaging

Return whether this instrument supports noisy imaging.

Returns:

True if the instrument has the information required to

apply noise to images, otherwise False.

Return type:

bool

property can_do_noisy_resolved_spectroscopy

Return whether this instrument supports noisy IFU work.

Returns:

True if the instrument has the information required to

apply noise in the resolved-spectroscopy case, otherwise False.

Return type:

bool

property can_do_noisy_spectroscopy

Return whether this instrument supports noisy spectroscopy.

Returns:

True if the instrument has the information required to

apply noise to one-dimensional spectra, otherwise False.

Return type:

bool

property can_do_photometry

Return whether this instrument supports photometry.

Returns:

True if the instrument supports integrated photometry,

otherwise False.

Return type:

bool

property can_do_psf_imaging

Return whether this instrument supports PSF imaging.

Returns:

True if the instrument has the information required to

apply a PSF to images, otherwise False.

Return type:

bool

property can_do_psf_spectroscopy

Return whether this instrument supports PSF spectroscopy.

Returns:

True if the instrument has the information required to

apply a PSF in the resolved-spectroscopy case, otherwise False.

Return type:

bool

property can_do_resolved_spectroscopy

Return whether this instrument supports resolved spectroscopy.

Returns:

True if the instrument supports resolved spectroscopy,

otherwise False.

Return type:

bool

property can_do_spectroscopy

Return whether this instrument supports spectroscopy.

Returns:

True if the instrument supports one-dimensional

spectroscopy, otherwise False.

Return type:

bool

abstract property instrument_type

Return the serialised instrument type tag.

Returns:

Short string used when serialising and deserialising the

instrument.

Return type:

str

abstract classmethod load(*args, **kwargs)[source]

Load an instrument instance according to the class contract.

Returns:

A new instance of cls loaded from a persisted

representation. The exact accepted arguments depend on the specialised child class.

Return type:

InstrumentBase

abstract to_hdf5(group)[source]

Write the instrument to an HDF5 group.

Parameters:

group (h5py.Group) – Group into which the instrument should be serialised. Specialised child classes are responsible for writing their own observing-mode specific state into this group.