Skip to content

Commit

Permalink
Merge branch 'dev_master' into oc/metis_wcu_alt1
Browse files Browse the repository at this point in the history
  • Loading branch information
oczoske authored Jan 14, 2025
2 parents b4bbbf2 + baf4517 commit 6f06ff1
Show file tree
Hide file tree
Showing 20 changed files with 80 additions and 64 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ['3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -39,7 +39,7 @@ jobs:
- name: Run Pytest
run: pytest
- name: Store badge report files
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: badge-report
path: _REPORTS
Expand All @@ -53,12 +53,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ['3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -83,9 +83,9 @@ jobs:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
if: github.ref == 'dev_master' || github.ref == 'master' || github.base_ref == ''
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
# No matrix is used since this is a time-consuming tosk.
python-version: 3.11
Expand Down Expand Up @@ -124,9 +124,9 @@ jobs:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
if: github.ref == 'dev_master' || github.ref == 'master' || github.base_ref == ''
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
# No matrix is used since this is a time-consuming tosk.
python-version: 3.11
Expand Down
1 change: 1 addition & 0 deletions HAWKI/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ object : configuration
alias : OBS
name : HAWKI_default_configuration
description : default parameters needed for a HAWKI simulation
status: experimental
date_modified: 2022-02-22
changes:
- 2022-02-22 (MV) formatting
Expand Down
1 change: 1 addition & 0 deletions LFOA/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ object : configuration
alias : OBS
name : LFOA_default_configuration
description : default parameters needed for a LFOA simulation
status: experimental

packages :
- LFOA
Expand Down
8 changes: 8 additions & 0 deletions METIS/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ object: configuration
alias: OBS
name: METIS_default_configuration
description: default parameters needed for a METIS simulation
status: development
date_modified: 2024-09-04
changes:
- 2021-12-16 (OC) chopnod defaults to perpendicular
Expand Down Expand Up @@ -65,6 +66,7 @@ mode_yamls:
alias: OBS
name: img_lm
description: "METIS LM-band imaging"
status: development
yamls:
- Armazones.yaml
- ELT.yaml
Expand All @@ -83,6 +85,7 @@ mode_yamls:
alias: OBS
name: img_n
description: "METIS N-band imaging"
status: development
yamls:
- Armazones.yaml
- ELT.yaml
Expand All @@ -103,6 +106,7 @@ mode_yamls:
alias: OBS
name: lss_l
description: "METIS L-band slit spectroscopy"
status: development
yamls:
- Armazones.yaml
- ELT.yaml
Expand All @@ -124,6 +128,7 @@ mode_yamls:
alias: OBS
name: lss_m
description: "METIS M-band slit spectroscopy"
status: development
yamls:
- Armazones.yaml
- ELT.yaml
Expand All @@ -145,6 +150,7 @@ mode_yamls:
alias: OBS
name: lss_n
description: "METIS N-band slit spectroscopy"
status: development
yamls:
- Armazones.yaml
- ELT.yaml
Expand All @@ -166,6 +172,7 @@ mode_yamls:
alias: OBS
name: lms
description: "METIS LM-band integral-field spectroscopy, nominal mode"
status: experimental
yamls:
- Armazones.yaml
- ELT.yaml
Expand All @@ -184,6 +191,7 @@ mode_yamls:
alias: OBS
name: lms_extended
description: "METIS LM-band integral-field spectroscopy, extended mode"
status: experimental
yamls:
- Armazones.yaml
- ELT.yaml
Expand Down
6 changes: 4 additions & 2 deletions METIS/docs/example_notebooks/LSS_AGN-01_preparation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@
"metadata": {},
"outputs": [],
"source": [
"src = sim.Source(cube=\"AGN_sim_prepared.fits\")"
"with fits.open(\"AGN_sim_prepared.fits\") as cube_hdul:\n",
" src = sim.Source(cube=cube_hdul)"
]
},
{
Expand Down Expand Up @@ -439,7 +440,8 @@
"metadata": {},
"outputs": [],
"source": [
"src50 = sim.Source(cube=\"AGN_sim_rotated_50.fits\")"
"with fits.open(\"AGN_sim_rotated_50.fits\") as cube_hdul:\n",
" src50 = sim.Source(cube=cube_hdul)"
]
},
{
Expand Down
15 changes: 9 additions & 6 deletions METIS/docs/example_notebooks/LSS_AGN-02_simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"source": [
"from matplotlib import pyplot as plt\n",
"from matplotlib.colors import LogNorm\n",
"from astropy.io import fits\n",
"%matplotlib inline"
]
},
Expand Down Expand Up @@ -54,7 +55,7 @@
"outputs": [],
"source": [
"cmd = sim.UserCommands(use_instrument=\"METIS\", set_modes=['lss_n'],\n",
" properties={\"!OBS.exptime\": 3600,\n",
" properties={\"!OBS.exptime\": 3600, \"!OBS.dit\": None, \"!OBS.ndit\": None,\n",
" \"!SIM.spectral.spectral_bin_width\": 3.0e-3})\n",
"metis = sim.OpticalTrain(cmd)"
]
Expand All @@ -75,8 +76,10 @@
"cube_01 = \"AGN_sim_prepared.fits\"\n",
"cube_02 = \"AGN_sim_rotated_50.fits\"\n",
"\n",
"src_01 = sim.Source(cube=cube_01)\n",
"src_02 = sim.Source(cube=cube_02)\n",
"with fits.open(cube_01) as cube_hdul:\n",
" src_01 = sim.Source(cube=cube_hdul)\n",
"with fits.open(cube_02) as cube_hdul:\n",
" src_02 = sim.Source(cube=cube_hdul)\n",
"\n",
"sky = sim.source.source_templates.empty_sky()"
]
Expand Down Expand Up @@ -133,9 +136,9 @@
"source": [
"plt.figure(figsize=(16, 8))\n",
"plt.subplot(121)\n",
"plt.imshow(hdul_01[1].data - hdul_sky[1].data + 1e5, origin='lower', norm=LogNorm(vmin=1e5, vmax=5e8))\n",
"plt.imshow(hdul_01[1].data - hdul_sky[1].data + 1e5, origin='lower', norm=\"log\")\n",
"plt.subplot(122)\n",
"plt.imshow(hdul_02[1].data - hdul_sky[1].data + 1e5, origin='lower', norm=LogNorm(vmin=1e5, vmax=5e8))"
"plt.imshow(hdul_02[1].data - hdul_sky[1].data + 1e5, origin='lower', norm=\"log\")"
]
},
{
Expand Down Expand Up @@ -173,7 +176,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.12.7"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion METIS/tests/test_readout_exptime.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
PKGS_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
sim.rc.__config__["!SIM.file.local_packages_path"] = PKGS_DIR

PLOTS = True
PLOTS = False


class TestReadoutExptime:
Expand Down
10 changes: 10 additions & 0 deletions MICADO/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ object : configuration
alias : OBS
name : MICADO_default_configuration
description : default parameters needed for a MICADO simulation
status: development
date_modified: 2023-07-13
changes:
- 2023-07-13 (OC) add modes for FDR slits, deprecate pre-FDR slits
Expand Down Expand Up @@ -61,6 +62,7 @@ mode_yamls :
alias: OBS
name : IMG_4mas
description : "wide-field imager : 4mas/pix"
status: development
yamls :
- MICADO_IMG_wide.yaml
properties :
Expand All @@ -72,6 +74,7 @@ mode_yamls :
alias: OBS
name : IMG_1.5mas
description : "high resolution imager : 1.5mas/pix"
status: development
yamls :
- MICADO_IMG_zoom.yaml
properties :
Expand All @@ -83,13 +86,15 @@ mode_yamls :
alias: OBS
name : IMG_HCI
description : "High contrast imaging"
status: experimental
yamls :
- MICADO_IMG_HCI.yaml

- object : observation
alias: OBS
name : SPEC_15000x20
description : "spectrograph : slit size 15000x20mas"
status: development
yamls :
- MICADO_SPEC.yaml
properties :
Expand All @@ -103,6 +108,7 @@ mode_yamls :
alias: OBS
name : SPEC_3000x48
description : "spectrograph : slit size 3000x48mas"
status: development
yamls :
- MICADO_SPEC.yaml
properties :
Expand All @@ -116,6 +122,7 @@ mode_yamls :
alias : OBS
name : SPEC_3000x16
description : "spectrograph : slit size 3000x16mas"
status: development
yamls :
- MICADO_SPEC.yaml
properties :
Expand All @@ -129,6 +136,7 @@ mode_yamls :
alias: OBS
name : SPEC_15000x50
description : "spectrograph : slit size 15000x50mas"
status: deprecated
deprecate : "Deprecated instrument mode. For spectroscopy use
- SPEC_3000x16
- SPEC_3000x48
Expand All @@ -146,6 +154,7 @@ mode_yamls :
alias: OBS
name : SPEC_3000x50
description : "spectrograph : slit size 3000x50mas"
status: deprecated
deprecate : "Deprecated instrument mode. For spectroscopy use
- SPEC_3000x16
- SPEC_3000x48
Expand All @@ -163,6 +172,7 @@ mode_yamls :
alias: OBS
name : SPEC_3000x20
description : "spectrograph : slit size 3000x20mas"
status: deprecated
deprecate : "Deprecated instrument mode. For spectroscopy use
- SPEC_3000x16
- SPEC_3000x48
Expand Down
4 changes: 4 additions & 0 deletions MICADO_Sci/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# MICADO Science package

> [!CAUTION]
> The MICADO_Sci package is **NO LONGER SUPPORTED**!! Use the MICADO package instead. MICADO_Sci will be removed soon!
1 change: 1 addition & 0 deletions MICADO_Sci/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ object : configuration
alias : OBS
name : MICADO_sci_default_configuration
description : default parameters needed for a MICADO-Sci simulation
status : deprecated

packages :
- Armazones
Expand Down
43 changes: 0 additions & 43 deletions MICADO_Sci/sci_readme.md

This file was deleted.

2 changes: 2 additions & 0 deletions MICADO_Sci/test_micado_sci/test_micado_sci.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import scopesim as sim
from scopesim import rc

pytest.skip(allow_module_level=True)

TOP_PATH = pth.abspath(pth.join(pth.dirname(__file__), "../../"))
rc.__config__["!SIM.file.local_packages_path"] = TOP_PATH

Expand Down
2 changes: 2 additions & 0 deletions MICADO_Sci/test_micado_sci/test_radiometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import scopesim as sim
from scopesim import rc

pytest.skip(allow_module_level=True)

TOP_PATH = pth.abspath(pth.join(pth.dirname(__file__), "../../"))
rc.__config__["!SIM.file.local_packages_path"] = TOP_PATH

Expand Down
2 changes: 2 additions & 0 deletions MICADO_Sci/test_micado_sci/test_spectral_trace_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from scopesim.tests.mocks.py_objects import header_objects as ho
from scopesim import rc

pytest.skip(allow_module_level=True)

PLOTS = False
DATA_DIR = pth.abspath(pth.join(pth.dirname(__file__), "../"))
rc.__search_path__.insert(0, DATA_DIR)
Expand Down
1 change: 1 addition & 0 deletions OSIRIS/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ object : configuration
alias : OBS
name : OSIRIS_default_configuration
description : default parameters needed for a OSIRIS simulation
status: experimental
date_created: 2022-03-02
date_modified: 2022-03-02
changes:
Expand Down
Loading

0 comments on commit 6f06ff1

Please sign in to comment.