Fold(ih, n_phase, phase, step=None, *, start=0, average=True, samples_per_frame=1, dtype=None)¶
Fold pulse profiles in fixed time intervals.
- ihtask or
Input data stream, with time as the first axis.
Number of bins per pulse period.
Should return pulse phases (with or without cycle count) for given input time(s), passed in as an ‘~astropy.time.Time’ object. The output can be an
Quantitywith angular units or a regular array of float (in which case units of cycles are assumed).
- stepint or
Number of input samples or time interval over which to fold. If not given, the whole file will be folded into a single profile.
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 pulse profile 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 sample times to process in one go. This can be used to optimize the process, though in general the default of 1 should work.
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
to integrate over pulse phase and create pulse stacks
If there are only few input samples per phase bin (i.e., its inverse sample rate is similar to the time per phase bin), then it is important to ensure the
samples_per_frameof the underlying stream is not small (larger than, say, 20), to avoid a large overhead in calculating phases.
Since the sample time is not necessarily an integer multiple of the pulse period, the returned profiles will generally not contain the same number of samples in each phase bin. 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