sot / kadi

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

Add one shot break down (roll, pitch, yaw) to Manvr event #96

Closed jeanconn closed 7 years ago

jeanconn commented 7 years ago

Add one shot break down (roll, pitch, yaw) to Manvr event

This PR adds the one_shot_roll, one_shot_pitch, and one_shot_yaw to the Manvr class. A change is also made here to use the AOATTER values in the first guide readout, not the the values that correspond to the time when the RSS of AOATTER2 and AOATTER3 is biggest.

jeanconn commented 7 years ago

I think I've executed all the requested changes here, but I'm not sure what this needs for testing.

Also, I tried to work the steps in https://github.com/sot/kadi/blob/master/NOTES.add_event_type, but did not understand the different update time ranges (or how to select the appropriate time range) in https://github.com/sot/kadi/blob/master/NOTES.add_event_type#L38 and when I got to https://github.com/sot/kadi/blob/master/NOTES.add_event_type#L72 I was seeing diffs that looked undesired (looked like something (astropy.table?) compressing the doc table). Wasn't sure if I should update the code/process or push back to @taldcroft .

taldcroft commented 7 years ago

For the docs, change the out_lines = dat.pformat() call to dat.pformat(max_lines=-1, max_width=-1)

taldcroft commented 7 years ago

And it has probably gotten to the point where you might as well squash down the commits. I don't think the commit history has a lot of value now.

jeanconn commented 7 years ago

Regarding my comment above, I'm still not sure about

Also, I tried to work the steps in https://github.com/sot/kadi/blob/master/NOTES.add_event_type, but did not understand the different update time ranges (or how to select the appropriate time range) in https://github.com/sot/kadi/blob/master/NOTES.add_event_type#L38

taldcroft commented 7 years ago

About the time ranges, did the dates provided in the instructions not work? I don't remember the details.

jeanconn commented 7 years ago

The instructions say:

./update_events --start=1999:200 --stop=2001:001 --model=${ModelClassName}
# The start date might need to be a bit later, e.g. for Manvr use 1999:230 + 21 days (lookback
# time) so that all the event_msids are fully sampled.  Probably not needed for events
# that rely on only one event MSID.
./update_events --start=2001:001 --model=${ModelClassName}

So it is doing two time ranges without telling me why that's needed and I don't know how to determine that "all the event_msids are fully sampled". No errors.

taldcroft commented 7 years ago

The two time ranges is probably just to make sure it seems to be working OK without generating the whole table. If you are getting a decent output then it's good to go.

jeanconn commented 7 years ago

Regarding validation, in addition to adding the per axis values, this code makes the fundamental change that the one shot is defined as the RSS of the first available values of AOATTER2 and AOATTER3 after changing to GUIDE. The previous code defined the one shot as the maximum value of the RSS "within" 10 seconds of the guide transition. I note, from looking at, say the eng archive derived one shot for obsid 54592, that there are real differences in results from the old and new methods. In this case, the attitude errors before GUIDE were larger than after

start = '2012:145:03:27:09.172' # guide start
telem = fetch.Msid("one_shot", DateTime(start).secs - 10, DateTime(start).secs + 10)
telem.plot(marker='.', linestyle="")

image

The values also increased after GUIDE began

telem = fetch.Msid("one_shot", DateTime(start).secs, DateTime(start).secs + 40)
telem.plot(marker='.', linestyle="")

image

The current kadi one_shot value is, as expected, 34.28 and the value from this PR is 19.4 arcsec. This seems correct and reasonable to me. Do we need to do anything else WRT to change the values of the historical one shots this way?

Here's a histogram of the differences between old and new one_shot values in kadi looking at the last 5 years of maneuvers.

one_shot_diff

taldcroft commented 7 years ago

👍 !