sot / kadi

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

states.get_states fails if you don't know the time of the start of the data #239

Closed Gregg140 closed 2 years ago

Gregg140 commented 2 years ago

https://sot.github.io/kadi/commands_states.html says:

"The Commands archive is a table of every load command that has been run, or is currently approved to be run, on the spacecraft since 2002."

If I want to capture data from the very beginning of the mission, I cannot just write:

In [63]: states.get_states('2002:001', '2003:001', state_keys = ['orbit_point'])

You get a value error:

ValueError: did not find transitions for state key(s) {'orbit_point'} within 1000 days of 2002:001:00:00:00.000. Maybe adjust the lookbacks argument?

Firstly, I cannot adjust the "lookbacks" argument for this command:

In [64]: states.get_states('2002:001', '2003:001', state_keys = ['orbit_point'], lookbacks = (7, 15))

TypeError Traceback (most recent call last)

in ----> 1 states.get_states('2002:001', '2003:001', state_keys = ['orbit_point'], lookbacks = (7, 15)) **TypeError: get_states() got an unexpected keyword argument 'lookbacks'** So that error message is misleading. By experimentation I got close to the beginning: states.get_states('2002:007:17:40:00.20', '2003:025', state_keys = ['orbit_point']) Which will be good enough for my purposes but I shouldn't have to do that. It should run like the SKA engineering archive wherein if you put a start time prior to the earliest data, it will give you the earliest data available. If there is already a way to do this please let me know.