def parse_subbands(self): origin_table = self.subtables['LOFAR_ORIGIN'] num_chans = CasaImage.unique_column_values(origin_table, "NUM_CHAN") if len(num_chans) == 1: return num_chans[0] else: raise Exception("Cannot handle varying numbers of channels in image")
def parse_antennaset(self): observation_table = self.subtables['LOFAR_OBSERVATION'] antennasets = CasaImage.unique_column_values(observation_table, "ANTENNA_SET") if len(antennasets) == 1: return antennasets[0] else: raise Exception("Cannot handle multiple antenna sets in image")
def parse_subbandwidth(self): # subband # see http://www.lofar.org/operations/doku.php?id=operator:background_to_observations&s[]=subband&s[]=width&s[]=clock&s[]=frequency freq_units = { 'Hz': 1, 'kHz': 10 ** 3, 'MHz': 10 ** 6, 'GHz': 10 ** 9, } observation_table = self.subtables['LOFAR_OBSERVATION'] clockcol = observation_table.col('CLOCK_FREQUENCY') clock_values = CasaImage.unique_column_values(observation_table, "CLOCK_FREQUENCY") if len(clock_values) == 1: clock = clock_values[0] unit = clockcol.getkeyword('QuantumUnits')[0] trueclock = freq_units[unit] * clock subbandwidth = trueclock / 1024 return subbandwidth else: raise Exception("Cannot handle varying clocks in image")