signals#
- discovery.signals.makenoise_measurement_simple(psr, noisedict={}, add_equad=True, tnequad=False)[source]#
Single-EFAC (optionally single-EQUAD) white-noise model for a pulsar.
Builds a diagonal measurement-noise matrix using one
efacfor the whole pulsar. Whenadd_equadis True an EQUAD term is included:tnequad=Trueuses the TempoNest convention (EQUAD added outside the EFAC scaling), while the default (tnequad=False) uses the tempo2/t2equadconvention (EQUAD added in quadrature with the TOA errors, inside the EFAC scaling). Setadd_equad=Falsefor an EFAC-only model. If all required parameters are present innoisedicta constant matrix is returned, otherwise a variable one.
- discovery.signals.makenoise_measurement(psr, noisedict={}, scale=1.0, tnequad=False, ecorr=False, selection=<function selection_backend_flags>, vectorize=True, outliers=False, enterprise=False)[source]#
- discovery.signals.makegp_ecorr(psr, noisedict={}, enterprise=False, scale=1.0, selection=<function selection_backend_flags>, variable=False, name='ecorrGP')[source]#
- discovery.signals.makegp_improper(psr, fmat, constant=1e+40, name='improperGP', variable=False)[source]#
- discovery.signals.makegp_timing(psr, constant=None, variance=None, svd=False, scale=1.0, variable=False)[source]#
- discovery.signals.fourierbasis_dm(psr, components, T=None, fref=1400.0)[source]#
Fourier design matrix for a DM (dispersion measure) Gaussian process.
Identical to
fourierbasis(), but each row is scaled by the cold-plasma dispersion factor(fref / psr.freqs) ** 2, i.e. a fixed chromatic index alpha = 2. Usefourierbasis_chrom()when the chromatic index is a free parameter, in which case the process is general chromatic noise rather than DM.
- discovery.signals.fourierbasis_chrom(psr, components, T=None, fref=1400.0)[source]#
Fourier design matrix for a chromatic Gaussian process with variable index.
Returns a callable design-matrix factory
fmatfunc(alpha)that scales the achromaticfourierbasis()columns by(fref / psr.freqs) ** alpha, where the chromatic indexalphais a free parameter. Because alpha is not fixed to 2 the resulting process is general chromatic noise, not DM; usefourierbasis_dm()for the alpha = 2 (DM) case.
- discovery.signals.make_fourierbasis_dm(alpha=2.0, tndm=False)[source]#
Build a DM Fourier-basis function with a fixed chromatic index
alpha.Returns a
basis(psr, components, T, fref)callable whose columns are the achromaticfourierbasis()scaled by(fref / psr.freqs) ** alpha. Withtndm=Truethe tempo2/TempoNest DM normalisation is also applied. A genuine DM basis should keepalpha = 2; for a variable chromatic index usefourierbasis_chrom().
- discovery.signals.make_fourierbasis_chrom(alpha=4.0, tndm=False)[source]#
Build a chromatic Fourier-basis function with a fixed chromatic index
alpha.Thin wrapper around
make_fourierbasis_dm()with a defaultalpha = 4(a common scattering-like index). The returned basis scales the achromaticfourierbasis()columns by(fref / psr.freqs) ** alpha. Use this for a fixed-index chromatic process; for DM usemake_fourierbasis_dm()(alpha = 2).
- discovery.signals.makegp_fourier(psr, prior, components, T=None, mean=None, fourierbasis=<function fourierbasis>, common=[], exclude=['f', 'df'], name='fourierGP')[source]#
- discovery.signals.makecommongp_fourier(psrs, prior, components, T, fourierbasis=<function fourierbasis>, means=None, common=[], exclude=['f', 'df'], vector=False, name='fourierCommonGP', meansname='meanFourierCommonGP')[source]#
- discovery.signals.makegp_fourier_variance(psr, components, T=None, name='fourierGP', noisedict={})[source]#
- discovery.signals.makegp_fourier_allpsr(psrs, prior, components, T=None, fourierbasis=<function fourierbasis>, common=[], name='allpsrFourierGP')[source]#
- discovery.signals.makeglobalgp_fourier(psrs, priors, orfs, components, T, fourierbasis=<function fourierbasis>, means=None, common=[], exclude=['f', 'df'], name='fourierGlobalGP', meansname='meanFourierGlobalGP')[source]#
- discovery.signals.makegp_fourier_global(psrs, priors, orfs, components, T, fourierbasis=<function fourierbasis>, means=None, common=[], exclude=['f', 'df'], name='fourierGlobalGP', meansname='meanFourierGlobalGP')#
- discovery.signals.makegp_avgcov(psr, prior, epochavgbasis=<function epochavgbasis>, common=[], name='avgcovGP')[source]#
- discovery.signals.makecommongp_avgcov(psrs, prior, epochavgbasis=<function epochavgbasis>, common=[], vector=False, name='avgcovCommonGP')[source]#
- discovery.signals.makeglobalgp_avgcov(psrs, prior, epochavgbasis=<function epochavgbasis>, common=[], vector=False, name='avgcovCommonGP')[source]#
- discovery.signals.make_timeinterpbasis_dm(start_time=None, order=1, fref=1400.0)[source]#
Build a DM time-interpolation basis (fixed chromatic index alpha = 2).
Time-domain analogue of
make_fourierbasis_dm()used by the FFT-covariance GPs: it scales the achromaticmake_timeinterpbasis()basis by the cold-plasma dispersion factor(fref / psr.freqs) ** 2. Used bymakegp_fftcov_dm().
- discovery.signals.make_timeinterpbasis_chromatic(start_time=None, order=1, fref=1400.0)[source]#
Build a chromatic time-interpolation basis with a variable chromatic index.
Time-domain analogue of
fourierbasis_chrom()used by the FFT-covariance GPs. The returned basis yields a callableBmat_func(alpha)that scales the achromaticmake_timeinterpbasis()basis by(fref / psr.freqs) ** alpha, withalphaa free parameter. Used bymakegp_fftcov_chrom().
- discovery.signals.makegp_fftcov(psr, prior, components, T=None, t0=None, order=1, oversample=3, fmax_factor=1, cutoff=1, fourierbasis=None, common=[], name='fftcovGP')[source]#
- discovery.signals.makegp_fftcov_dm(psr, prior, components, T=None, t0=None, order=1, oversample=3, fmax_factor=1, cutoff=1, common=[], name='dm_gp', fref=1400.0)[source]#
FFT-covariance (time-domain) GP for DM noise (fixed chromatic index alpha = 2).
DM counterpart of
makegp_fftcov(): the achromatic time-interpolation basis is replaced bymake_timeinterpbasis_dm(), scaling each row by the cold-plasma dispersion factor(fref / psr.freqs) ** 2.prioris a power-spectral-density function (e.g.powerlaw()) that is converted to a time-domain covariance viapsd2cov(). For a free chromatic index usemakegp_fftcov_chrom().
- discovery.signals.makegp_fftcov_chrom(psr, prior, components, T=None, t0=None, order=1, oversample=3, fmax_factor=1, cutoff=1, common=[], name='chrom_gp', fref=1400.0)[source]#
FFT-covariance (time-domain) GP for chromatic noise with a variable index.
Chromatic counterpart of
makegp_fftcov(): the achromatic time-interpolation basis is replaced bymake_timeinterpbasis_chromatic(), scaling each row by(fref / psr.freqs) ** alphawith the chromatic indexalphaa free parameter.prioris a power-spectral-density function (e.g.powerlaw()) converted to a time-domain covariance viapsd2cov(). For the alpha = 2 (DM) case usemakegp_fftcov_dm().
- discovery.signals.makecommongp_fftcov(psrs, prior, components, T, t0=None, order=1, oversample=3, fmax_factor=1, cutoff=1, fourierbasis=None, common=[], vector=False, name='fftcovCommonGP')[source]#
- discovery.signals.makeglobalgp_fftcov(psrs, prior, orf, components, T, t0, order=1, oversample=3, fmax_factor=1, cutoff=1, fourierbasis=None, name='fftcovGlobalGP')[source]#
- discovery.signals.makegp_intcov(psr, prior, components, T=None, timeinterpbasis=<function timeinterpbasis>, common=[], name='intcovGP')[source]#
- discovery.signals.makecommongp_intcov(psr, prior, components, T, timeinterpbasis=<function timeinterpbasis>, common=[], name='intcovCommonGP')[source]#
- discovery.signals.makeglobalgp_intcov(psr, prior, orf, components, T, timeinterpbasis=<function timeinterpbasis>, common=[], name='intcovGlobalGP')[source]#
- discovery.signals.make_combined_crn(components, irn_psd, crn_psd, crn_prefix='crn_')[source]#
Combine an intrinsic red noise PSD and a common red noise PSD into a single PSD function that shares the same Fourier basis.
The intrinsic red noise PSD is evaluated over the full frequency basis, while the common red noise PSD is added only to the first
2 * componentsfrequency bins (sine and cosine for each component).- Parameters:
components (int) – Number of shared Fourier frequency components used by the CRN model. This determines how many low-frequency bins of the intrinsic basis receive the CRN contribution (specifically, the first
2 * componentsentries, corresponding to sine/cosine pairs). This is not the same as thecomponentsargument passed tomakegp_fourier— that controls the total number of Fourier components in the basis for the GP (and may be larger, since the intrinsic noise can extend to higher frequencies than the CRN).irn_psd (callable) – PSD function for the intrinsic red noise. Must accept
(f, df, ...)and return a PSD array over the full basis.crn_psd (callable) – PSD function for the common red noise. Must accept
(f, df, ...)and return a PSD array. Will only be called on the first2 * componentsfrequency bins.crn_prefix (str or None) – Prefix applied to CRN parameter names that overlap with IRN names. For example, if both PSDs have
log10_Aandcrn_prefix='crn_', the combined function will havelog10_A(IRN) andcrn_log10_A(CRN) as separate parameters. If None, overlapping names are shared (both PSDs receive the same value), which is valid when you intentionally want tied parameters.
- Returns:
combined (callable) – A PSD function whose signature is the union of
irn_psdandcrn_psdsignatures (with CRN overlaps prefixed). Compatible withmakegp_fourier: argument names are inspectable viagetfullargspec, andtyping.Sequenceannotations are preserved for parameter expansion.crn_params (list of str) – The parameter names (as they appear in
combined’s signature) that belong to the CRN PSD. Pass these directly as thecommonargument tomakegp_fourierormakecommongp_fourierso that the CRN parameters are shared across pulsars rather than given per-pulsar names.Example:
combined, crn_params = make_combined_crn(14, ds.powerlaw, ds.powerlaw) gp = makegp_fourier(psr, combined, components=30, common=crn_params)
- discovery.signals.powerlaw_brokencrn(f, df, log10_A, gamma, crn_log10_A, crn_gamma, crn_log10_fb)[source]#
- discovery.signals.brokenpowerlaw_brokencrn(f, df, log10_A, gamma, log10_fb, crn_log10_A, crn_gamma, crn_log10_fb)[source]#