IDEX Update event time calculation#2664
IDEX Update event time calculation#2664lacoak21 wants to merge 1 commit intoIMAP-Science-Operations-Center:devfrom
Conversation
| return met_to_ttj2000ns(met) | ||
| if coarse_time_sec2 is not None: | ||
| # Reconstruct the total seconds from the two 16-bit words | ||
| coarse_event_time = 65536 * coarse_time_sec1 + coarse_time_sec2 |
There was a problem hiding this comment.
I am little curious why they want to multiply coarse second time with 65536. I have seen this number is CoDICE and they are doing this:
center_times_seconds = (
acq_start_seconds + acq_start_subseconds / 65536 + (delta_times / 1e9)
)
Can you check with them if 65536 should be applied to fine_time_subs instead?
tech3371
left a comment
There was a problem hiding this comment.
I had one minor question to IDEX team but what you had is good.
p.s. yes, I remember that discussion and I thought I was way off based on response I got. I should have push back more :)
greglucas
left a comment
There was a problem hiding this comment.
Personally, I think this is slightly confusing with fine first then two coarse counters. Rather than changing the calculate event time, can you just update the one spot of input to combine the two coarse ints into a single int that you pass into the function, rather than reworking the function itself?
| shfine_time : float, numpy.ndarray | ||
| The fine time value from the FPGA header. Number of 20 microsecond "ticks" since | ||
| the last second. | ||
| fine_time_subs : numpy.ndarray, optional |
There was a problem hiding this comment.
This isn't optional anymore since it is the first argument, the final coarse_time_sec2 is optional now though.
| self.impact_time = calculate_idex_event_time( | ||
| header_packet["IDX__TXHDRTIMESUBS"], | ||
| header_packet["IDX__TXHDRTIMESEC1"], | ||
| header_packet["IDX__TXHDRTIMESEC2"], |
There was a problem hiding this comment.
Add a comment here about what these times are, but I think this might be clearer what is going on (to me at least). You are left-shifting the first timer to the first 16 bits to make a 32-bit integer, so I'd use the bitwise operators (you might need to do this on .data of the packets I'm not sure)
| self.impact_time = calculate_idex_event_time( | |
| header_packet["IDX__TXHDRTIMESUBS"], | |
| header_packet["IDX__TXHDRTIMESEC1"], | |
| header_packet["IDX__TXHDRTIMESEC2"], | |
| self.impact_time = calculate_idex_event_time( | |
| (header_packet["IDX__TXHDRTIMESEC1"] << 16) + header_packet["IDX__TXHDRTIMESEC2"], | |
| header_packet["IDX__TXHDRTIMESUBS"], |
Change Summary
Overview
The IDEX team realized they were using shcoarse for event time calculation. This was actually the time of the packet calculation and not the time when IDEX triggered.
I think @tech3371 you had this concern in the science team meeting a long time ago but I thought they said we were doing it right! Anyway this is the correct way to do it.
Updated Files
-imap_processing/idex/idex_l1a.py