Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions imap_processing/glows/l2/glows_l2_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from imap_processing.glows import FLAG_LENGTH
from imap_processing.glows.l1b.glows_l1b_data import PipelineSettings
from imap_processing.glows.utils.constants import GlowsConstants
from imap_processing.quality_flags import GLOWSL1bFlags
from imap_processing.spice.geometry import (
SpiceFrame,
frame_transform_az_el,
Expand Down Expand Up @@ -385,6 +386,14 @@ def __init__(
good_data = l1b_dataset.isel(
epoch=self.return_good_times(flags_da, active_flags)
)
# Exclude histograms where all bins have is_excluded_by_instr_team set.
# Per cbk implementation: GLOWS team marks such histograms as entirely bad;
# they are dropped here and do not contribute to the L2 histogram_flag_array.
excl_flag_val = GLOWSL1bFlags.IS_EXCLUDED_BY_INSTR_TEAM.value
excl_row = good_data["histogram_flag_array"].data[:, 2, :] # (n_epochs, n_bins)
not_all_excl = ~np.all(excl_row == excl_flag_val, axis=1)
good_data = good_data.isel(epoch=np.where(not_all_excl)[0])
Comment on lines +392 to +395
Comment on lines +389 to +395

# TODO: bad angle filter
# TODO: filter bad bins out. Needs to happen here while everything is still
# per-timestamp.
Expand Down
Loading