The synthetic module#
This submodule has been designed to provide tool to create synthetic PSD.
- apollinaire.synthetic.create_synthetic_psd(freq, pkb=None, splittings=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.
pkb (ndarray) – The
pkbarray with the mode parameters.splittings – Either a multi-level dictionary or a 3d-array. If it is a dictionary,
d[n][l][m]provides the splitting corresponding to the m-component of the mode of degreeland ordern. If it is an array, the first dimension must matchpkb.shape[0], the second dimension beint (pkb[:,1].max())(that is the maximum specified angular degreel,lmax), and the third dimension,2*lmax+1. If provided, splittings informations included in thepkbarray will be ignored when generating the spectrum.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
backisNone. 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