@@ -2276,8 +2276,8 @@ def get_channel_energy_values(self, returns: str = "num") -> list:
2276
2276
p_identifier = "Ion_Bins_Text" if self .sensor == "ept" else "H_Bins_Text" if self .sensor == "het" else "Bins_Text"
2277
2277
energy_ranges = energy_dict [p_identifier ]
2278
2278
2279
- # Each element in the list is also a list with len==1, so fix that
2280
- energy_ranges = [ element [ 0 ] for element in energy_ranges ]
2279
+ # Each element in the list is also a list with len==1 for cdflib < 1.3.3 , so fix that
2280
+ energy_ranges = energy_ranges . flatten ()
2281
2281
2282
2282
if self .spacecraft [:2 ] == "st" :
2283
2283
@@ -2299,8 +2299,8 @@ def get_channel_energy_values(self, returns: str = "num") -> list:
2299
2299
else :
2300
2300
energy_ranges = energy_dict ["Proton_Bins_Text" ]
2301
2301
2302
- # Each element in the list is also a list with len==1, so fix that
2303
- energy_ranges = [ element [ 0 ] for element in energy_ranges ]
2302
+ # Each element in the list is also a list with len==1 for cdflib < 1.3.3 , so fix that
2303
+ energy_ranges = energy_ranges . flatten ()
2304
2304
2305
2305
if self .spacecraft == "soho" :
2306
2306
if self .sensor .lower () == "erne" :
@@ -2322,9 +2322,8 @@ def get_channel_energy_values(self, returns: str = "num") -> list:
2322
2322
if self .species == 'p' :
2323
2323
energy_ranges = energy_dict ["H_ENERGY_LABL" ]
2324
2324
2325
- # In the case of ISOIS-EPIHI, each iterable object is a list with len=1 that contains
2326
- # the str
2327
- energy_ranges = [element [0 ] for element in energy_ranges ]
2325
+ # Each element in the list is also a list with len==1 for cdflib < 1.3.3, so fix that
2326
+ energy_ranges = energy_ranges .flatten ()
2328
2327
2329
2328
if self .sensor == "isois-epilo" :
2330
2329
# The metadata of ISOIS-EPILO comes in a bit of complex form, so some handling is required
0 commit comments