Skip to content

ENH - Skip L2 processing when no good times are found #2372

@maxinelasp

Description

@maxinelasp

Description

Currently, when no good times are found in L1B data, the L2 processing continues and creates an output file with potentially invalid or meaningless data. The code should exit early or skip processing to avoid creating invalid output files.

Location

imap_processing/glows/l2/glows_l2.py:80-91

Current Implementation

if len(good_data["epoch"]) != 0:
    var_outputs["start_time"] = good_data["epoch"].data[0]
    var_outputs["end_time"] = good_data["epoch"].data[-1]
else:
    # No good times in the file
    var_outputs["start_time"] = l1b_dataset["imap_start_time"].data[0]
    var_outputs["end_time"] = (
        l1b_dataset["imap_start_time"].data[0]
        + l1b_dataset["imap_time_offset"].data[0]
    )
# Processing continues regardless...

Required Changes

  1. After detecting len(good_data["epoch"]) == 0, add early return or raise appropriate exception
  2. Log warning message about no good times found
  3. Decide appropriate behavior:
    • Option A: Return None and skip file creation
    • Option B: Raise exception with clear message
    • Option C: Create file with special flag indicating no valid data

Related

Part of #1276 (GLOWS L2 follow up)

Metadata

Metadata

Assignees

Labels

Ins: GLOWSRelated to the GLOWS instrumentLevel: L2Level 2 processingenhancementNew feature or request

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions