exorad.models.signal module

class CountsPerSeconds(wl_grid, data, time_grid=<Quantity [0.] h>)[source]

Bases: CustomSignal

It’s a Signal class with data having units of [ct/s]

class constructor

Parameters:
  • wl_grid (quantity) – wavelength grid. Must have a single axes

  • data (array) – data table. Can have 2 axes

  • time_grid (quantity (optional)) – time grid. Must have a single axes

class CustomSignal(wl_grid, data, data_unit, time_grid=<Quantity [0.] h>)[source]

Bases: Signal

It’s a Signal class with data having units custom units

class constructor

Parameters:
  • wl_grid (quantity) – wavelength grid. Must have a single axes

  • data (array) – data table. Can have 2 axes

  • time_grid (quantity (optional)) – time grid. Must have a single axes

class Radiance(wl_grid, data, time_grid=<Quantity [0.] h>)[source]

Bases: CustomSignal

It’s a Signal class with data having units of [W m^-2 mu^-1 sr^-1]

class constructor

Parameters:
  • wl_grid (quantity) – wavelength grid. Must have a single axes

  • data (array) – data table. Can have 2 axes

  • time_grid (quantity (optional)) – time grid. Must have a single axes

class Sed(wl_grid, data, time_grid=<Quantity [0.] h>)[source]

Bases: CustomSignal

It’s a Signal class with data having units of [W m^-2 mu^-1]

class constructor

Parameters:
  • wl_grid (quantity) – wavelength grid. Must have a single axes

  • data (array) – data table. Can have 2 axes

  • time_grid (quantity (optional)) – time grid. Must have a single axes

class Signal(wl_grid, data, time_grid=<Quantity [0.] h>)[source]

Bases: Logger

Signal class is the main class for every wavelength and time dependent object. By default it assume wavelength in um, data dimensionless and time in hours.

Parameters:
  • wl_grid (quantity) – wavelength grid. Must have a single axes

  • data (array) – data table. Can have 2 axes

  • time_grid (quantity (optional)) – time grid. Must have a single axes

Variables:
  • wl_grid (quantity(um)) – wavelength grid. Must have a single axes

  • data (quantity(dimensionless)) – data table. Can have 2 axes

  • time_grid (quantity(hr)) – time grid. Must have a single axes

  • time_dependent (bool) – it tells if the signal is time dependent (True) or not (False)

Examples

>>> import numpy as np
>>> wl = np.linspace(0.1,1, 10)*u.um
>>> data = np.random.random_sample((10,10))
>>> time = np.linspace(1,5, 10)*u.hr
>>> signal = Signal(wl_grid=wl, data=data, time_grid=time)

class constructor

Parameters:
  • wl_grid (quantity) – wavelength grid. Must have a single axes

  • data (array) – data table. Can have 2 axes

  • time_grid (quantity (optional)) – time grid. Must have a single axes

check_quantities(quantity, units)[source]

It assures that the input data has the desired units, if not it converts the data. If the data are dimensionless it assumes that are reported with the correct units.

Parameters:
  • quantity (quantity)

  • units (units or string)

Return type:

quantity

Raises:

UnitConversionError – if it cannot convert the original units into the desired ones

check_sizes()[source]

Assures that the class attributes (wl_grid, data and time_grid) have the correct dimensions

Raises:

ValueError – if there is a dimension mismatch

plot(fig=None, ax=None, yscale=None, xscale=None, label=None)[source]

plots the signal and return figure and axis or add the plot to an existing figure and axis

spectral_rebin(new_wl_grid)[source]

rebins the signal to the new wavelength grid

temporal_rebin(new_time_grid)[source]

rebins the signal to the new time grid

property time_dependent

It tells if the Signal is time dependent :returns: True if Signal is time dependent. :rtype: bool

to_dict()[source]

Converts the Signal class into standard python dict.