Skip to content

Commit 067832b

Browse files
committed
handle case where there are too many priorities
1 parent 70a573f commit 067832b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

imap_processing/codice/codice_l1a_de.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,13 @@ def process_de_data(
415415
# Sort by priority
416416
sort_idx = np.argsort(group["priority"].values)
417417
group = group.isel(epoch=sort_idx)
418-
418+
elif counts > num_priorities:
419+
# TODO is this possible?
420+
# Sort by priority
421+
sort_idx = np.argsort(group["priority"].values)
422+
group = group.isel(epoch=sort_idx)
423+
# Keep only the first num_priorities packets
424+
group = group.isel(epoch=slice(0, num_priorities))
419425
padded_groups.append(group)
420426

421427
# Concatenate all groups

0 commit comments

Comments
 (0)