phoptic.timing.timeseries
Functions
|
Given a table of light curves, extract the light curve for a single key. |
|
Split a time series into a list of contiguous time series. Similar to stingray's split_by_gti() method. |
|
Split a time series into equal length, contiguous segments. |
|
Get the number of time series rows per segment. |
|
Infer the Good Time Intervals from a time array. |
|
Check if a time array is uniformly sampled. |
|
Segment arrays into uniform segments. |
Module Contents
- phoptic.timing.timeseries.get_lc(light_curves, key)
Given a table of light curves, extract the light curve for a single key.
Parameters
- light_curvesTimeSeries
The table of light curves.
- keystr
The camera:filter key (e.g., “1:g” for camera 1 with a g filter).
Returns
- TimeSeries
The light curve for the filter.
- Parameters:
light_curves (astropy.timeseries.TimeSeries)
key (str)
- Return type:
astropy.timeseries.TimeSeries
- phoptic.timing.timeseries.split_timeseries_on_gaps(ts, threshold=1.5)
Split a time series into a list of contiguous time series. Similar to stingray’s split_by_gti() method.
Parameters
- tsTimeSeries
The time series, assumed to contain gaps.
- thresholdfloat, optional
The gap detection threshold, by default 1.5 times the median time delta.
Returns
- list[TimeSeries]
The list of strictly contiguous time series.
- Parameters:
ts (astropy.timeseries.TimeSeries)
threshold (float)
- Return type:
list[astropy.timeseries.TimeSeries]
- phoptic.timing.timeseries.segment_timeseries(ts, segment_size)
Split a time series into equal length, contiguous segments.
Parameters
- tsTimeSeries
The time series.
- segment_sizeQuantity
The segment size.
Returns
- list[TimeSeries]
The time series segments.
Raises
- ValueError
If no valid segments could be found.
- Parameters:
ts (astropy.timeseries.TimeSeries)
segment_size (astropy.units.Quantity)
- Return type:
list[astropy.timeseries.TimeSeries]
- phoptic.timing.timeseries.get_segment_size(dt, segment_size)
Get the number of time series rows per segment.
Parameters
- dtfloat
The nominal time resolution of the time series in days.
- segment_sizeQuantity
The segment size.
Returns
- int
The number of rows per segment.
- Parameters:
dt (float)
segment_size (astropy.units.Quantity)
- Return type:
int
- phoptic.timing.timeseries.infer_gtis(time, threshold=1.5)
Infer the Good Time Intervals from a time array.
Parameters
- timeNDArray | Time | Quantity
The time array. If this array has units, the resulting GTIs will have the same units.
- thresholdfloat, optional
The gap detection threshold, by default 1.5 times the minimum time delta.
Returns
- NDArray
The inferred GTIs.
- Parameters:
time (numpy.typing.NDArray | astropy.time.Time | astropy.units.Quantity)
threshold (float)
- Return type:
numpy.typing.NDArray
- phoptic.timing.timeseries.uniformly_sampled(time, dt, raise_error=False)
Check if a time array is uniformly sampled.
Parameters
- timeNDArray
The time array (assumed to be in units of seconds).
- dtfloat
The nominal time resolution (assumed to be in units of seconds).
- raise_errorbool, optional
Whether to raise an error if the time array is not uniformly sampled, by default False.
Returns
- np.bool
Whether the time array is uniformly sampled.
Raises
- ValueError
If the time array is not uniformly sampled and raise_error=True.
- Parameters:
time (numpy.typing.NDArray)
dt (float)
raise_error (bool)
- Return type:
numpy.bool
- phoptic.timing.timeseries.segment_arr(t, y, segment_size, y2=None, tolerance=1.5)
Segment arrays into uniform segments.
Parameters
- tNDArray
The time array (in units of seconds).
- yNDArray
The signal array.
- segment_sizefloat
The desired time-span of the resulting segments.
Returns
- list[tuple[NDArray, NDArray]]
The segmented arrays [(t_segment_0, y_segment_0), (t_segment_1, y_segment_1), etc.]
- Parameters:
t (numpy.typing.NDArray)
y (numpy.typing.NDArray)
segment_size (float)
y2 (numpy.typing.NDArray | None)
tolerance (float)
- Return type:
list[tuple]