continuum

This module’s scope are operations to calculate the continuum in a data cube.

Example:

>>> import tuna
>>> raw = tuna.io.read ( "tuna/test/unit/unit_io/adhoc.ad3" )
>>> continuum_detector = tuna.tools.continuum_detector ( raw = raw )
>>> continuum_detector.array [ 100 ] [ 100 ]
3.0
tuna.tools.continuum.continuum_detector(raw: tuna.io.can.can, continuum_to_FSR_ratio: float=0.25) → tuna.io.can.can[source]

This function’s goal is to conveniently return a Tuna can containing the continuum data for the given input.

Parameters:

  • raw : can

    Containing data from a spectrograph.

  • continuum_to_FSR_ratio : float

    Encoding the ratio below which values are to be ignored.

class tuna.tools.continuum.detector(can: tuna.io.can.can, continuum_to_FSR_ratio: float=0.25) → None[source]

This class is responsible for detecting the continuum at each pixel, for a given input data cube.

It inherits from the threading.Thread class, and it auto-starts its thread execution. Clients are expected to use its .join ( ) method before using its results.

Its constructor expects the following parameters:

  • can : can

    Containing data from a spectrograph.

  • continuum_to_FSR_ratio : float

    Encoding the ratio below which values are to be ignored.

run()[source]

Method required by threading, which allows parallel exection in a separate thread.

tuna.tools.continuum.median_of_lowest_channels(continuum_to_FSR_ratio=0.25, spectrum=<class 'numpy.ndarray'>)[source]

This function’s goal is to obtain the median of the three lowest channels of the input profile.

Parameters:

  • continuum_to_FSR_ratio : float : 0.25

    The ratio of signal that is expected to be part of the continuum.

  • spectrum : numpy.ndarray

    The spectral data.

tuna.tools.continuum.suppress_channel(replacement, array=<class 'numpy.ndarray'>, channels=<class 'list'>)[source]

This function creates a copy of the input array, substituting the input channels list with the channels from the input replacement.

Parameters:

  • replacement: numpy.ndarray

    Contains the signal where channels are going to be replaced from.

  • array : numpy.ndarray

    The data that is going to be copied, and the original data is from.

  • channels : list

    Lists the indexes of the channels to be substituted.