Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to AzimuthIntervals #800

Merged
merged 15 commits into from
Nov 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Improvements to AzimuthIntervals
Attempt to better handle azimuth data that is flagged
and data when the telescope is not scanning.
tskisner committed Nov 20, 2024
commit 9455dcc358c72a1e36e0f05497dbd68cff3d11c1
21 changes: 12 additions & 9 deletions src/toast/intervals.py
Original file line number Diff line number Diff line change
@@ -69,15 +69,18 @@ def __init__(self, timestamps, intervals=None, timespans=None, samplespans=None)
raise RuntimeError(
"If constructing from intervals, other spans should be None"
)
timespans = [(x.start, x.stop) for x in intervals]
indices = self._find_indices(timespans)
self.data = np.array(
[
(self.timestamps[x[0]], self.timestamps[x[1]], x[0], x[1])
for x in indices
],
dtype=interval_dtype,
).view(np.recarray)
if len(intervals) == 0:
self.data = np.zeros(0, dtype=interval_dtype).view(np.recarray)
else:
timespans = [(x.start, x.stop) for x in intervals]
indices = self._find_indices(timespans)
self.data = np.array(
[
(self.timestamps[x[0]], self.timestamps[x[1]], x[0], x[1])
for x in indices
],
dtype=interval_dtype,
).view(np.recarray)
elif timespans is not None:
if samplespans is not None:
raise RuntimeError("Cannot construct from both time and sample spans")
Loading