-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d14c125
commit b5eb179
Showing
9 changed files
with
181 additions
and
431 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
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
34 changes: 34 additions & 0 deletions
34
dsa2000_cal/dsa2000_cal/forward_models/synthetic_sky_model/tests/demo_tests.py
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,34 @@ | ||
from astropy import coordinates as ac, units as au | ||
|
||
from dsa2000_cal.assets.content_registry import fill_registries | ||
from dsa2000_cal.forward_models.synthetic_sky_model.synthetic_sky_model_producer import SyntheticSkyModelProducer | ||
|
||
|
||
def test_create_sky_model(): | ||
fill_registries() | ||
synthetic_sky_model_producer = SyntheticSkyModelProducer( | ||
phase_tracking=ac.ICRS(15 * au.deg, 0 * au.deg), | ||
freqs=au.Quantity([700], unit='MHz'), | ||
field_of_view=4 * au.deg, | ||
seed=42 | ||
) | ||
bright_point_sources = synthetic_sky_model_producer.create_sources_outside_fov(num_bright_sources=100, | ||
full_stokes=False) | ||
bright_point_sources.plot(save_file='bright_point_sources.png') | ||
assert bright_point_sources.num_sources == 100 | ||
inner_point_sources = synthetic_sky_model_producer.create_sources_inside_fov(num_sources=100, full_stokes=False) | ||
inner_point_sources.plot(save_file='inner_point_sources.png') | ||
|
||
(bright_point_sources + inner_point_sources).plot(save_file='all_point_sources.png') | ||
|
||
assert inner_point_sources.num_sources == 37 # Should debug | ||
inner_diffuse_sources = synthetic_sky_model_producer.create_diffuse_sources_inside_fov(num_sources=100, | ||
full_stokes=False) | ||
inner_diffuse_sources.plot(save_file='inner_diffuse_sources.png') | ||
assert inner_diffuse_sources.num_sources == 37 # Should debug | ||
rfi_emitter_sources = synthetic_sky_model_producer.create_rfi_emitter_sources(full_stokes=False) | ||
rfi_emitter_sources[0].plot(save_file='rfi_emitter_sources.png') | ||
assert len(rfi_emitter_sources) == 1 | ||
a_team_sources = synthetic_sky_model_producer.create_a_team_sources(a_team_sources=['cas_a']) | ||
a_team_sources[0].plot(save_file='cas_a.png') | ||
assert len(a_team_sources) == 1 |
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
Oops, something went wrong.