nanograv / enterprise

ENTERPRISE (Enhanced Numerical Toolbox Enabling a Robust PulsaR Inference SuitE) is a pulsar timing analysis code, aimed at noise analysis, gravitational-wave searches, and timing model analysis.
https://enterprise.readthedocs.io
MIT License
65 stars 67 forks source link

Inconsistency in definition of "components" in gp_priors and gp_signals #323

Open paulthebaker opened 2 years ago

paulthebaker commented 2 years ago

There has some confusion over the keyword argument components in gp_priors.powerlaw.

In gp_signals.FourierBasisGP, the keyword argument components refers to the number of frequency bins in the GP model. In the GP basis functions like gp_bases.createfourierdesignmatrix_red, this same number of frequency bins is called nmodes.

The name components is used extensively in enterprise_extensions to refer to the number of frequency bins, too.

In gp_priors.powerlaw the keyword components=2 refers to the number of sinusoidal components at each frequency bin. This should always be two, for a sine and a cosine. Other powerlaw-like prior functions, turnover and broken_powerlaw, don't take this keyword argument at all. These functions hard code to 2 in the appropriate places. In practice the default is never changed, as far as I know.

Thanks to @danielreardon for pointing this out!

Whoever makes changes related to this should add docstrings to the gp_priors functions, to explain what they do and when to use them!