Skip to content

Commit

Permalink
Telescope Class: Accept OSKAR and RASCIL backends (#522)
Browse files Browse the repository at this point in the history
* Introduce enum for backend, which currently will contain OSKAR and RASCIL

* Allow Telescope class to hold OSKAR and RASCIL specific telescopes

* Modify telescope tests to use new functionality for reading telescope data

* Do not run github actions if in a draft PR

* Finalize RASCIL functionality in Telescope

* Add tests for RASCIL telescopes

* Improve tests for RASCIL telescopes

* Use Telescope constructor in all scripts, and correctly format version into Telescope if needed

* Update notebooks
  • Loading branch information
lmachadopolettivalle authored Nov 20, 2023
1 parent 2bb1733 commit f1e3cc2
Show file tree
Hide file tree
Showing 24 changed files with 367 additions and 117 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:

jobs:
Test_Karabo:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout Code
Expand Down
2 changes: 1 addition & 1 deletion doc/src/examples/_example_scripts/example_interfe_simu.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# get different predefined telescopes,
# like here the OSKAR example telescope.png, with a handy functions
telescope = Telescope.get_OSKAR_Example_Telescope()
telescope = Telescope.constructor("EXAMPLE")

# overwrite or set any of the implemented configuration values
telescope.centre_longitude = 3
Expand Down
2 changes: 1 addition & 1 deletion doc/src/examples/_example_scripts/example_tel_set.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from karabo.simulation.telescope import Telescope

telescope = Telescope.get_OSKAR_Example_Telescope()
telescope = Telescope.constructor("EXAMPLE")
telescope.plot_telescope(file="example_telescope.png")
2 changes: 1 addition & 1 deletion karabo/examples/source_detection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
}
],
"source": [
"askap_tel = Telescope.get_ASKAP_Telescope()\n",
"askap_tel = Telescope.constructor(\"ASKAP\")\n",
"askap_tel.plot_telescope()"
]
},
Expand Down
2 changes: 1 addition & 1 deletion karabo/examples/source_detection_big_files.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
}
],
"source": [
"askap_tel = Telescope.get_ASKAP_Telescope()\n",
"askap_tel = Telescope.constructor(\"ASKAP\")\n",
"askap_tel.plot_telescope()"
]
},
Expand Down
2 changes: 1 addition & 1 deletion karabo/performance_test/time_karabo.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def main(n_random_sources: int) -> None:
sky.explore_sky(phase_center, s=0.1)

sky.setup_default_wcs(phase_center=phase_center)
telescope = Telescope.get_OSKAR_Example_Telescope()
telescope = Telescope.constructor("EXAMPLE")

observation_settings = Observation(
start_frequency_hz=100e6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def main(n_channels: int, memory_limit: Optional[int] = None) -> None:
sky.setup_default_wcs(phase_center=phase_center)

print("Setting up telescope...")
askap_tel = Telescope.get_ASKAP_Telescope()
askap_tel = Telescope.constructor("ASKAP")

print("Setting up observation...")
observation_settings = Observation(
Expand Down
2 changes: 1 addition & 1 deletion karabo/performance_test/time_karabo_slurm_h5.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def main() -> None:
)

sky.setup_default_wcs(phase_center=phase_center)
telescope = Telescope.get_OSKAR_Example_Telescope()
telescope = Telescope.constructor("EXAMPLE")

observation_settings = Observation(
start_frequency_hz=100e6,
Expand Down
2 changes: 1 addition & 1 deletion karabo/simulation/line_emission.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def karabo_reconstruction(
sky = SkyModel.sky_test()

if telescope is None:
telescope = Telescope.get_MEERKAT_Telescope()
telescope = Telescope.constructor("MeerKAT")

if verbose:
print("Sky Simulation...")
Expand Down
Loading

0 comments on commit f1e3cc2

Please sign in to comment.