Skip to content

Commit

Permalink
Merge pull request #155 from AstarVienna/fh/cmds
Browse files Browse the repository at this point in the history
Several fixes in preparation of the CainMap
  • Loading branch information
teutoburg committed Feb 28, 2024
2 parents 5af28bd + 7a3af43 commit 3e61db9
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 358 deletions.
Empty file removed Armazones/tests/__init__.py
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"# Instrument packages\n",
"Scopesim is a general simulation framework. In order to simulate observations with any particular instrument, you will have to load an instrument package, as well as packages describing the telescope and observatory location (the latter is important for the atmospheric conditions). In the case of METIS, the packages can be downloaded with \n",
"```python\n",
"sim.download_package(['instruments/METIS', 'telescopes/ELT', 'locations/Armazones'])\n",
"sim.download_packages(['instruments/METIS', 'telescopes/ELT', 'locations/Armazones'])\n",
"```\n",
"By default, scopesim looks for the packages in the subdirectory `inst_pkgs` of the current working directory. The download command will install them there, so there should be no problem. \n",
"\n",
Expand Down Expand Up @@ -204,7 +204,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -218,7 +218,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.10"
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions METIS/docs/example_notebooks/LSS_AGN-01_preparation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
"metadata": {},
"outputs": [],
"source": [
"cmd = sim.UserCommands(use_instrument=\"METIS\", set_modes=\"img_n\", \n",
"cmd = sim.UserCommands(use_instrument=\"METIS\", set_modes=[\"img_n\"], \n",
" properties={\"!OBS.slit\": \"E-114_2\"})\n",
"metis = sim.OpticalTrain(cmd)\n",
"\n",
Expand Down Expand Up @@ -475,7 +475,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -489,7 +489,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions METIS/docs/example_notebooks/LSS_AGN-02_simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -173,7 +173,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down
332 changes: 15 additions & 317 deletions METIS/docs/example_notebooks/RawHeaders.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions METIS/docs/example_notebooks/demos/demo_auto_exposure.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"metadata": {},
"outputs": [],
"source": [
"cmd = sim.UserCommands(use_instrument=\"METIS\", set_modes=\"img_lm\")"
"cmd = sim.UserCommands(use_instrument=\"METIS\", set_modes=[\"img_lm\"])"
]
},
{
Expand Down Expand Up @@ -331,7 +331,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.2"
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions METIS/docs/example_notebooks/demos/demo_detector_modes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
"metadata": {},
"outputs": [],
"source": [
"cmd = sim.UserCommands(use_instrument=\"METIS\", set_modes=\"lss_l\",\n",
"cmd = sim.UserCommands(use_instrument=\"METIS\", set_modes=[\"lss_l\"],\n",
" properties={\"!OBS.exptime\": 1000})\n",
"metis = sim.OpticalTrain(cmd)"
]
Expand Down Expand Up @@ -385,7 +385,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.2"
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
"metadata": {},
"outputs": [],
"source": [
"cmd_m = sim.UserCommands(use_instrument='METIS', set_modes='lss_m')\n",
"cmd_m = sim.UserCommands(use_instrument='METIS', set_modes=['lss_m'])\n",
"metis_m = sim.OpticalTrain(cmd_m)"
]
},
Expand Down Expand Up @@ -299,7 +299,7 @@
"metadata": {},
"outputs": [],
"source": [
"cmd_n = sim.UserCommands(use_instrument='METIS', set_modes='lss_n')\n",
"cmd_n = sim.UserCommands(use_instrument='METIS', set_modes=['lss_n'])\n",
"metis_n = sim.OpticalTrain(cmd_n)"
]
},
Expand Down Expand Up @@ -385,7 +385,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.2"
"version": "3.11.4"
}
},
"nbformat": 4,
Expand Down
1 change: 0 additions & 1 deletion MICADO/test_micado/test_micado_compiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,3 @@ def test_returns_ndit_dit_scaled_image(self, ndit, dit):
plt.show()

assert imp_av == approx(hdu_av, rel=0.05)

32 changes: 16 additions & 16 deletions OSIRIS/tests/test_maat_daves_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ def test_maat_runs_with_point_source():
amplitude=11.78 * u.ABmag, x=3, y=2.1)

cmds = sim.UserCommands(use_instrument="OSIRIS", set_modes=["MAAT"])
cmds.cmds["!ATMO.seeing"] = 1.
cmds.cmds["!OBS.exptime"] = 80
cmds.cmds["!OBS.dit"] = 80
cmds.cmds["!OBS.ndit"] = 1
cmds.cmds["!OBS.airmass"] = 1.2
cmds.cmds["!OBS.grating_name"] = 'R2000B'
cmds["!ATMO.seeing"] = 1.
cmds["!OBS.exptime"] = 80
cmds["!OBS.dit"] = 80
cmds["!OBS.ndit"] = 1
cmds["!OBS.airmass"] = 1.2
cmds["!OBS.grating_name"] = 'R2000B'

osiris = sim.OpticalTrain(cmds)
osiris.observe(src)
Expand All @@ -44,12 +44,12 @@ def test_maat_runs_with_extended_source():
pixel_scale=0.1, r_eff=3.5, n=2, ellip=0.3, theta=45, extend=5)

cmds = sim.UserCommands(use_instrument="OSIRIS", set_modes=["MAAT"])
cmds.cmds["!ATMO.seeing"] = 1.
cmds.cmds["!OBS.exptime"] = 80
cmds.cmds["!OBS.dit"] = 80
cmds.cmds["!OBS.ndit"] = 1
cmds.cmds["!OBS.airmass"] = 1.2
cmds.cmds["!OBS.grating_name"] = 'R2000B'
cmds["!ATMO.seeing"] = 1.
cmds["!OBS.exptime"] = 80
cmds["!OBS.dit"] = 80
cmds["!OBS.ndit"] = 1
cmds["!OBS.airmass"] = 1.2
cmds["!OBS.grating_name"] = 'R2000B'

osiris = sim.OpticalTrain(cmds)
osiris.observe(src)
Expand All @@ -65,10 +65,10 @@ def test_maat_runs_with_line_list_source():
arc = uniform_source(sed=arcspec, filter_curve='V', amplitude=16*u.ABmag, extend=520)

cmds = sim.UserCommands(use_instrument="OSIRIS", set_modes=["MAAT"])
cmds.cmds["!OBS.exptime"] = 60
cmds.cmds["!OBS.dit"] = 60
cmds.cmds["!OBS.ndit"] = 1
cmds.cmds["!OBS.grating_name"] = 'R2000B'
cmds["!OBS.exptime"] = 60
cmds["!OBS.dit"] = 60
cmds["!OBS.ndit"] = 1
cmds["!OBS.grating_name"] = 'R2000B'

osiris = sim.OpticalTrain(cmds)
osiris["lapalma_skycalc_curves"].include = False
Expand Down
16 changes: 8 additions & 8 deletions OSIRIS/tests/test_maat_traces.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ def test_plot_traces(self):
amplitude=16 * u.ABmag, extend=520)

cmds = sim.UserCommands(use_instrument="OSIRIS", set_modes=["MAAT"])
cmds.cmds["!OBS.exptime"] = 60
cmds.cmds["!OBS.dit"] = 60
cmds.cmds["!OBS.ndit"] = 1
cmds.cmds["!OBS.grating_name"] = 'R2000B'
cmds["!OBS.exptime"] = 60
cmds["!OBS.dit"] = 60
cmds["!OBS.ndit"] = 1
cmds["!OBS.grating_name"] = 'R2000B'

osiris = sim.OpticalTrain(cmds)
osiris["lapalma_skycalc_curves"].include = False
Expand Down Expand Up @@ -75,10 +75,10 @@ def test_basic_trace_image(self):
amplitude=16 * u.ABmag, extend=520)

cmds = sim.UserCommands(use_instrument="OSIRIS", set_modes=["MAAT"])
cmds.cmds["!OBS.exptime"] = 60
cmds.cmds["!OBS.dit"] = 60
cmds.cmds["!OBS.ndit"] = 1
cmds.cmds["!OBS.grating_name"] = 'R2500V'
cmds["!OBS.exptime"] = 60
cmds["!OBS.dit"] = 60
cmds["!OBS.ndit"] = 1
cmds["!OBS.grating_name"] = 'R2500V'

osiris = sim.OpticalTrain(cmds)
osiris["lapalma_skycalc_curves"].include = False
Expand Down

0 comments on commit 3e61db9

Please sign in to comment.