Integrate(ih, step=None, phase=None, *, start=0, average=True, samples_per_frame=1, dtype=None)¶
Integrate a stream stepwise.
- ihtask or
Input data stream, with time as the first axis.
- stepint or
Interval over which to integrate. For time invervals, should have units of time. For phase intervals, units should be consistent with what the
phasecallable returns. If no
phasecallable is passed in, then if step is integer, it is taken to be a number of samples in the underlying stream that should be integrated over, and if step is omitted, integration is over all samples.
Should return full pulse phase (i.e., including cycle count) for given input times (passed in as ‘~astropy.time.Time’). The output should be compatible with
step, i.e., generally an
Quantitywith angular units.
Timeor int, optional
Time or offset at which to start the integration. If an offset or if
stepis integer, the actual start time will the underlying sample time nearest to the requested one. Default: 0 (start of stream).
- averagebool, optional
Whether the output should be the average of all entries that contributed to it, or rather the sum, in a structured array that holds both
- samples_per_frameint, optional
Number of samples to process in one go. This can be used to optimize the process. With many samples per bin, the default of 1 should be OK.
Output dtype. Generally, the default of the dtype of the underlying stream is good enough, but can be used to increase precision. Note that if
average=True, it is the user’s responsibilty to pass in a structured dtype.
- ihtask or
If there are not many samples per bin, either set
samples_per_frameto a larger number or ensure that
samples_per_frameof the underlying stream is not small (larger than, say, 20). If both are small, there will be a relatively large overhead in calculating phases.
Since time or phase bins are typically not an integer multiple of the underlying bin spacing, the integrated samples will generally not contain the same number of samples. The actual number of samples is counted, and for
average=True, the sums have been divided by these counts, with bins with no points set to
average=False, the arrays returned by
readare structured arrays with
Start time of the output, left edge of the first sample.
Time at the end of the output, just after the last sample.