-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from HERA-Team/fix_uvbeam_norm
Remove spurious beam normalisation logic in `uvbeam_to_lm`
- Loading branch information
Showing
11 changed files
with
174 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
[run] | ||
branch = True | ||
source = vis_cpu | ||
# omit = bad_file.py | ||
omit = */vis_gpu.py | ||
|
||
[paths] | ||
source = | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fixes: | ||
- "/home/runner/work/vis_cpu/::" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
"""Compare vis_cpu with pyuvsim visibilities.""" | ||
import numpy as np | ||
from pyuvsim.analyticbeam import AnalyticBeam | ||
|
||
from vis_cpu import conversions, plot | ||
|
||
nsource = 10 | ||
|
||
|
||
def test_source_az_za_beam(): | ||
"""Test function that calculates the Az and ZA positions of sources.""" | ||
# Observation latitude and LST | ||
hera_lat = -30.7215 | ||
lst = 0.78 | ||
|
||
# Add random sources | ||
ra = np.random.uniform(low=0.0, high=360.0, size=nsource - 1) | ||
dec = -30.72 + np.random.random(nsource - 1) * 10.0 | ||
ra = np.deg2rad(ra) | ||
dec = np.deg2rad(dec) | ||
|
||
# Point source coordinate transform, from equatorial to Cartesian | ||
crd_eq = conversions.point_source_crd_eq(ra, dec) | ||
|
||
# Beam model | ||
beam = AnalyticBeam(type="gaussian", diameter=14.0) | ||
|
||
# Calculate source locations and positions | ||
az, za, beamval = plot._source_az_za_beam( | ||
lst, crd_eq, beam, ref_freq=100.0e6, latitude=np.deg2rad(hera_lat) | ||
) | ||
assert np.all(np.isfinite(az)) | ||
assert np.all(np.isfinite(za)) | ||
# (Values of beamval should be NaN below the horizon) | ||
|
||
|
||
def test_animate_source_map(): | ||
"""Test function that animates source positions vs LST.""" | ||
# Observation latitude and LSTs | ||
hera_lat = -30.7215 | ||
lsts = np.linspace(0.0, 2.0 * np.pi, 5) | ||
|
||
# Add random sources | ||
ra = np.random.uniform(low=0.0, high=360.0, size=nsource - 1) | ||
dec = -30.72 + np.random.random(nsource - 1) * 10.0 | ||
ra = np.deg2rad(ra) | ||
dec = np.deg2rad(dec) | ||
|
||
# Beam model | ||
beam = AnalyticBeam(type="gaussian", diameter=14.0) | ||
|
||
# Generate animation | ||
anim = plot.animate_source_map( | ||
ra, | ||
dec, | ||
lsts, | ||
beam, | ||
interval=200, | ||
ref_freq=100.0e6, | ||
latitude=np.deg2rad(hera_lat), | ||
) | ||
assert anim is not None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters