diff --git a/METIS/METIS_WCU.yaml b/METIS/METIS_WCU.yaml new file mode 100644 index 00000000..f3d813c7 --- /dev/null +++ b/METIS/METIS_WCU.yaml @@ -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 diff --git a/METIS/default.yaml b/METIS/default.yaml index 25ec32c4..47b2d3da 100644 --- a/METIS/default.yaml +++ b/METIS/default.yaml @@ -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 @@ -15,6 +15,7 @@ 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 @@ -22,13 +23,11 @@ packages: - 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 @@ -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 diff --git a/METIS/tests/test_metis.py b/METIS/tests/test_metis.py index 67171949..c4d19303 100644 --- a/METIS/tests/test_metis.py +++ b/METIS/tests/test_metis.py @@ -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 @@ -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 @@ -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 @@ -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()