sot / kadi

Chandra commands and events
https://sot.github.io/kadi
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

get_continuity fails at this date #198

Closed jeanconn closed 3 years ago

jeanconn commented 3 years ago

Looks like I can reproduce the occasional replan central issue with this date.

In [1]: from kadi.commands.states import get_continuity                                                                                   

In [2]: get_continuity('2021:032:13:56:00.000')                                                                                           
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-2-9b064a5196b9> in <module>
----> 1 get_continuity('2021:032:13:56:00.000')

/proj/sot/ska3/flight/lib/python3.8/site-packages/kadi/commands/states.py in get_continuity(date, state_keys, lookbacks)
   1466                 # the required time range. Without this the time range of cmds is used which
   1467                 # can give unexpected outputs if ``date``` is within a maneuver.
-> 1468                 states = get_states(state_keys=state_key, cmds=cmds, start=start, stop=stop,
   1469                                     continuity={}, reduce=False)
   1470             except NoTransitionsError:

/proj/sot/ska3/flight/lib/python3.8/site-packages/kadi/commands/states.py in get_states(start, stop, state_keys, cmds, continuity, reduce, merge_identical)
   1301                 # instead of directly updating the state.  The function might itself
   1302                 # update the state or it might generate downstream transitions.
-> 1303                 value(date, transitions, state, idx)
   1304             elif key != 'date':
   1305                 # Normal case of just updating current state

/proj/sot/ska3/flight/lib/python3.8/site-packages/kadi/commands/states.py in callback(cls, date, transitions, state, idx)
    828         actual maneuver and (usually) transition to NPM at the end of maneuver.
    829         """
--> 830         end_manvr_date = cls.add_manvr_transitions(date, transitions, state, idx)
    831 
    832         # If auto-transition to NPM after manvr is enabled (this is

/proj/sot/ska3/flight/lib/python3.8/site-packages/kadi/commands/states.py in add_manvr_transitions(cls, date, transitions, state, idx)
    855 
    856         # Get attitudes for the maneuver at about 5-minute intervals.
--> 857         atts = Chandra.Maneuver.attitudes(curr_att, targ_att,
    858                                           tstart=DateTime(date).secs)
    859 

/proj/sot/ska3/flight/lib/python3.8/site-packages/Chandra/Maneuver/maneuver.py in attitudes(att1, att2, step, tstart, exact_steps)
    125         times = np.append(np.arange(0.0, Tm, step), Tm)
    126     else:
--> 127         times = np.linspace(0.0, Tm, int(round(Tm / step)) + 1)
    128 
    129     e = get_eigenaxis(manvr_quat.q[:3])

ValueError: cannot convert float NaN to integer
jeanconn commented 3 years ago

I'm guessing there is an issue with the boot-strapping here but didn't jump right in.