2424SPACECRAFT_VELOCITY_Y_VAR_NAME = "spacecraft_velocity_y"
2525SPACECRAFT_VELOCITY_Z_VAR_NAME = "spacecraft_velocity_z"
2626ELONGATION_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 ]
0 commit comments