litmus_rm.lightcurve
lightcurve.py
A handy object clas for lightcurves
HM 2024
T = np.linspace(0, 4 * np.pi, 128)
module-attribute
Y = np.sin(T) * np.sqrt(2)
module-attribute
E = np.random.poisson(100, size=(len(T))) / 100 * 1
module-attribute
lc = lightcurve(T, Y + np.random.randn(len(T)) * E, abs(E))
module-attribute
lc_calib = lc.normalize()
module-attribute
lc_uncalib = lc_calib.unnormalize()
module-attribute
lightcurve(T, Y, E=None)
Bases: object
A wrapper class for lightcurves. Construct /w array-like inputs for time, signal and error (optional) like: lightcurve(T, Y, E) or: lightcurve(T, Y) Which yields E=0 for all {T,Y}
Supports array-like addition and float-like addition / multiplication
Source code in src/litmus_rm/lightcurve.py
T = np.array(T, dtype=(np.float64))
instance-attribute
Y = np.array(Y, dtype=(np.float64))
instance-attribute
E = np.zeros_like(T)
instance-attribute
normalized = False
instance-attribute
keys() -> tuple[str, str, str]
values() -> tuple[_types.ArrayN, _types.ArrayN, _types.ArrayN]
Returns the lightcurves' value series' in the order of keys
normalize() -> _types.Self
Esimates the mean and amplitude of the lighturve assuming uncorrelated measurements Returns a lightcurve object with this normalization
Source code in src/litmus_rm/lightcurve.py
unnormalize() -> _types.Self
Reverses the effects of lightcurve.normalize(). Returns a lightcurve object with mean and amplitude prior to normalize()
Source code in src/litmus_rm/lightcurve.py
delayed_copy(lag=0.0, Tmin=None, Tmax=None) -> _types.Self
Returns a copy subsampled to only datapoints in the domain T in [Tmin,Tmax] and offset by lag
Source code in src/litmus_rm/lightcurve.py
trimmed_copy(Tmin=None, Tmax=None) -> _types.Self
Returns a copy subsampled to only datapoints in the domain T in [Tmin,Tmax]
concatenate(other)
plot(axis=None, show=True, **kwargs) -> None
Plots an errorbar series to a matplotlib axis. If show=True, will plt.show() after plotting. If axis is None, will create a new figure. Pass in any plotting kwargs for plt.errorbar at **kwargs
Source code in src/litmus_rm/lightcurve.py
lightcurve_iter(base_lc: lightcurve, r: float = np.exp(-1), Evary: bool = True)
Bases: lightcurve
An extension of the lightcurve class that support bootstrapping. Call like lightcurve_iter(base_lightcurve, r, Evary)
Where 'r' is the subsampling fraction (default 1/e per bootstrapping) Evary is a sign to indicate whether we want to also vary measurements within errorbars
Source code in src/litmus_rm/lightcurve.py
r = r
instance-attribute
Evary = Evary
instance-attribute
subsample() -> None
Subsamples and (if self.Evary==True) shimmies the Y values within measurement uncertainty Updates self values