Skip to content
Snippets Groups Projects
Commit 0f09fd19 authored by Thomas Jürges's avatar Thomas Jürges
Browse files

Task SSB-42: Use strings as indices

parent c742d8c0
No related branches found
No related tags found
1 merge request!44Merge back holography to master
......@@ -128,8 +128,9 @@ class HolographyDataset():
for hbs, ho in list_of_hbs_ms_tuples:
if station_name in hbs.target_station_names:
frequency = ho.frequency
frequency_string = str(frequency)
for beamlet in self.beamlets:
beamlet_string = str(beamlet)
reference_station_names, cross_correlation =\
ho.ms_for_a_given_beamlet_number[beamlet].\
read_cross_correlation_time_flags_per_station_names(station_name,
......@@ -141,10 +142,10 @@ class HolographyDataset():
if reference_station not in self.data:
self.data[reference_station] = dict()
if frequency not in self.data[reference_station]:
self.data[reference_station][frequency] = dict()
if frequency_string not in self.data[reference_station]:
self.data[reference_station][frequency_string] = dict()
self.data[reference_station][frequency][beamlet] = \
self.data[reference_station][frequency_string][beamlet_string] = \
cross_correlation[reference_station_index, :]
......@@ -230,11 +231,14 @@ class HolographyDataset():
self.ra_dec = dict()
for frequency in self.frequencies:
frequency_string = str(frequency)
if frequency not in self.ra_dec:
self.ra_dec[frequency] = dict()
self.ra_dec[frequency_string] = dict()
for beamlet in self.beamlets:
self.ra_dec[frequency][beamlet] = \
virtual_pointing[(frequency, beamlet)]
beamlet_string = str(beamlet)
self.ra_dec[frequency_string][beamlet_string] = numpy.array( \
virtual_pointing[(frequency, beamlet)],
dtype=coordinate_type)
# reads the target station position and the coordinate of its axes
......@@ -324,6 +328,7 @@ class HolographyDataset():
result.antenna_field_position = f.attrs[HDS_ANTENNA_FIELD_POSITION].tolist()
result.reference_stations = list(f[HDS_REFERENCE_STATION])
result.frequencies = list(f[HDS_FREQUENCY])
result.ra_dec = dict()
result.data = dict()
result.beamlets = [i for i in range(f[HDS_DATA].shape[2])]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment