The synthetic module#
This submodule has been designed to provide tool to create synthetic PSD.
- apollinaire.synthetic.create_synthetic_psd(freq, pkb=None, back=None, param_back=None, n_harvey=2, wdw=None, feature=None, instr='geometric', asym_profile='nigam-kosovichev', use_sinc=False, entropy=None, noise_free=False, fit_amp=False)#
Create a synthetic psd vector from a frequency vector, modes parameters from a pkb arrays and, optionnally, a background profile.
- Parameters:
freq (ndarray) – input frequency vector on which to compute the synthetic PSD vector.
back (ndarray) – stellar background array, of same length as
freq
. Optional, defaultNone
.param_back (ndarray) – stellar background parameters used to build the background vector. Will be used only if
back
isNone
. Optional, defaultNone
.n_harvey (int) – number of Harvey law of the background profile. Optional, default
2
.wdw (array) – observation window to use to convolute the modes profile in the model.
feature (ndarray) – array of same length as
freq
, to be used to add any additionnal feature to the spectrum. This array will be summed to the model array before adding the chi2 noise. Optional, defaultNone
.instr (str) – instrument to consider to compute m-height ratios. Possible argument :
geometric
,kepler
,golf
,virgo
. Optional, defaultgeometric
.use_sinc (bool) – if set to
True
, mode profiles will be computed using cardinal sinus and not Lorentzians. No asymmetry term will be used if it is the case. Optional, defaultFalse
.asym_profile (str) – depending on the chosen argument, asymmetric profiles will be computed following Korzennik 2005 (
korzennik
) or Nigam & Kosovichev 1998 (nigam-kosovichev
). Defaultnigam-kosovichev
.entropy (int) – entropy value to seed the random generator.
noise_free (bool) – if set to
True
, the function will return only an ideal model without added noise. Optional, defaultFalse
.
- Returns:
the synthetic PSD vector and the entropy value (for reproductibility) as a tuple.
- Return type:
tuple