panoptes.pipeline.lightcurve.metrics¶
panoptes.pipeline.lightcurve.metrics ¶
Photometric precision metrics.
Nothing in improvement plan 3 can be called an improvement without a number attached, and "standard deviation of the lightcurve" is not a sufficient number: correlated (red) noise is what actually limits transit detection, and it does not average down. These are the metrics every change gets scored on.
PrecisionReport
dataclass
¶
Scorecard for one lightcurve. Compare these across algorithm variants.
Source code in src/panoptes/pipeline/lightcurve/metrics.py
floor_ratio
property
¶
Unbinned RMS as a multiple of the photon noise floor. Lower is better.
rms ¶
Fractional RMS scatter about the median, ignoring NaNs.
Source code in src/panoptes/pipeline/lightcurve/metrics.py
bin_flux ¶
bin_flux(times: ndarray, flux: ndarray, bin_minutes: float) -> tuple[np.ndarray, np.ndarray, np.ndarray]
Bin a lightcurve into fixed-width time bins.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
times
|
ndarray
|
|
required |
flux
|
ndarray
|
|
required |
bin_minutes
|
float
|
Bin width. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
|
ndarray
|
dropped. |
Source code in src/panoptes/pipeline/lightcurve/metrics.py
precision_curve ¶
precision_curve(times: ndarray, flux: ndarray, bin_minutes: tuple[float, ...] = DEFAULT_BIN_MINUTES) -> dict[float, float]
RMS as a function of bin size -- the headline diagnostic for this work.
Pure white noise falls as 1/sqrt(N). Departure from that line is the
red noise that limits transit detection, and closing that gap is what
improvement plan 3 is for.
Source code in src/panoptes/pipeline/lightcurve/metrics.py
beta_factor ¶
Red-noise factor beta, following Pont, Zucker & Queloz (2006).
beta = sigma_binned / sigma_expected, where sigma_expected is what
pure white noise would give after binning. beta == 1 means no
correlated noise; the paper's own result implies beta close to 1 at
30 min, so any change that pushes it above 1 is a regression even if the
unbinned RMS improves.
Source code in src/panoptes/pipeline/lightcurve/metrics.py
photon_noise_floor ¶
photon_noise_floor(total_counts_adu: ndarray | float, gain_e_per_adu: float, read_noise_e: float, background_counts_adu: ndarray | float = 0.0, num_pixels: int = 1) -> float
Fractional noise floor from source photons, sky and read noise.
Every precision claim should be quoted as a multiple of this floor rather than in isolation -- the paper's stated goal is to approach it.
Gain and read noise are required, with no default. The PANOPTES fleet runs many different DSLR bodies with different gain, black level and white level, so a fleet-wide default here would silently produce a wrong floor for every camera but one, and the floor is what decides whether 0.5% is reachable at all (improvement plan 1.4). Get them from the camera profile for the observation, not from a constant.
Source code in src/panoptes/pipeline/lightcurve/metrics.py
report ¶
report(times: ndarray, flux: ndarray, num_active_references: int | None = None, noise_floor: float | None = None, bin_minutes: tuple[float, ...] = DEFAULT_BIN_MINUTES) -> PrecisionReport
Build a :class:PrecisionReport for one lightcurve.
Source code in src/panoptes/pipeline/lightcurve/metrics.py
to_seconds ¶
Coerce times to float seconds measured from the first sample.
Accepts datetime64 arrays, float arrays, and object arrays of anything
with a timestamp() method -- which covers the timezone-aware
pandas.Timestamp values that come out of observation.h5.