From 525fefb63f7faacbfb25d883901f42c1688dbaf7 Mon Sep 17 00:00:00 2001 From: Laura Sandoval Date: Tue, 27 Aug 2024 11:16:06 -0600 Subject: [PATCH] pr response --- .../ultra/l1b/ultra_l1b_extended.py | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/imap_processing/ultra/l1b/ultra_l1b_extended.py b/imap_processing/ultra/l1b/ultra_l1b_extended.py index 2a4dea509..47c25b653 100644 --- a/imap_processing/ultra/l1b/ultra_l1b_extended.py +++ b/imap_processing/ultra/l1b/ultra_l1b_extended.py @@ -198,30 +198,34 @@ def get_ph_tof_and_back_positions( # Stop Type: 1=Top, 2=Bottom # Convert converts normalized TDC values into units of # hundredths of a millimeter using lookup tables. - index_top = np.where(de_filtered["STOP_TYPE"].data == StopType.Top.value)[0] stop_type_top = de_filtered["STOP_TYPE"].data == StopType.Top.value - xb[index_top] = get_back_position(xb_index[stop_type_top], "XBkTp", sensor) - yb[index_top] = get_back_position(yb_index[stop_type_top], "YBkTp", sensor) + xb[stop_type_top] = get_back_position(xb_index[stop_type_top], "XBkTp", sensor) + yb[stop_type_top] = get_back_position(yb_index[stop_type_top], "YBkTp", sensor) # Correction for the propagation delay of the start anode and other effects. - t2[index_top] = get_image_params("TOFSC") * t1[stop_type_top] + get_image_params( - "TOFTPOFF" + t2[stop_type_top] = get_image_params("TOFSC") * t1[ + stop_type_top + ] + get_image_params("TOFTPOFF") + tof[stop_type_top] = t2[stop_type_top] + xf_ph[stop_type_top] * get_image_params( + "XFTTOF" ) - tof[index_top] = t2[index_top] + xf_ph[stop_type_top] * get_image_params("XFTTOF") - index_bottom = np.where(de_filtered["STOP_TYPE"].data == StopType.Bottom.value)[0] stop_type_bottom = de_filtered["STOP_TYPE"].data == StopType.Bottom.value - xb[index_bottom] = get_back_position(xb_index[stop_type_bottom], "XBkBt", sensor) - yb[index_bottom] = get_back_position(yb_index[stop_type_bottom], "YBkBt", sensor) + xb[stop_type_bottom] = get_back_position( + xb_index[stop_type_bottom], "XBkBt", sensor + ) + yb[stop_type_bottom] = get_back_position( + yb_index[stop_type_bottom], "YBkBt", sensor + ) # Correction for the propagation delay of the start anode and other effects. - t2[index_bottom] = get_image_params("TOFSC") * t1[ + t2[stop_type_bottom] = get_image_params("TOFSC") * t1[ stop_type_bottom ] + get_image_params("TOFBTOFF") # 10*ns - tof[index_bottom] = t2[index_bottom] + xf_ph[stop_type_bottom] * get_image_params( - "XFTTOF" - ) + tof[stop_type_bottom] = t2[stop_type_bottom] + xf_ph[ + stop_type_bottom + ] * get_image_params("XFTTOF") # Multiply by 100 to get tenths of a nanosecond. tof = tof * 100