Auxiliary functions#
- morse.auxil.co2in(Pco, m, nurot)#
Computes mode periods in the inertial frame of reference.
- Parameters:
Pco (np.array) – Mode periods in the co-rotating frame (in d).
m (int) – Azimuthal order.
nurot (float) – Rotation frequency (in c/d).
- Returns:
Mode periods in the inertial frame (in d).
- Return type:
np.array
- morse.auxil.generate_spectrum(periods, sigma, period_max, sampling_rate)#
Generates a spectrum by modelling each peak by a Gaussian function with a standard deviation of sigma.
- Parameters:
periods (np.array) – Mode periods.
sigma (float) – Standard deviation of Gaussian functions.
period_max (float) – Returned spectrum is computed up to this period.
sampling_rate (float) – Sampling rate of the return spectrum.
- Returns:
Artificially generated spectrum.
- Return type:
np.array
- morse.auxil.in2co(Pin, m, k, nurot, folded=False, ed=False)#
Computes mode periods in the co-rotating frame of reference.
- Parameters:
Pin (np.array) – Mode periods in the inertial frame (in d).
m (int) – Azimuthal order.
k (int) – Ordering index (Lee & Saio 97).
nurot (float) – Rotation frequency (in c/d).
folded (bool) – If True, it is assumed that the spectrum is folded in the inertial frame.
ed (bool) – If True, the method also returns the indices of elements in Pin that were not discarded in the change of reference frame. This is only used by the EchelleDiagram class.
- Returns:
Mode periods in the co-rotating frame (in d).
- Return type:
np.array
- morse.auxil.progress_bar(count, total, status='')#
Displays a progress bar in terminal.
- Parameters:
count (int) – Iteration number.
total (int) – Total number of iterations.
status (str) – Message to display next to the progress bar.
- morse.auxil.stretch(m, k, periods_co, eigenvalue, nurot)#
Stretches the mode periods.
- Parameters:
m (int) – Azimuthal order.
k (int) – Ordering index (Lee & Saio 97).
periods_co (np.array) – Mode periods in the co-rotating frame (in d).
eigenvalue (Eigenvalue) – Eigenvalue(m,k) of Laplace’s tidal equation.
nurot (float) – Rotation frequency (in c/d).
- Returns:
The stretched periods (in d).
- Return type:
np.array