diff --git a/imap_processing/utils.py b/imap_processing/utils.py index 9c2e74ef55..1c620748a3 100644 --- a/imap_processing/utils.py +++ b/imap_processing/utils.py @@ -15,48 +15,6 @@ logger = logging.getLogger(__name__) -def sort_by_time(packets: list, time_key: str) -> list: - """ - Sort packets by specified key. - - Parameters - ---------- - packets : list - Decom data packets. - time_key : str - Key to sort by. Must be a key in the packets data dictionary. - e.g. "SHCOARSE" or "MET_TIME" or "ACQ_START_COARSE". - - Returns - ------- - sorted_packets : list - Sorted packets. - """ - sorted_packets = sorted(packets, key=lambda x: x[time_key]) - return sorted_packets - - -def group_by_apid(packets: list) -> dict: - """ - Group data by apid. - - Parameters - ---------- - packets : list - Packet list. - - Returns - ------- - grouped_packets : dict - Grouped data by apid. - """ - grouped_packets: dict[list] = collections.defaultdict(list) - for packet in packets: - apid = packet["PKT_APID"] - grouped_packets.setdefault(apid, []).append(packet) - return grouped_packets - - def convert_raw_to_eu( dataset: xr.Dataset, conversion_table_path: str,