-
Notifications
You must be signed in to change notification settings - Fork 22
FIX: Lo update spin time calculation #2635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
FIX: Lo update spin time calculation #2635
Conversation
- use universal spin table to get true onboard timing The Lo spin packet is not accurate enough or has different time information in it, so we need to reference DE events to the onboard timekeeping (spin table), which the Lo instrument references to reset its counter. - Change formula for DE time tag counter. It is a fixed length pulse of 4.096ms, not varying with spin period. This means we need to multiply each DE tick by that length of time.
| de_eu_time de_dn_time / 4096 * avg_spin_duration | ||
| where de_time is the direct event time Data Number (DN) and avg_spin_duration | ||
| is the average spin duration for the ASC that the event was measured in. | ||
| time_from_start_of_spin = de_time * DE_CLOCK_TICK_S |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be adding a half-tick here?
(de_time + 0.5) * DE_CLOCK_TICK_S
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Hi, each DE is tagged with the exact clock time (not adding 1/2 of a tick). When computing spin-phase or geometry, the 1/2 tick is added.
subagonsouth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good other than the recommendation to check the referenced spin function. I will approve and let you decide if you want to use that function or not.
|
|
||
| # Find the index of the closest spin start for each direct event | ||
| # We want the closest prior spin (spin that has already started) | ||
| closest_spin_indices = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This basically duplicates the code in the interpolate_spin_data function. I assume that you just didn't know about that function... or is there something there that is undesirable for use here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need the exact start of the spin, not an interpolation. Is there a way to get that?
| de_eu_time de_dn_time / 4096 * avg_spin_duration | ||
| where de_time is the direct event time Data Number (DN) and avg_spin_duration | ||
| is the average spin duration for the ASC that the event was measured in. | ||
| time_from_start_of_spin = de_time * DE_CLOCK_TICK_S |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Hi, each DE is tagged with the exact clock time (not adding 1/2 of a tick). When computing spin-phase or geometry, the 1/2 tick is added.
Use universal spin table to get true onboard timing. The Lo spin packet is not accurate enough or has different time information in it, so we need to reference DE events to the onboard timekeeping (spin table), which the Lo instrument references to reset its counter.
Change formula for DE time tag counter. It is a fixed length pulse of 4.096ms, not varying with spin period. This means we need to multiply each DE tick by that length of time.
Change spin bins from (-180, 180) to (0, 360)