Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WCU mode to METIS #166

Draft
wants to merge 5 commits into
base: dev_master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions METIS/METIS_WCU.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
### METIS WCU MODE

object: instrument
alias: INST
name: wcu
description: warm calibration unit mode
date_modified: 2024-04-06
changes:
- 2024-04-06 (FH) created file

properties:

effects: []

---
### default simulation parameters needed for a METIS simulation
object: simulation
alias: SIM
name: METIS_simulation_parameters
description: RC simulation parameters which need to change for a METIS run

properties:
spectral:
spectral_bin_width: !!float 1E-3 # microns, defines fov wavelengths
spectral_resolution: 5000 # defines skycalc resolution
22 changes: 18 additions & 4 deletions METIS/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ object: configuration
alias: OBS
name: METIS_default_configuration
description: default parameters needed for a METIS simulation
date_modified: 2022-03-14
date_modified: 2024-04-03
changes:
- 2021-12-16 (OC) chopnod defaults to perpendicular
- 2021-12-16 (OC) default slits renamed
Expand All @@ -15,20 +15,19 @@ changes:
- 2022-02-20 (OC) pupil_transmission now an OBS parameter
- 2022-02-21 (OC) linear interpolation, cosmetics
- 2022-03-14 (OC) use single PSF file
- 2024-04-03 (FH) add wcu mode, move telescope yamls to individual modes

packages:
- Armazones
- ELT
- METIS

yamls:
- Armazones.yaml
- ELT.yaml # overrides below
- METIS.yaml

properties:
instrument: "METIS"
modes: ["img_lm"]
modes: ["light", "img_lm"]
airmass: 1.2
declination: -30
hour_angle: 0
Expand Down Expand Up @@ -60,6 +59,21 @@ properties:
nd_filter_name: open

mode_yamls:
- object: instrument
alias: OBS
name: light
description: "Normal observation mode, includes upstream telescope optics"
yamls:
- Armazones.yaml
- ELT.yaml

- object: instrument
alias: OBS
name: wcu
description: "METIS WCU calibration mode"
yamls:
- METIS_WCU.yaml

- object: observation
alias: OBS
name: img_lm
Expand Down
24 changes: 21 additions & 3 deletions METIS/tests/test_metis.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from matplotlib.colors import LogNorm

import scopesim
from scopesim.source.source_templates import star_field
from scopesim.source.source_templates import star_field, empty_sky
#import scopesim_templates as sim_tp

PLOTS = False
Expand Down Expand Up @@ -230,7 +230,7 @@ def test_something_comes_out_img_lm(self):
src = star_field(100, 0, 10, width=10, use_grid=True)

cmds = scopesim.UserCommands(use_instrument="METIS",
set_modes=['img_lm'])
set_modes=["light", "img_lm"])
metis = scopesim.OpticalTrain(cmds)
metis['detector_linearity'].include = False

Expand All @@ -257,7 +257,7 @@ def test_something_comes_out_img_n(self):
src = star_field(100, 0, 10, width=10, use_grid=True)

cmds = scopesim.UserCommands(use_instrument="METIS",
set_modes=["img_n"])
set_modes=["light", "img_n"])

metis = scopesim.OpticalTrain(cmds)
metis['chop_nod'].include = False
Expand All @@ -280,3 +280,21 @@ def test_something_comes_out_img_n(self):
plt.show()

assert mx > med + 3 * std

def test_wcu_modes_disables_upstream(self):
cmd = scopesim.UserCommands(
use_instrument="METIS",
set_modes=["wcu", "img_n"])
opt = scopesim.OpticalTrain(cmd)
opt.observe(empty_sky())
h_wcu = opt.readout()

cmd = scopesim.UserCommands(
use_instrument="METIS",
set_modes=["light", "img_n"])
opt = scopesim.OpticalTrain(cmd)
opt.observe(empty_sky())
h_obs = opt.readout()

# WCU must be less because atmo emission is not present
assert h_obs[0][1].data.mean() > h_wcu[0][1].data.mean()
Loading