FIX: Lo update spin time calculation#2635
FIX: Lo update spin time calculation#2635greglucas merged 1 commit intoIMAP-Science-Operations-Center:devfrom
Conversation
| 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.
Should we be adding a half-tick here?
(de_time + 0.5) * DE_CLOCK_TICK_S
There was a problem hiding this comment.
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.
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.
imap_processing/lo/l1b/lo_l1b.py
Outdated
|
|
||
| # 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.
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.
I need the exact start of the spin, not an interpolation. Is there a way to get that?
There was a problem hiding this comment.
OK, I don't like the name "interpolate_spin_data()" 😂 That confused me as I thought all values would be interpolated. I think the spin-phase may be interpolated, but no other quantities from the original dataframe.
I refactored the code to use that function now though and I added a test to test_spin.py to convince myself this is doing what I wanted it to.
Thanks for mentioning this!
| 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.
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.
ac582fe to
258b784
Compare
- 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.
258b784 to
cc226cc
Compare
0d7e867
into
IMAP-Science-Operations-Center:dev
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)