Skip to content

Commit 00e0958

Browse files
author
Menlo Innovations - CAVA Project
committed
Harrison 3009 - EYEA/DLAU - GLOWS: Read pixel lat/lon values from Ultra L3e output
1 parent c27e747 commit 00e0958

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

imap_l3_processing/glows/l3e/glows_l3e_ultra_model.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
SPACECRAFT_VELOCITY_Y_VAR_NAME = "spacecraft_velocity_y"
2525
SPACECRAFT_VELOCITY_Z_VAR_NAME = "spacecraft_velocity_z"
2626
ELONGATION_EXCLUDED_VAR_NAME = "elongation_excluded"
27+
PIXEL_LATITUDE_VAR_NAME = "pixel_latitude"
28+
PIXEL_LONGITUDE_VAR_NAME = "pixel_longitude"
2729

2830

2931
@dataclass
@@ -43,6 +45,7 @@ class GlowsL3EUltraData(DataProduct):
4345
spacecraft_velocity_z: np.ndarray
4446
elongation_excluded: np.ndarray
4547
pixel_latitude: np.ndarray
48+
pixel_longitude: np.ndarray
4649

4750
@classmethod
4851
def convert_dat_to_glows_l3e_ul_product(cls, input_metadata: InputMetadata, file_path: Path,
@@ -63,11 +66,18 @@ def convert_dat_to_glows_l3e_ul_product(cls, input_metadata: InputMetadata, file
6366

6467
existing_healpix = data_table[:, 0]
6568
probability_of_survival = data_table[:, 3:]
69+
pixel_latitude = data_table[:, 1]
70+
pixel_longitude = data_table[:, 2]
71+
6672

6773
probability_of_survival_to_return = np.full((len(energies), len(healpix_indexes)), np.nan, dtype=float)
74+
pixel_latitude_to_return = np.full(len(healpix_indexes), np.nan, dtype=float)
75+
pixel_longitude_to_return = np.full(len(healpix_indexes), np.nan, dtype=float)
6876

69-
for healpix, prob_sur in zip(existing_healpix, probability_of_survival):
77+
for healpix, prob_sur, pixel_lat, pixel_lon in zip(existing_healpix, probability_of_survival, pixel_latitude, pixel_longitude):
7078
probability_of_survival_to_return[:, int(healpix)] = prob_sur
79+
pixel_latitude_to_return[int(healpix)] = pixel_lat
80+
pixel_longitude_to_return[int(healpix)] = pixel_lon
7181

7282
transposed_prob_sur = np.array([probability_of_survival_to_return])
7383

@@ -87,6 +97,8 @@ def convert_dat_to_glows_l3e_ul_product(cls, input_metadata: InputMetadata, file
8797
spacecraft_velocity_y=np.array([args.spacecraft_velocity_y]),
8898
spacecraft_velocity_z=np.array([args.spacecraft_velocity_z]),
8999
elongation_excluded=np.array([args.elongation]),
100+
pixel_latitude=pixel_latitude_to_return,
101+
pixel_longitude=pixel_longitude_to_return,
90102
)
91103

92104
def to_data_product_variables(self) -> list[DataProductVariable]:
@@ -109,4 +121,6 @@ def to_data_product_variables(self) -> list[DataProductVariable]:
109121
DataProductVariable(SPACECRAFT_VELOCITY_Y_VAR_NAME, self.spacecraft_velocity_y),
110122
DataProductVariable(SPACECRAFT_VELOCITY_Z_VAR_NAME, self.spacecraft_velocity_z),
111123
DataProductVariable(ELONGATION_EXCLUDED_VAR_NAME, self.elongation_excluded),
124+
DataProductVariable(PIXEL_LATITUDE_VAR_NAME, self.pixel_latitude),
125+
DataProductVariable(PIXEL_LONGITUDE_VAR_NAME, self.pixel_longitude),
112126
]

tests/glows/l3e/test_glows_l3e_ultra_model.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ def test_l3e_ultra_model_to_data_product_variables(self):
2727
sentinel.spacecraft_velocity_x,
2828
sentinel.spacecraft_velocity_y,
2929
sentinel.spacecraft_velocity_z,
30-
sentinel.elongation_excluded
30+
sentinel.elongation_excluded,
31+
sentinel.pixel_latitude,
32+
sentinel.pixel_longitude,
3133
)
3234

3335
expected_energy_labels = ['Energy Label 1', 'Energy Label 2', 'Energy Label 3', 'Energy Label 4',
@@ -57,6 +59,8 @@ def test_l3e_ultra_model_to_data_product_variables(self):
5759
DataProductVariable("spacecraft_velocity_y", sentinel.spacecraft_velocity_y),
5860
DataProductVariable("spacecraft_velocity_z", sentinel.spacecraft_velocity_z),
5961
DataProductVariable("elongation_excluded", sentinel.elongation_excluded),
62+
DataProductVariable("pixel_latitude", sentinel.pixel_latitude),
63+
DataProductVariable("pixel_longitude", sentinel.pixel_longitude),
6064
]
6165

6266
self.assertEqual(expected_data_products, data_products)

tests/periodically_run_tests.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"test_l3bcde_first_time_processing": "2026-03-05T09:59:10.392514",
33
"test_spectral_fit_against_validation_data": "2026-01-23T10:39:49.234684",
44
"test_calculate_pickup_ions_with_minimize": "2026-03-05T13:18:02.645143",
5-
"test_ultra_all_sp_maps": "2026-03-06T13:53:31.090028",
5+
"test_ultra_all_sp_maps": "2026-03-12T09:24:59.822141",
66
"test_ultra_combined_maps": null,
77
"test_ultra_combined_nsp_maps": "2026-03-06T09:59:07.820402",
88
"test_ultra_combined_sp_maps": "2026-03-05T15:39:34.795512"

0 commit comments

Comments
 (0)