Skip to content

Commit

Permalink
M1M3 ICS: Allow empty torqueless regions
Browse files Browse the repository at this point in the history
  • Loading branch information
b1quint authored and mfisherlevine committed Jan 23, 2024
1 parent b5e106e commit 68c0271
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions python/lsst/summit/utils/m1m3/inertia_compensation_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,17 @@ def find_stable_region(self) -> tuple[Time, Time]:
np.abs(el_torque - el_torque.mean()) < self.n_sigma * el_torque.std()
)

stable_begin = max([reg[0] for reg in az_torque_regions + el_torque_regions])
stable_begin = Time(stable_begin, scale="utc")

stable_end = min([reg[-1] for reg in az_torque_regions + el_torque_regions])
stable_end = Time(stable_end, scale="utc")
if az_torque_regions and el_torque_regions:
stable_begin = max([reg[0] for reg in az_torque_regions + el_torque_regions])
stable_begin = Time(stable_begin, scale="utc")

stable_end = min([reg[-1] for reg in az_torque_regions + el_torque_regions])
stable_end = Time(stable_end, scale="utc")
else:
self.log.warning("No stable region found. Using full slew.")
stable_begin = self.event.begin
stable_end = self.event.end

Check failure on line 115 in python/lsst/summit/utils/m1m3/inertia_compensation_system.py

View workflow job for this annotation

GitHub Actions / call-workflow / lint

W293

blank line contains whitespace
return stable_begin, stable_end

def query_dataset(self) -> pd.DataFrame:
Expand Down

0 comments on commit 68c0271

Please sign in to comment.