Skip to content

Commit

Permalink
FIX: Force 64 bit int in MET multiplications
Browse files Browse the repository at this point in the history
  • Loading branch information
greglucas committed Jun 20, 2024
1 parent b2b3827 commit 8b0f474
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion imap_processing/cdf/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ def convert_met_to_datetime64(
"""
# Convert MET to int, then to nanoseconds as datetime64 requires int input and
# some instruments are adding additional float precision to the MET
time_array = (np.asarray(met) * 1e9).astype(int).astype("timedelta64[ns]")
# NOTE: We need int64 here when running on 32bit systems as plain int will default
# to 32bit and overflow due to the nanosecond multiplication
time_array = (np.asarray(met) * 1e9).astype(np.int64).astype("timedelta64[ns]")
return launch_time + time_array


Expand Down

0 comments on commit 8b0f474

Please sign in to comment.