Skip to content

Commit

Permalink
merge local and remote changes
Browse files Browse the repository at this point in the history
  • Loading branch information
adampbeardsley committed Jul 1, 2020
1 parent c20f7ae commit 5911868
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions LWA/LWA_bifrost.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
16 changes: 8 additions & 8 deletions LWA/LWA_bifrost_DFT.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 5911868

Please sign in to comment.