across.tools.core.schemas.bandpass

Classes

BaseBandpass

A base class for defining bandpass filters with a specified range.

WavelengthBandpass

A class representing a bandpass filter defined in terms of wavelength.

EnergyBandpass

A class representing a bandpass filter defined in terms of energy.

FrequencyBandpass

A class representing a bandpass filter defined in terms of frequency.

Functions

convert_to_wave(bandpass)

Converts a given EnergyBandpass or FrequencyBandpass to a WavelengthBandPass.

Module Contents

class BaseBandpass(/, **data)[source]

Bases: across.tools.core.schemas.base.BaseSchema

A base class for defining bandpass filters with a specified range.

filter_name[source]

The name of the filter, if provided.

Type:

str or None

min[source]

The minimum value of the bandpass range.

Type:

float or None

max[source]

The maximum value of the bandpass range.

Type:

float or None

filter_name: str | None = None[source]
min: float | None = None[source]
max: float | None = None[source]
class WavelengthBandpass(/, **data)[source]

Bases: BaseBandpass

A class representing a bandpass filter defined in terms of wavelength.

Inherits from BaseBandpass, this class specializes the filter to operate in the wavelength domain and provides additional functionality for wavelength-based filters.

type[source]

A constant string indicating the type of the bandpass filter.

Type:

Literal[‘WAVELENGTH’]

central_wavelength[source]

The central wavelength of the filter. It is defined as the midpoint between the min and max.

Type:

float or None

bandwidth[source]

The bandwidth of the filter. It is defined as half the difference between the max and min.

Type:

float or None

unit[source]

The unit of measurement for the wavelength.

Type:

WavelengthUnit

type: Literal['WAVELENGTH'] = 'WAVELENGTH'[source]
central_wavelength: float | None = None[source]
peak_wavelength: float | None = None[source]
bandwidth: float | None = None[source]
unit: across.tools.core.enums.WavelengthUnit[source]
model_post_init(__context)[source]

Validates the min and max values of the wavelength bandpass and calculates the central wavelength and bandwidth if they are not provided. Also ensures the values are positive and that the max wavelength is greater than the min wavelength. Lastly, it converts the units to angstroms.

Raises:

ValueError – If the min/max values are invalid or if the calculated values for central wavelength or bandwidth are non-positive.

class EnergyBandpass(/, **data)[source]

Bases: BaseBandpass

A class representing a bandpass filter defined in terms of energy.

Inherits from BaseBandpass, this class specializes the filter to operate in the energy domain.

type[source]

A constant string indicating the type of the bandpass filter.

Type:

Literal[‘ENERGY’]

unit[source]

The unit of measurement for the energy.

Type:

EnergyUnit

type: Literal['ENERGY'] = 'ENERGY'[source]
unit: across.tools.core.enums.EnergyUnit[source]
model_post_init(__context)[source]

Validates that the min and max energy values are positive.

Raises:

ValueError – If the min or max energy values are not defined, are non-positive, and max is greater than min.

class FrequencyBandpass(/, **data)[source]

Bases: BaseBandpass

A class representing a bandpass filter defined in terms of frequency.

Inherits from BaseBandpass, this class specializes the filter to operate in the frequency domain.

type[source]

A constant string indicating the type of the bandpass filter.

Type:

Literal[‘FREQUENCY’]

unit[source]

The unit of measurement for the frequency.

Type:

FrequencyUnit

type: Literal['FREQUENCY'] = 'FREQUENCY'[source]
unit: across.tools.core.enums.FrequencyUnit[source]
model_post_init(__context)[source]

Validates that the min and max frequency values are positive.

Raises:

ValueError – If the min or max energy values are not defined, are non-positive, and max is greater than min.

convert_to_wave(bandpass)[source]

Converts a given EnergyBandpass or FrequencyBandpass to a WavelengthBandPass.

Parameters:

bandpass (EnergyBandpass or FrequencyBandpass) – The bandpass filter in energy or frequency domain.

Returns:

The corresponding bandpass filter in the wavelength domain.

Return type:

WavelengthBandpass

Notes

When converting from Energy/Frequency to wavelength, the min/max values are inverted in relation to their corresponding wavelengths. Thus, the min/max values are switched during conversion.