Gateau User Manual
Atmospheric simulation of astronomical signals
cascade.py File Reference

Functionality concerned with setting the radiative transfer cascade. More...

Functions

np.ndarray gateau.cascade.johnson_nyquist_psd (np.ndarray f_src, float T)
 Johnson-Nyquist power spectral density. More...
 
tuple[np.ndarray, np.ndarray] gateau.cascade.window_trans (np.ndarray f_src, float thickness, float tandelta, float neff, bool window_AR, float T_parasitic_refl, float T_parasitic_refr)
 Calculates the window transmission. More...
 
np.ndarray gateau.cascade.eta_Al_ohmic (np.ndarray f_src)
 Calculate Ohmic losses for aluminium over array of sky frequencies. More...
 
np.ndarray gateau.cascade.sizer (Union[np.ndarray, float] eta, np.ndarray f_src, np.ndarray f_eta=None)
 Resize efficiency term to new size. More...
 
list[dict[any, any]] gateau.cascade.read_from_folder (str cascade_folder, str yaml_name)
 Generate a cascade list from a cascade folder. More...
 
None gateau.cascade.save_cascade (list[dict[any, any]] cascade_list, str save_folder, str yaml_name)
 
tuple[np.ndarray, np.ndarray] gateau.cascade.get_cascade (list[dict[str, any]] cascade_list, np.ndarray f_src)
 Calculate a cascade list, consisting of efficiency and psd per stage. More...
 

Variables

float gateau.cascade.TCMB = 2.725
 

Detailed Description

Functionality concerned with setting the radiative transfer cascade.

Function Documentation

◆ eta_Al_ohmic()

np.ndarray gateau.cascade.eta_Al_ohmic ( np.ndarray  f_src)

Calculate Ohmic losses for aluminium over array of sky frequencies.

Parameters
f_srcNumpy array containing source frequencies. Units: Hz
Returns
Array with eta values for Ohmic losses.

◆ get_cascade()

tuple[np.ndarray, np.ndarray] gateau.cascade.get_cascade ( list[dict[str, any]]  cascade_list,
np.ndarray  f_src 
)

Calculate a cascade list, consisting of efficiency and psd per stage.

Parameters
cascade_listList containing, per element, a dictionary containing the efficiency and coupling temperature of each stage in the cascade. For reflective stages, the dictionary should contain either:
  • A single eta and temperature. This requires the following fieldnames in the dictionary: 'eta_coup' (scalar) and 'T_parasitic' (scalar).
  • A tuple with efficiencies and frequencies at which these are defined, and a temperature. This requires the following fieldnames in the dictionary: 'eta_coup' (2-tuple with Numpy arrays) and 'T_parasitic' (scalar).

For refractive stages, the dictionary should contain:

  • Thickness of dielectric in meters, fieldname 'thickness'.
  • Loss tangent, fieldname 'tandelta'.
  • Effective refractive index, fieldname 'neff'.
  • Whether to use anti-reflective (AR) coating, fieldname 'Window_AR'.
  • Temperature seen in reflection coming from the antenna, fieldname 'T_parasitic_refl'.
  • Temperature seen in refraction, fieldname 'T_parasitic_refr'.

Aside from efficiencies and temperatures, each stage can have a name, set with fieldname 'name'. If multiple subsequent stages couple to the same temperature, they can also be grouped. The efficiencies will be precomposed and a total efficiency is calculated. Then, these multiple stages are merged into a single stage and treated as such. This significantly unburdens the CUDA calculation kernel and should hence be used. The fieldname for grouping is 'groupname'. Subsequent stages to be grouped together must have the same group name.

Parameters
f_srcArray with source frequencies. Units: GHz.
Returns
List with list of arrays containing efficiencies as first element, and list containing arrays of psd as second element.

◆ johnson_nyquist_psd()

np.ndarray gateau.cascade.johnson_nyquist_psd ( np.ndarray  f_src,
float  T 
)

Johnson-Nyquist power spectral density.

Parameters
f_srcSource frequencies. Units: Hz.
TTemperature. Units: K.
Returns
Power spectral density. Units: W / Hz.

◆ read_from_folder()

list[dict[any, any]] gateau.cascade.read_from_folder ( str  cascade_folder,
str   yaml_name 
)

Generate a cascade list from a cascade folder.

The folder should contain a YAML file containing the cascade list. Any vector-valued efficiency terms should be provided inside the folder as a CSV file, with the first column containing frequencies at which the terms are evaluated and the second column containing the terms themselves. Then, the CSV can be referenced inside the YAML by passing the CSV name (including .csv) to the eta_coup field inside the YAML.

Parameters
cascade_folderString containing path to folder containing cascade YAML and any related CSV files.
yaml_nameString containing the name of the YAML file containing the cascade.
Returns
List containing the cascade.

◆ sizer()

np.ndarray gateau.cascade.sizer ( Union[np.ndarray, float]  eta,
np.ndarray  f_src,
np.ndarray   f_eta = None 
)

Resize efficiency term to new size.

Used to vectorize or interpolate on efficiency terms.

If eta is a scalar, a constant eta array is returned with the same size as f_src.

If eta is an array with eta.size != f_src.size, an array containing frequencies at which eta is evaluated should also be passed. A 1D interpolation on f_src is then performed to evaluate eta on f_src.

If efficiency is array with same size as f_src, it is returned as-is.

Parameters
etaEfficiency term of some stage.
f_srcNumpy array containing source frequencies. Units: Hz.
f_etaNumpy array containing frequencies at which eta is evaluated. Units: Hz. Should only be passed when 1D interpolation is required in case eta.size != f_src.size. Defaults to None.
Returns
Array with eta values, depending on input (see above).

◆ window_trans()

tuple[np.ndarray, np.ndarray] gateau.cascade.window_trans ( np.ndarray  f_src,
float  thickness,
float  tandelta,
float  neff,
bool  window_AR,
float  T_parasitic_refl,
float  T_parasitic_refr 
)

Calculates the window transmission.

Parameters
f_srcSource frequencies. Units: Hz.
thicknessThickness of the window/lens. Units: m.
tandeltaLoss tangent of window/lens dielectric.
neffRefractive index of dielectric. Set to 1 to remove reflections. Units : None.
window_ARWhether the window is supposed to be coated by Ar (True) or not (False).
T_parasitic_reflTemperature of parasitic source seen in reflection, w.r.t. instrument.
T_parasitic_refrTemperature of parasitic source seen in refraction..
Returns
List containing list of arrays of efficiencies as first element, and list of arrays of psd's seen by each stage as second element.