Periodograms¶
Generalized Lomb-Scargle¶
- class OPEN.periodograms.gls(rv, ofac=6, hifac=1, freq=None, quantity='vrad', norm='HorneBaliunas', stats=False, ext=True)¶
Compute the Generalized Lomb-Scargle (GLS) periodogram.
This class implements the error-weighted Lomb-Scargle periodogram as developed by [ZK09] using various possible normalizations.
The constructor takes a RVSeries instance (i.e. a rv curve) as first argument. As the algorithm is slow-ish, an implementation in Fortran is available if the keyword ‘ext’ is set to True in the constructor or globally. There is an optional freq array, that can contain the frequencies on which to calculate the periodogram. If not provided (....)
- Parameters
- rv : RVSeries
- The radial velocity curve or any object providing the attributes time, vrad and error which define the data.
- ofac : int
- Oversampling factor (default=6).
- hifac : float
- hifac * “average” Nyquist frequency is highest frequency for which the periodogram will be calculated (default=1).
- freq : array, optional
- Contains the frequencies at which to calculate the periodogram. If not given, a frequency array will be automatically generated.
- quantity : string, optional
- For which quantity to calculate the periodogram. Possibilities are ‘bis’ or ‘fwhm’ other than the default ‘vrad’.
- norm : string, optional
- The normalization; either “Scargle”, “HorneBaliunas”, or “Cumming”. Default is “HorneBaliunas”.
- stats : boolean, optional
- Set True to obtain some statistical output (default is False).
- ext : boolean, optional
- Use Fortran extension in the calculation (default is True)
- Attributes
- power : array
- The normalized power of the GLS.
- freq : array
- The frequency array.
- ofac : int
- The oversampling factor.
- hifac : float
- The maximum frequency.
- norm : string
- The normalization used.
- prob(Pn)¶
Probability of obtaining the given power.
Calculate the probability to obtain a power higher than Pn from the noise, which is assumed to be Gaussian.
Note
This depends on the normalization (see [ZK09] for further details).
- Scargle:
\[exp(-Pn)\]- HorneBaliunas:
\[\left(1 - 2 \times \frac{Pn}{N-1} \right)^{(N-3)/2}\]- Cumming:
\[\left(1+2\times \frac{Pn}{N-3}\right)^{-(N-3)/2}\]- Parameters
- Pn : float
- Power threshold.
- Returns
- Probability : float
- The probability to obtain a power equal or higher than the threshold from the noise.
- probInv(Prob)¶
Calculate minimum power for a given probability.
This function is the inverse of Prob(Pn). Returns the minimum power for a given probability threshold Prob.
- Parameters
- Prob : float
- Probability threshold.
- Returns
- Power threshold : float
- The minimum power for the given false-alarm probability threshold.
Bayesian Lomb-Scargle¶
- class OPEN.periodograms.bls(rv, ofac=6, hifac=40, freq=None, quantity='vrad', stats=False)¶
Compute the Bayesian Lomb-Scargle (BLS) periodogram.
This class implements the bayesian Lomb-Scargle periodogram as developed by Bretthorst (2000, 2001). This corresponds to the bayesian expression for the posterior p(f|D,I).
The constructor takes a RVSeries instance (i.e. a rv curve) as first argument. The algorithm is slow due to the required frequency resolution; currently, only a Fortran implementation is available. There is an optional freq array, that can contain the frequencies on which to calculate the periodogram. If not provided (....)
- Parameters
- rv : RVSeries
- The radial velocity curve or any object providing the attributes time, vrad and error which define the data.
- ofac : int
- Oversampling factor (default=6).
- hifac : float
- hifac * “average” Nyquist frequency is highest frequency for which the periodogram will be calculated (default=40).
- freq : array, optional
- Contains the frequencies at which to calculate the periodogram. If not given, a frequency array will be automatically generated.
- quantity : string, optional
- For which quantity to calculate the periodogram. Possibilities are ‘bis’ or ‘fwhm’ other than the default ‘vrad’.
- stats : boolean, optional
- Set True to obtain some statistical output (default is False).
- Attributes
- power : array
- The normalized power of the GLS.
- freq : array
- The frequency array.
- prob(Pn)¶
Probability of obtaining the given power.
Calculate the probability to obtain a power higher than Pn from the noise, which is assumed to be Gaussian.
Note
Normalization (see [ZK09] for further details).
- Scargle:
\[exp(-Pn)\]- HorneBaliunas:
\[\left(1 - 2 \times \frac{Pn}{N-1} \right)^{(N-3)/2}\]- Cumming:
\[\left(1+2\times \frac{Pn}{N-3}\right)^{-(N-3)/2}\]- Parameters
- Pn : float
- Power threshold.
- Returns
- Probability : float
- The probability to obtain a power equal or higher than the threshold from the noise.
- probInv(Prob)¶
Calculate minimum power for given probability.
This function is the inverse of Prob(Pn). Returns the minimum power for a given probability threshold Prob.
- Parameters
- Prob : float
- Probability threshold.
- Returns
- Power threshold : float
- The minimum power for the given false-alarm probability threshold.


wrap around
`Prev `__
W
`Next `__
--------------
**wrap around**: vi.
(also n. wraparound and v. shorthand wrap)
1. [techspeak] The action of a counter that starts over at zero or at
minus infinity (see `*infinity* <../I/infinity.html>`__) after its
maximum value has been reached, and continues incrementing, either
because it is programmed to do so or because of an overflow (as when a
car's odometer starts over at 0).
2. To change `*phase* <../P/phase.html>`__ gradually and continuously by
maintaining a steady wake-sleep cycle somewhat longer than 24 hours,
e.g., living six long (28-hour) days in a week (or, equivalently,
sleeping at the rate of 10 microhertz). This sense is also called
`*phase-wrapping* <../P/phase-wrapping.html>`__.
--------------
+------------------------------------------+----------------------------+------------------------------------+
| `Prev `__ | `Up <../W.html>`__ | `Next `__ |
+------------------------------------------+----------------------------+------------------------------------+
| wound around the axle | `Home <../index.html>`__ | write-only code |
+------------------------------------------+----------------------------+------------------------------------+