ztforce.lightcurve

Lightcurve: per-epoch storage, stacking, and I/O.

Attributes

_BAND_ORDER

SNT

Classes

Lightcurve

Per-source forced-photometry lightcurve in absolute AB magnitudes.

Module Contents

_BAND_ORDER = ['g', 'r', 'i'][source]
SNT = 3.0[source]
class Lightcurve(ra: float, dec: float)[source]

Per-source forced-photometry lightcurve in absolute AB magnitudes.

ra[source]
dec[source]
_rows: list[dict] = [][source]
cache_key: str = ''[source]
add_epoch(obsjd: float, band: str, flux: float, flux_err: float, mag: float, mag_err: float, zero_point: float, flags: int, x_fit: float | None = None, y_fit: float | None = None, mag_limit: float | None = None, image_id: str | None = None) None[source]

Append one exposure’s measurement.

property df: pandas.DataFrame[source]

All epochs as a DataFrame, sorted by obsjd.

property bands: list[str][source]

Unique bands present, in canonical g/r/i order.

get_band(band: str) pandas.DataFrame[source]

Return epochs for a single band, sorted by obsjd.

stack(jd_min: float | None = None, jd_max: float | None = None, bands: list[str] | None = None) pandas.DataFrame[source]

Inverse-variance-weighted stack of detections within a JD window.

Returns a DataFrame indexed by band with columns:

flux_stack, flux_err_stack, mag_stack, mag_err_stack, n_epochs.

rolling_stack(window: float, window_unit: str = 'days', bands: list[str] | None = None, step: float | None = None) pandas.DataFrame[source]

Rolling IVW stack in a sliding window.

Returns a long-format DataFrame with columns:

obsjd_center, band, flux_stack, flux_err_stack, mag_stack, mag_err_stack, n_epochs.

save(path: str | pathlib.Path) None[source]

Save to an Astropy ECSV file preserving all columns and metadata.

classmethod load(path: str | pathlib.Path) Lightcurve[source]

Load from an Astropy ECSV file saved by save().

__len__() int[source]

Number of epochs.

__repr__() str[source]

Short representation.