Skip to content
Snippets Groups Projects
Commit 57ca9799 authored by Mattia Mancini's avatar Mattia Mancini
Browse files

SSB-44: python3 conversion issues

parent 8b01d8c9
No related branches found
No related tags found
1 merge request!44Merge back holography to master
...@@ -218,7 +218,7 @@ class HolographyDataset(): ...@@ -218,7 +218,7 @@ class HolographyDataset():
central_beamlet = dict() central_beamlet = dict()
for (frequency_string, beamlets) in pseudo_distance.items(): for (frequency_string, beamlets) in pseudo_distance.items():
values = list(beamlets.values()) values = list(beamlets.values())
keys = beamlets.keys() keys = list(beamlets.keys())
minimal_distance = min(values) minimal_distance = min(values)
# If I find a second beamlet that is 'closest' to the source for the # If I find a second beamlet that is 'closest' to the source for the
# same frequency then that is a problem. The outset was that there # same frequency then that is a problem. The outset was that there
...@@ -387,7 +387,7 @@ class HolographyDataset(): ...@@ -387,7 +387,7 @@ class HolographyDataset():
# reads the target station position and the coordinate of its axes # reads the target station position and the coordinate of its axes
# and does this only once since the coordinate will not change # and does this only once since the coordinate will not change
first_holography_observation = list_of_hbs_ho_tuples[0][1] first_holography_observation = list_of_hbs_ho_tuples[0][1]
first_ms = first_holography_observation.ms_for_a_given_beamlet_number.values()[0] first_ms = list(first_holography_observation.ms_for_a_given_beamlet_number.values())[0]
station_position, tile_offset, axes_coordinates = first_ms. \ station_position, tile_offset, axes_coordinates = first_ms. \
get_station_position_tile_offsets_and_axes_coordinate_for_station_name( get_station_position_tile_offsets_and_axes_coordinate_for_station_name(
station_name) station_name)
......
...@@ -15,7 +15,7 @@ class HolographyObservation(): ...@@ -15,7 +15,7 @@ class HolographyObservation():
:param path: :param path:
:type path: str :type path: str
:param sas_id: :param sas_id:
:type sas_id: int :type sas_id: str
:param ms_for_a_given_beamlet_number: :param ms_for_a_given_beamlet_number:
:type ms_for_a_given_beamlet_number: dict[int, HolographyMeasurementSet] :type ms_for_a_given_beamlet_number: dict[int, HolographyMeasurementSet]
:param start_mjd_in_seconds: :param start_mjd_in_seconds:
...@@ -103,7 +103,7 @@ class HolographyObservation(): ...@@ -103,7 +103,7 @@ class HolographyObservation():
for root, dirnames, filenames in os.walk(path): for root, dirnames, filenames in os.walk(path):
match = re.match(ms_dirs_path_pattern, root) match = re.match(ms_dirs_path_pattern, root)
if match: if match:
sas_id = int(match.group('sas_id')) sas_id = match.group('sas_id')
ms_indexed_per_beamlet_number = HolographyObservation. \ ms_indexed_per_beamlet_number = HolographyObservation. \
create_ms_dict_from_ms_name_list_and_path(dirnames, root) create_ms_dict_from_ms_name_list_and_path(dirnames, root)
......
...@@ -118,7 +118,7 @@ class HolographySpecification(object): ...@@ -118,7 +118,7 @@ class HolographySpecification(object):
def _read_lines(self): def _read_lines(self):
with open(self.path, 'r') as fstream_in: with open(self.path, 'r') as fstream_in:
return fstream_in.read().splitlines() return fstream_in.readlines()
@staticmethod @staticmethod
def _split_header(line): def _split_header(line):
......
...@@ -393,7 +393,7 @@ class TestProcessing(unittest.TestCase): ...@@ -393,7 +393,7 @@ class TestProcessing(unittest.TestCase):
for frequency in out_datatable[station]: for frequency in out_datatable[station]:
for beam in out_datatable[station][frequency]: for beam in out_datatable[station][frequency]:
self.assertEqual(out_datatable[station][frequency][beam]['mean'].shape[0], self.assertEqual(out_datatable[station][frequency][beam]['mean'].shape[0],
len(timesamples) / 3 + 1) len(timesamples) // 3 + 1)
if __name__ == '__main__': if __name__ == '__main__':
......
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