Skip to content

Commit ae6023e

Browse files
author
Menlo Innovations - CAVA Project
committed
Harrison L3 - GSTU/EYEA - Match 'spxnbs' as a valid quantity in a map descriptor
1 parent 3fac847 commit ae6023e

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

imap_l3_processing/maps/map_descriptors.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class PixelSize(enum.IntEnum):
5454
class MapQuantity(enum.Enum):
5555
Intensity = "Intensity"
5656
SpectralIndex = "SpectralIndex"
57+
SpectralIndexNBS = "SpectralIndexNBS"
5758
ISNBackgroundSubtracted = "ISNBackgroundSubtracted"
5859

5960

@@ -84,6 +85,7 @@ class MapDescriptorParts:
8485

8586
quantity_mapping = [
8687
("spx", MapQuantity.SpectralIndex),
88+
("spxnbs", MapQuantity.SpectralIndexNBS),
8789
("ena", MapQuantity.Intensity),
8890
("isn", MapQuantity.ISNBackgroundSubtracted)
8991
]
@@ -117,7 +119,7 @@ class MapDescriptorParts:
117119
def parse_map_descriptor(descriptor: str) -> Optional[MapDescriptorParts]:
118120
descriptor_regex = """
119121
(?P<sensor>hic|h45|h90|l090|ulc|u45|u90|ilo)-
120-
(?P<quantity>ena|spx|isn)(?P<spectral_index_range>[0-9]{4})?(?P<quantity_suffix>[a-zA-Z]*)-
122+
(?P<quantity>ena|spxnbs|spx|isn)(?P<spectral_index_range>[0-9]{4})?(?P<quantity_suffix>[a-zA-Z]*)-
121123
(?P<species>h|o)-
122124
(?P<frame>sf|hf|hk)-
123125
(?P<survival_corrected>sp|nsp)-

tests/maps/test_map_descriptors.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,23 @@ def test_parse_map_descriptor(self):
114114
no_sp, SpinPhase.RamOnly, "hae",
115115
PixelSize.SixDegrees,
116116
"1yr",
117-
MapQuantity.SpectralIndex, "nbs")),
117+
MapQuantity.SpectralIndexNBS, "")),
118+
("l090-spxnbs1111-h-sf-nsp-ram-hae-6deg-1yr", MapDescriptorParts(Sensor.Lo90, ReferenceFrame.Spacecraft,
119+
no_sp, SpinPhase.RamOnly, "hae",
120+
PixelSize.SixDegrees,
121+
"1yr",
122+
MapQuantity.SpectralIndexNBS, "", (11, 11))),
123+
("l090-spxnbs1111thisisdense-h-sf-nsp-ram-hae-6deg-1yr", MapDescriptorParts(Sensor.Lo90, ReferenceFrame.Spacecraft,
124+
no_sp, SpinPhase.RamOnly, "hae",
125+
PixelSize.SixDegrees,
126+
"1yr",
127+
MapQuantity.SpectralIndexNBS, "thisisdense",
128+
(11, 11))),
118129
("l090-spxnbs-h-hk-nsp-ram-hae-6deg-1yr", MapDescriptorParts(Sensor.Lo90, ReferenceFrame.HeliosphericKinematic,
119130
no_sp, SpinPhase.RamOnly, "hae",
120131
PixelSize.SixDegrees,
121132
"1yr",
122-
MapQuantity.SpectralIndex, "nbs")),
133+
MapQuantity.SpectralIndexNBS, "")),
123134
("h45-spx0607-h-hf-sp-full-hae-4deg-6mo", MapDescriptorParts(Sensor.Hi45, cg, sp, SpinPhase.FullSpin, "hae",
124135
PixelSize.FourDegrees, "6mo",
125136
MapQuantity.SpectralIndex, "", (6, 7))),

0 commit comments

Comments
 (0)