diff --git a/LWA/LWA_bifrost.py b/LWA/LWA_bifrost.py index 88b298b2..97b74c2e 100755 --- a/LWA/LWA_bifrost.py +++ b/LWA/LWA_bifrost.py @@ -18,6 +18,7 @@ import argparse from collections import deque from scipy.fftpack import fft +from astropy.constants import c as speed_of_light import datetime import ctypes @@ -44,7 +45,6 @@ BFNoSpinZone() # noqa # LWA Software Library Includes -from lsl.common.constants import c as speedOfLight from lsl.reader.ldp import TBNFile, TBFFile from lsl.common.stations import lwasv @@ -127,7 +127,7 @@ def GenerateLocations( """ delta = (2 * grid_size * numpy.sin(numpy.pi * grid_resolution / 360)) ** -1 - chan_wavelengths = speedOfLight / frequencies + chan_wavelengths = speed_of_light.value / frequencies sample_grid = chan_wavelengths * delta sll = sample_grid[0] / chan_wavelengths[0] lsl_locs = lsl_locs.T @@ -859,13 +859,13 @@ def main(self): for i in range(nstand): # X a = self.antennas[2 * i + 0] - delay = a.cable.delay(freq) - a.stand.z / speedOfLight + delay = a.cable.delay(freq) - a.stand.z / speed_of_light.value phases[:, :, i, 0, :, :] = numpy.exp(2j * numpy.pi * freq * delay) phases[:, :, i, 0, :, :] /= numpy.sqrt(a.cable.gain(freq)) if npol == 2: # Y a = self.antennas[2 * i + 1] - delay = a.cable.delay(freq) - a.stand.z / speedOfLight + delay = a.cable.delay(freq) - a.stand.z / speed_of_light.value phases[:, :, i, 1, :, :] = numpy.exp(2j * numpy.pi * freq * delay) phases[:, :, i, 1, :, :] /= numpy.sqrt(a.cable.gain(freq)) ## Explicit bad and suspect antenna masking - this will @@ -1633,7 +1633,7 @@ def handle_signal_terminate(signum, frame): # TODO: Some sort of switch for other stations? lwasv_antennas = lwasv.antennas - lwasv_stands = lwasv.getStands() + lwasv_stands = lwasv.stands # Setup threads diff --git a/LWA/LWA_bifrost_DFT.py b/LWA/LWA_bifrost_DFT.py index 67163610..fbade009 100755 --- a/LWA/LWA_bifrost_DFT.py +++ b/LWA/LWA_bifrost_DFT.py @@ -18,6 +18,7 @@ import argparse from collections import deque from scipy.fftpack import fft +from astropy.constants import c as speed_of_light import datetime import ctypes @@ -45,7 +46,6 @@ BFNoSpinZone() # noqa # LWA Software Library Includes -from lsl.common.constants import c as speedOfLight from lsl.reader.ldp import TBNFile, TBFFile from lsl.common.stations import lwasv @@ -167,7 +167,7 @@ def Generate_DFT_Locations(lsl_locs, frequencies, ntime, nchan, npol): """ lsl_locs = lsl_locs.T lsl_locs = lsl_locs.copy() - chan_wavelengths = speedOfLight / frequencies + chan_wavelengths = speed_of_light.value / frequencies dft_locs = numpy.zeros(shape=(nchan, npol, 3, lsl_locs.shape[1])) for j in numpy.arange(npol): for i in numpy.arange(nchan): @@ -209,7 +209,7 @@ def GenerateLocations( """ delta = (2 * grid_size * numpy.sin(numpy.pi * grid_resolution / 360)) ** -1 - chan_wavelengths = speedOfLight / frequencies + chan_wavelengths = speed_of_light.value / frequencies sample_grid = chan_wavelengths * delta sll = sample_grid[0] / chan_wavelengths[0] lsl_locs = lsl_locs.T @@ -988,13 +988,13 @@ def main(self): for i in range(nstand): # X a = self.antennas[2 * i + 0] - delay = a.cable.delay(freq) - a.stand.z / speedOfLight + delay = a.cable.delay(freq) - a.stand.z / speed_of_light.value phases[:, :, 0, i, :, :] = numpy.exp(2j * numpy.pi * freq * delay) phases[:, :, 0, i, :, :] /= numpy.sqrt(a.cable.gain(freq)) if npol == 2: # Y a = self.antennas[2 * i + 1] - delay = a.cable.delay(freq) - a.stand.z / speedOfLight + delay = a.cable.delay(freq) - a.stand.z / speed_of_light.value phases[:, :, 1, i, :, :] = numpy.exp(2j * numpy.pi * freq * delay) phases[:, :, 1, i, :, :] /= numpy.sqrt(a.cable.gain(freq)) # Explicit outrigger masking - we probably want to do @@ -1416,13 +1416,13 @@ def main(self): for i in range(nstand): # X a = self.antennas[2 * i + 0] - delay = a.cable.delay(freq) - a.stand.z / speedOfLight + delay = a.cable.delay(freq) - a.stand.z / speed_of_light.value phases[:, 0, i] = numpy.exp(2j * numpy.pi * freq * delay) phases[:, 0, i] /= numpy.sqrt(a.cable.gain(freq)) if npol == 2: # Y a = self.antennas[2 * i + 1] - delay = a.cable.delay(freq) - a.stand.z / speedOfLight + delay = a.cable.delay(freq) - a.stand.z / speed_of_light.value phases[:, 1, i] = numpy.exp(2j * numpy.pi * freq * delay) phases[:, 1, i] /= numpy.sqrt(a.cable.gain(freq)) # Explicit outrigger masking - we probably want to do @@ -2238,7 +2238,7 @@ def handle_signal_terminate(signum, frame): # TODO: Some sort of switch for other stations? lwasv_antennas = lwasv.antennas - lwasv_stands = lwasv.getStands() + lwasv_stands = lwasv.stands # Setup threads