Skip to content

Commit

Permalink
In m1m3/inertia_compensation_system.py wrap up function to evaluate s…
Browse files Browse the repository at this point in the history
…ingle slew
  • Loading branch information
b1quint committed Sep 13, 2023
1 parent 6445b42 commit a26a970
Showing 1 changed file with 29 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def get_avgmedstd_from_series(s):
return result


def get_tma_slew_event():
def get_tma_slew_event(day_obs, seq_number):
"""
Retrieve Telescope Mount Assembly (TMA) slew events within a specified time
range.
Expand All @@ -111,35 +111,18 @@ def get_tma_slew_event():
the specified day of observation (dayObs). The events are filtered to
include only those that start after 1 second before the specified start time
and end before 1 second after the specified end time.
Example
-------
>>>
>>>
>>>
"""
events = event_maker.getEvents(day_obs_begin)

assert len(events) == 1
return events[0]


def evaluate_single_slew(day_obs, seq_number):
"""
Evaluates the M1M3 Inertia Compensation System in a single slew with a
`seqNumber` sequence number and observed during `dayObs`.
Parameters
----------
day_obs : int
Observation day in the YYYYMMDD format.
seq_number : int
Sequence number associated with the slew event.
Returns
-------
Returs
------
lsst.summit.utils.tmaUtils.TMAEvent
A TMA slew events that occurred within the specified time range.
A TMA slew event that occurred within the specified time range.
Raises
------
ValueError
If no events are found for the specified time range.
ValueError
If more than one event is found for the specified time range.
"""
event_maker = TMAEventMaker()

Expand All @@ -159,8 +142,24 @@ def evaluate_single_slew(day_obs, seq_number):
if len(single_event) == 0:
raise ValueError(f"Could not find any events for {day_obs}. ")

return single_event[0]
return single_event[0]


def evaluate_single_slew(day_obs, seq_number):
"""
Evaluates the M1M3 Inertia Compensation System in a single slew with a
`seqNumber` sequence number and observed during `dayObs`.
Parameters
----------
day_obs : int
Observation day in the YYYYMMDD format.
seq_number : int
Sequence number associated with the slew event.
"""
logger.info("Retriving TMA slew event.")
event = get_tma_slew_event(day_obs, seq_number)


if __name__ == "__main__":
logger.info("Start")
Expand Down

0 comments on commit a26a970

Please sign in to comment.