Skip to content

Commit 4d1b3df

Browse files
Update to support new nested dictionary data type for passing between functions
1 parent dcbc5c2 commit 4d1b3df

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/test_instrument.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,21 @@ def setup_instrument_hardware():
2626
hardware = instrument.Hardware(config)
2727
make_radiance_maps.MakeRadianceMaps(config).run()
2828
filenames = glob(os.getenv('suncet_data') + '/mhd/bright_fast/rendered_euv_maps/radiance_maps_200.fits')
29-
radiance_maps = sunpy.map.Map(filenames, sequence=True)
29+
30+
maps_by_index_and_wavelength = {}
31+
for filename in filenames:
32+
index = os.path.basename(filename).split('_')[-1].replace('.fits', '')
33+
maps = sunpy.map.Map(filename)
34+
35+
if index not in maps_by_index_and_wavelength:
36+
maps_by_index_and_wavelength[index] = {}
37+
38+
for map in maps:
39+
wavelength = str(map.wavelength)
40+
maps_by_index_and_wavelength[index][wavelength] = map
41+
42+
radiance_maps = maps_by_index_and_wavelength
43+
3044
hardware.store_target_wavelengths(radiance_maps)
3145
hardware.compute_effective_area()
3246
return hardware

0 commit comments

Comments
 (0)