diff --git a/CAL/CalibrationCommon/lib/datacontainers/holography_dataset.py b/CAL/CalibrationCommon/lib/datacontainers/holography_dataset.py index 7c21b0c256a786fbe3e6a40c18c03626e5bd1b45..77c2b4aa0b52440828c4f55fa63eff048028e673 100644 --- a/CAL/CalibrationCommon/lib/datacontainers/holography_dataset.py +++ b/CAL/CalibrationCommon/lib/datacontainers/holography_dataset.py @@ -1,7 +1,9 @@ import logging -import h5py +import os +import h5py from lofar.calibration.common.datacontainers.holography_observation import HolographyObservation + from .holography_dataset_definitions import * from .holography_specification import HolographySpecification @@ -207,7 +209,8 @@ class HolographyDataset(): # the geometrical distance are not really cutting it since RA # and DEC are coordinates of a spherical coordinate system. # But here the pseudo distance is good enough. - pseudo_distance[frequency_string][beamlet_string] = abs(ra - source_ra) + abs(dec - source_dec) + pseudo_distance[frequency_string][beamlet_string] = abs(ra - source_ra) + abs( + dec - source_dec) # OK. Done with all the iteration business. Now check if across all # _frequencies the same beamlet is the central one. It is allowed that @@ -227,7 +230,8 @@ class HolographyDataset(): # All is good. Only one central beamlet. central_beamlet[frequency_string] = keys[values.index(minimal_distance)] else: - text = "Found %d beamlets that have the same distance from the source position. Therefore a unique central beamlet does not exist." % (values.count(minimal_distance)) + text = "Found %d beamlets that have the same distance from the source position. Therefore a unique central beamlet does not exist." % ( + values.count(minimal_distance)) logger.error(text) raise ValueError(text) @@ -237,7 +241,9 @@ class HolographyDataset(): # the set will be 1. central_beamlet_set = set(central_beamlet.values()) if len(central_beamlet_set) == 1: - logger.debug("All is good, unicorns everywhere, there is only one central beamlet \"%s\" for all _frequencies.", central_beamlet_set) + logger.debug( + "All is good, unicorns everywhere, there is only one central beamlet \"%s\" for all _frequencies.", + central_beamlet_set) else: logger.warning("Multiple central beamlets have been identified: ", central_beamlet) return central_beamlet @@ -561,7 +567,6 @@ class HolographyDataset(): result.frequencies = list(f[HDS_FREQUENCY]) - result.ra_dec = dict() for frequency in f["RA_DEC"].keys(): for beamlet in f["RA_DEC"][frequency].keys():