diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py b/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py index 243cb8b3ddbc8729a94b61606a3a7a4c93b5be42..60499017cdc4a4247f7716881ca2840f45ffb96a 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py @@ -99,7 +99,7 @@ def _add_pointings(pointing_a, pointing_b): raise SubtaskCreationException( "Cannot add pointings because direction types differ pointing_a=%s; pointing_b=%s" % (pointing_a, pointing_b)) pointing = {"direction_type": pointing_a['direction_type']} - for angle in ['angle1', 'angle2', 'angle3']: + for angle in ['angle1', 'angle2']: pointing[angle] = pointing_a.get(angle, 0.0) + pointing_b.get(angle, 0.0) return pointing diff --git a/SAS/TMSS/backend/test/t_adapter.py b/SAS/TMSS/backend/test/t_adapter.py index f67d013c90e33f656334d3416444ec70006f7ffb..772a2d43ed706e328371dc2cdb048f38f65db9ed 100755 --- a/SAS/TMSS/backend/test/t_adapter.py +++ b/SAS/TMSS/backend/test/t_adapter.py @@ -214,7 +214,7 @@ class SIPadapterTest(unittest.TestCase): specifications_doc['stations']['filter'] = "HBA_210_250" feedback_template = models.DataproductFeedbackTemplate.objects.get(name='feedback') # feedback_doc = get_default_json_object_for_schema(feedback_template.schema) # todo <- fix the default generator, for some reason it does not produce valid json here... - feedback_doc = {'percentage_written': 100, 'frequency': {'subbands': [156], 'central_frequencies': [33593750.0], 'channel_width': 6103.515625, 'channels_per_subband': 32}, 'time': {'start_time': '2013-02-16T17:00:00', 'duration': 5.02732992172, 'sample_width': 2.00278016}, 'antennas': {'set': 'HBA_DUAL', 'fields': [{'type': 'HBA', 'field': 'HBA0', 'station': 'CS001'}, {'type': 'HBA', 'field': 'HBA1', 'station': 'CS001'}]}, 'target': {'pointing': {'angle1': 0, 'angle2': 0, 'angle3': 0, 'direction_type': 'J2000'}}, 'samples': {'polarisations': ['XX', 'XY', 'YX', 'YY'], 'type': 'float', 'bits': 32, 'writer': 'standard', 'writer_version': '2.2.0', 'complex': True}, '$schema': 'http://127.0.0.1:8001/api/schemas/dataproductfeedbacktemplate/feedback/1#'} + feedback_doc = {'percentage_written': 100, 'frequency': {'subbands': [156], 'central_frequencies': [33593750.0], 'channel_width': 6103.515625, 'channels_per_subband': 32}, 'time': {'start_time': '2013-02-16T17:00:00', 'duration': 5.02732992172, 'sample_width': 2.00278016}, 'antennas': {'set': 'HBA_DUAL', 'fields': [{'type': 'HBA', 'field': 'HBA0', 'station': 'CS001'}, {'type': 'HBA', 'field': 'HBA1', 'station': 'CS001'}]}, 'target': {'pointing': {'angle1': 0, 'angle2': 0, 'direction_type': 'J2000'}}, 'samples': {'polarisations': ['XX', 'XY', 'YX', 'YY'], 'type': 'float', 'bits': 32, 'writer': 'standard', 'writer_version': '2.2.0', 'complex': True}, '$schema': 'http://127.0.0.1:8001/api/schemas/dataproductfeedbacktemplate/feedback/1#'} for dp in specifications_doc['stations']['digital_pointings']: dp['subbands'] = list(range(8)) # Create SubTask(output) diff --git a/SAS/TMSS/backend/test/t_subtasks.py b/SAS/TMSS/backend/test/t_subtasks.py index c3a8c261bd74c019f4728aa4d525e376aad875cf..806fcd682579d20829b1b010f5548fb530ae73e1 100755 --- a/SAS/TMSS/backend/test/t_subtasks.py +++ b/SAS/TMSS/backend/test/t_subtasks.py @@ -230,10 +230,10 @@ class SubTasksCreationFromTaskBluePrint(unittest.TestCase): def test_create_subtasks_from_task_blueprint_translates_SAP_names(self): task_blueprint = create_task_blueprint_object_for_testing('target observation') task_blueprint.specifications_doc['SAPs'] = [{'name': 'target1', 'target': '', 'subbands': [], - 'digital_pointing': {'angle1': 0.1, 'angle2': 0.1, 'angle3': 0.1, + 'digital_pointing': {'angle1': 0.1, 'angle2': 0.1, 'direction_type': 'J2000'}}, {'name': 'target2', 'target': '', 'subbands': [], - 'digital_pointing': {'angle1': 0.2, 'angle2': 0.2, 'angle3': 0.2, + 'digital_pointing': {'angle1': 0.2, 'angle2': 0.2, 'direction_type': 'J2000'}}] subtask = create_observation_control_subtask_from_task_blueprint(task_blueprint) i = 0 @@ -386,9 +386,9 @@ class SettingTest(unittest.TestCase): class SubTaskCreationFromTaskBlueprintBeamformer(unittest.TestCase): saps = [{"name": "target1", "target": "", "subbands": [349, 372], - "digital_pointing": {"angle1": 0.24, "angle2": 0.25, "angle3": 0.26, "direction_type": "J2000"}}, + "digital_pointing": {"angle1": 0.24, "angle2": 0.25, "direction_type": "J2000"}}, {"name": "target2", "target": "", "subbands": [309, 302], - "digital_pointing": {"angle1": 0.42, "angle2": 0.52, "angle3": 0.62, "direction_type": "J2000"}} + "digital_pointing": {"angle1": 0.42, "angle2": 0.52, "direction_type": "J2000"}} ] beamformers = [{"name": "beamformer1", "coherent": {"settings": {"stokes": "I", "time_integration_factor": 8, "subbands_per_file": 244, @@ -447,7 +447,7 @@ class SubTaskCreationFromTaskBlueprintBeamformer(unittest.TestCase): def test_generate_tab_ring_pointings_returns_correct_pointings(self): - pointing = {"angle1": 0.11, "angle2": 0.22, "angle3": 0.33, "direction_type": "J2000"} + pointing = {"angle1": 0.11, "angle2": 0.22, "direction_type": "J2000"} tab_rings = {"width": 1, "count": 1} # assert center pointing is returned @@ -469,9 +469,9 @@ class SubTaskCreationFromTaskBlueprintBeamformer(unittest.TestCase): def test_add_pointings_adds_correctly(self): pointing_a = {"angle1": 0.11, "angle2": 0.22, "direction_type": "J2000"} - pointing_b = {"angle1": 0.88, "angle2": 0.66, "angle3": 0.77, "direction_type": "J2000"} + pointing_b = {"angle1": 0.88, "angle2": 0.66, "direction_type": "J2000"} pointing_sum = _add_pointings(pointing_a, pointing_b) - self.assertEqual(pointing_sum, {"angle1": 0.99, "angle2": 0.88, "angle3": 0.77, "direction_type": "J2000"}) + self.assertEqual(pointing_sum, {"angle1": 0.99, "angle2": 0.88, "direction_type": "J2000"}) def test_filter_subbands_filters_correctly(self): subbands = [1,3,4,5,10,11,12,13,19,20]