From cc541abdd55a728ceafa5fed35025d805a4c4a80 Mon Sep 17 00:00:00 2001 From: teutoburg Date: Thu, 8 May 2025 18:50:19 +0200 Subject: [PATCH 01/19] Add "lms_cube" mode to METIS --- METIS/default.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/METIS/default.yaml b/METIS/default.yaml index fc10a0ad..77de6b2c 100644 --- a/METIS/default.yaml +++ b/METIS/default.yaml @@ -360,6 +360,26 @@ mode_yamls: adc: false detector_readout_mode: slow + - object: observation + alias: OBS + name: lms_cube + description: "METIS LM-band integral-field spectroscopy, nominal mode, cube output" + status: experimental + yamls: + # - Armazones.yaml + - ELT.yaml + - METIS.yaml + - METIS_LMS_SMPL.yaml + - METIS_DET_IFU_SMPL.yaml + properties: + ins_mode: LMS # use as FITS header keyword + psf_file: PSF_LM_9mag_06seeing.fits + slit: false + adc: false + trace_file: TRACE_LMS.fits + wavelen: 4.2 + detector_readout_mode: slow + --- ### default simulation parameters needed for a METIS simulation object: simulation From cd2c6acf4660080a7e3ee02872a26b1822036023 Mon Sep 17 00:00:00 2001 From: teutoburg Date: Thu, 8 May 2025 18:50:42 +0200 Subject: [PATCH 02/19] Create METIS_LMS_SMPL.yaml --- METIS/METIS_LMS_SMPL.yaml | 77 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 METIS/METIS_LMS_SMPL.yaml diff --git a/METIS/METIS_LMS_SMPL.yaml b/METIS/METIS_LMS_SMPL.yaml new file mode 100644 index 00000000..a468351f --- /dev/null +++ b/METIS/METIS_LMS_SMPL.yaml @@ -0,0 +1,77 @@ +--- +### METIS LMS NOMINAL MODE +object: instrument +alias: INST +name: METIS_LMS +description: base configuration for METIS LMS +date_modified: 2024-05-08 +changes: + - 2024-05-08 (FH) create file as copy of METIS_LMS.yaml + +properties: + pixel_scale: 0.0082 # arcsec / pixel + plate_scale: 0.455555555556 # arcsec / mm + fp2_platescale: 0.303 # arcsec / mm + decouple_detector_from_sky_headers: True # needed for spectroscopy + flatten: False # cube output + +effects: + - name: metis_lms_surfaces + description: list of extra mirrors needed for the SPEC LMS mode + class: SurfaceList + kwargs: + filename: LIST_METIS_mirrors_lms.dat + + - name: lms_efficiency + description: grating efficiency of METIS LMS + class: MetisLMSEfficiency + kwargs: + filename: "!OBS.trace_file" + wavelen: "!OBS.wavelen" + + - name: lms_image_slicer + description: field of view of the image slicer + class: MetisLMSImageSlicer + kwargs: + filename: "!OBS.trace_file" + ext_id: "Aperture List" + + - name: psf + description: field constant, wavelength dependent PSF for imaging mode + class: FieldConstantPSF + include: False + kwargs: + filename: "!OBS.psf_file" + wave_key: "WAVELENG" + bkg_width: -1 + + - name: lms_spectral_traces + description: list of spectral order trace geometry on the focal plane + class: MetisLMSSpectralTraceList + include: True + kwargs: + filename: "!OBS.trace_file" + wave_colname: "wavelength" + wavelen: "!OBS.wavelen" + s_colname: "xi" + col_number_start: 1 + slice_samples: 5 # number of samples along slice width + + - name: lms_fits_keywords + description: FITS keywords specific to LMS elements + class: ExtraFitsKeywords + include: False + kwargs: + filename: headers/FITS_lms_keywords.yaml + +--- +### 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-5 # microns, defines fov wavelengths + spectral_resolution: 200000 # defines skycalc resolution From fffe4d1c36bd5f343040c3ec4638902da6eec42e Mon Sep 17 00:00:00 2001 From: teutoburg Date: Thu, 8 May 2025 18:50:58 +0200 Subject: [PATCH 03/19] Create METIS_DET_IFU_SMPL.yaml --- METIS/METIS_DET_IFU_SMPL.yaml | 96 +++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 METIS/METIS_DET_IFU_SMPL.yaml diff --git a/METIS/METIS_DET_IFU_SMPL.yaml b/METIS/METIS_DET_IFU_SMPL.yaml new file mode 100644 index 00000000..8c73e36a --- /dev/null +++ b/METIS/METIS_DET_IFU_SMPL.yaml @@ -0,0 +1,96 @@ +--- +### H2RG DETECTOR +object: detector +alias: DET +name: metis_lms_detector_array +description: Simplified IFU cube detector +date_modified: 2024-05-08 +changes: + - 2024-05-08 (FH) create file as copy of METIS_DET_IFU.yaml + +properties: + image_plane_id: 0 + temperature: -233 + dit: "!OBS.dit" + ndit: "!OBS.ndit" + mindit: 1.3 # seconds, Roy van Boekel, pers. communication + full_well: !!float 1.E5 # electrons, E-TNT-MPIA-1004, v1-0 + gain: + 1: 2.0 # electrons/ADU, email B.Serra 2024-10-09 + 2: 2.0 + 3: 2.0 + 4: 2.0 + dark_current: 0.1 # [e-/s] + readout_noise: 70 # electrons, AI on RvB: check + layout: + file_name: "FPA_metis_lms_smpl_layout.dat" + qe_curve: + file_name: "QE_detector_H2RG_METIS.dat" + linearity: + file_name: "FPA_linearity_HxRG.dat" + +effects: + - name: detector_array_list + description: METIS LMS detector array list + class: DetectorList3D + include: true + kwargs: + filename: "!DET.layout.file_name" + + - name: quantum_efficiency + description: Quantum efficiency curves for each detector + class: QuantumEfficiencyCurve + kwargs: + filename: "!DET.qe_curve.file_name" + + - name: auto_exposure + description: automatic determination of DIT and NDIT + class: AutoExposure + include: False + kwargs: + fill_frac: "!OBS.auto_exposure.fill_frac" + + - name: exposure_action + description: Summing up sky signal for all DITs and NDITs + class: SummedExposure + + - name: dark_current + description: METIS LMS dark current + class: DarkCurrent + include: False + kwargs: + value: "!DET.dark_current" + + - name: shot_noise + description: apply poisson shot noise to images + class: ShotNoise + + - name: detector_linearity + description: Linearity characteristics of H2RG chips + class: LinearityCurve + include: False + kwargs: + filename: "!DET.linearity.file_name" + + - name: readout_noise + description: Readout noise frames + class: BasicReadoutNoise + include: False + kwargs: + noise_std: "!DET.readout_noise" + n_channels: 32 + + - name: ad_conversion + description: Apply gain and convert electron count into integers + class: ADConversion + include: False + kwargs: + dtype: uint16 + gain: "!DET.gain" + + - name: det_ifu_fits_keywords + descriptions: FITS keywords specific to IFU detectors + class: ExtraFitsKeywords + include: False + kwargs: + filename: headers/FITS_det_ifu_keywords.yaml From fe86c66a10b4d670155124af578628cf1f4cc6bd Mon Sep 17 00:00:00 2001 From: teutoburg Date: Thu, 8 May 2025 18:51:16 +0200 Subject: [PATCH 04/19] Create FPA_metis_lms_smpl_layout.dat --- METIS/FPA_metis_lms_smpl_layout.dat | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 METIS/FPA_metis_lms_smpl_layout.dat diff --git a/METIS/FPA_metis_lms_smpl_layout.dat b/METIS/FPA_metis_lms_smpl_layout.dat new file mode 100644 index 00000000..ca296186 --- /dev/null +++ b/METIS/FPA_metis_lms_smpl_layout.dat @@ -0,0 +1,22 @@ +# name : METIS LMS H2RG-18 FPA +# author : Fabian Haberhauer +# sources: NA +# date_created : 2024-05-08 +# date_modified : 2024-05-08 +# type : detector:chip_list +# x_cen_unit : mm +# y_cen_unit : mm +# z_cen_unit : um +# x_size_unit : pix +# y_size_unit : pix +# z_size_unit : pix +# pixel_size_unit : mm +# angle_unit : deg +# gain_unit : electron/adu +# image_plane_id : 0 +# +# changes: +# - 2024-05-08 (FH) create file +# +id x_cen y_cen z_cen x_size y_size z_size pixel_size angle gain + 0 0 0 0 109 109 5600 0.018 0.0 1.0 From 90fd6cbb0e6a1a55bdccbcad7c73ab39016affd6 Mon Sep 17 00:00:00 2001 From: teutoburg Date: Thu, 15 May 2025 16:22:28 +0200 Subject: [PATCH 05/19] Update METIS_LMS_SMPL.yaml --- METIS/METIS_LMS_SMPL.yaml | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/METIS/METIS_LMS_SMPL.yaml b/METIS/METIS_LMS_SMPL.yaml index a468351f..412472c1 100644 --- a/METIS/METIS_LMS_SMPL.yaml +++ b/METIS/METIS_LMS_SMPL.yaml @@ -4,9 +4,10 @@ object: instrument alias: INST name: METIS_LMS description: base configuration for METIS LMS -date_modified: 2024-05-08 +date_modified: 2025-05-08 changes: - - 2024-05-08 (FH) create file as copy of METIS_LMS.yaml + - 2025-05-08 (FH) create file as copy of METIS_LMS.yaml + - 2025-05-15 (FH) remove unneeded effects properties: pixel_scale: 0.0082 # arcsec / pixel @@ -29,41 +30,14 @@ effects: filename: "!OBS.trace_file" wavelen: "!OBS.wavelen" - - name: lms_image_slicer - description: field of view of the image slicer - class: MetisLMSImageSlicer - kwargs: - filename: "!OBS.trace_file" - ext_id: "Aperture List" - - name: psf description: field constant, wavelength dependent PSF for imaging mode class: FieldConstantPSF - include: False kwargs: filename: "!OBS.psf_file" wave_key: "WAVELENG" bkg_width: -1 - - name: lms_spectral_traces - description: list of spectral order trace geometry on the focal plane - class: MetisLMSSpectralTraceList - include: True - kwargs: - filename: "!OBS.trace_file" - wave_colname: "wavelength" - wavelen: "!OBS.wavelen" - s_colname: "xi" - col_number_start: 1 - slice_samples: 5 # number of samples along slice width - - - name: lms_fits_keywords - description: FITS keywords specific to LMS elements - class: ExtraFitsKeywords - include: False - kwargs: - filename: headers/FITS_lms_keywords.yaml - --- ### default simulation parameters needed for a METIS simulation object: simulation @@ -73,5 +47,5 @@ description: RC simulation parameters which need to change for a METIS run properties: spectral: - spectral_bin_width: !!float 1E-5 # microns, defines fov wavelengths - spectral_resolution: 200000 # defines skycalc resolution + spectral_bin_width: 1E-5 # microns, defines fov wavelengths + spectral_resolution: 200000 # defines skycalc resolution From 23eeaf6db7e21ef4e822c2df596c18c34c407b96 Mon Sep 17 00:00:00 2001 From: teutoburg Date: Thu, 15 May 2025 16:23:19 +0200 Subject: [PATCH 06/19] Fix dates --- METIS/FPA_metis_lms_smpl_layout.dat | 7 +++---- METIS/METIS_DET_IFU_SMPL.yaml | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/METIS/FPA_metis_lms_smpl_layout.dat b/METIS/FPA_metis_lms_smpl_layout.dat index ca296186..f9d36225 100644 --- a/METIS/FPA_metis_lms_smpl_layout.dat +++ b/METIS/FPA_metis_lms_smpl_layout.dat @@ -1,9 +1,8 @@ # name : METIS LMS H2RG-18 FPA # author : Fabian Haberhauer # sources: NA -# date_created : 2024-05-08 -# date_modified : 2024-05-08 -# type : detector:chip_list +# date_created : 2025-05-08 +# date_modified : 2025-05-08 # x_cen_unit : mm # y_cen_unit : mm # z_cen_unit : um @@ -16,7 +15,7 @@ # image_plane_id : 0 # # changes: -# - 2024-05-08 (FH) create file +# - 2025-05-08 (FH) create file # id x_cen y_cen z_cen x_size y_size z_size pixel_size angle gain 0 0 0 0 109 109 5600 0.018 0.0 1.0 diff --git a/METIS/METIS_DET_IFU_SMPL.yaml b/METIS/METIS_DET_IFU_SMPL.yaml index 8c73e36a..e6c5aa8c 100644 --- a/METIS/METIS_DET_IFU_SMPL.yaml +++ b/METIS/METIS_DET_IFU_SMPL.yaml @@ -4,9 +4,9 @@ object: detector alias: DET name: metis_lms_detector_array description: Simplified IFU cube detector -date_modified: 2024-05-08 +date_modified: 2025-05-08 changes: - - 2024-05-08 (FH) create file as copy of METIS_DET_IFU.yaml + - 2025-05-08 (FH) create file as copy of METIS_DET_IFU.yaml properties: image_plane_id: 0 From 121dd518ad945e6a701711e812465615fc44e444 Mon Sep 17 00:00:00 2001 From: teutoburg Date: Thu, 15 May 2025 16:23:34 +0200 Subject: [PATCH 07/19] Re-include atmosphere --- METIS/default.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/METIS/default.yaml b/METIS/default.yaml index 77de6b2c..160df9b4 100644 --- a/METIS/default.yaml +++ b/METIS/default.yaml @@ -366,7 +366,7 @@ mode_yamls: description: "METIS LM-band integral-field spectroscopy, nominal mode, cube output" status: experimental yamls: - # - Armazones.yaml + - Armazones.yaml - ELT.yaml - METIS.yaml - METIS_LMS_SMPL.yaml From 61a071bcfe47275a984e79cb113d038104aa1b6e Mon Sep 17 00:00:00 2001 From: teutoburg Date: Thu, 15 May 2025 16:27:35 +0200 Subject: [PATCH 08/19] Update METIS_DET_IFU_SMPL.yaml --- METIS/METIS_DET_IFU_SMPL.yaml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/METIS/METIS_DET_IFU_SMPL.yaml b/METIS/METIS_DET_IFU_SMPL.yaml index e6c5aa8c..3b645164 100644 --- a/METIS/METIS_DET_IFU_SMPL.yaml +++ b/METIS/METIS_DET_IFU_SMPL.yaml @@ -7,6 +7,7 @@ description: Simplified IFU cube detector date_modified: 2025-05-08 changes: - 2025-05-08 (FH) create file as copy of METIS_DET_IFU.yaml + - 2025-05-15 (FH) update included effects properties: image_plane_id: 0 @@ -33,7 +34,6 @@ effects: - name: detector_array_list description: METIS LMS detector array list class: DetectorList3D - include: true kwargs: filename: "!DET.layout.file_name" @@ -57,7 +57,6 @@ effects: - name: dark_current description: METIS LMS dark current class: DarkCurrent - include: False kwargs: value: "!DET.dark_current" @@ -75,7 +74,6 @@ effects: - name: readout_noise description: Readout noise frames class: BasicReadoutNoise - include: False kwargs: noise_std: "!DET.readout_noise" n_channels: 32 @@ -87,10 +85,3 @@ effects: kwargs: dtype: uint16 gain: "!DET.gain" - - - name: det_ifu_fits_keywords - descriptions: FITS keywords specific to IFU detectors - class: ExtraFitsKeywords - include: False - kwargs: - filename: headers/FITS_det_ifu_keywords.yaml From a29d2a5fa182fd2ec3de861eb9271cfc9995a28a Mon Sep 17 00:00:00 2001 From: teutoburg Date: Fri, 16 May 2025 14:50:03 +0200 Subject: [PATCH 09/19] Fix gain --- METIS/METIS_DET_IFU_SMPL.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/METIS/METIS_DET_IFU_SMPL.yaml b/METIS/METIS_DET_IFU_SMPL.yaml index 3b645164..f3c17c4f 100644 --- a/METIS/METIS_DET_IFU_SMPL.yaml +++ b/METIS/METIS_DET_IFU_SMPL.yaml @@ -7,7 +7,7 @@ description: Simplified IFU cube detector date_modified: 2025-05-08 changes: - 2025-05-08 (FH) create file as copy of METIS_DET_IFU.yaml - - 2025-05-15 (FH) update included effects + - 2025-05-16 (FH) update included effects properties: image_plane_id: 0 @@ -16,11 +16,7 @@ properties: ndit: "!OBS.ndit" mindit: 1.3 # seconds, Roy van Boekel, pers. communication full_well: !!float 1.E5 # electrons, E-TNT-MPIA-1004, v1-0 - gain: - 1: 2.0 # electrons/ADU, email B.Serra 2024-10-09 - 2: 2.0 - 3: 2.0 - 4: 2.0 + gain: 2 dark_current: 0.1 # [e-/s] readout_noise: 70 # electrons, AI on RvB: check layout: From 28ea2aa44d003390032731f690d8cae5b1952690 Mon Sep 17 00:00:00 2001 From: teutoburg Date: Fri, 16 May 2025 14:50:36 +0200 Subject: [PATCH 10/19] Add flux binning effect --- METIS/METIS_LMS_SMPL.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/METIS/METIS_LMS_SMPL.yaml b/METIS/METIS_LMS_SMPL.yaml index 412472c1..719d4ef7 100644 --- a/METIS/METIS_LMS_SMPL.yaml +++ b/METIS/METIS_LMS_SMPL.yaml @@ -7,7 +7,7 @@ description: base configuration for METIS LMS date_modified: 2025-05-08 changes: - 2025-05-08 (FH) create file as copy of METIS_LMS.yaml - - 2025-05-15 (FH) remove unneeded effects + - 2025-05-16 (FH) remove unneeded effects, add flux binning effect properties: pixel_scale: 0.0082 # arcsec / pixel @@ -38,6 +38,10 @@ effects: wave_key: "WAVELENG" bkg_width: -1 + - name: flux_binning + description: turn per arcsec per um to ph per s + class: FluxBinning3D + --- ### default simulation parameters needed for a METIS simulation object: simulation From 29bfae9cecfb48f55f817fc0eccefe6dc341420a Mon Sep 17 00:00:00 2001 From: teutoburg Date: Sun, 18 May 2025 16:16:12 +0200 Subject: [PATCH 11/19] wip --- METIS/default.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/METIS/default.yaml b/METIS/default.yaml index 160df9b4..f3504a3c 100644 --- a/METIS/default.yaml +++ b/METIS/default.yaml @@ -6,6 +6,7 @@ alias: OBS name: METIS_default_configuration description: default parameters needed for a METIS simulation status: development +needs_scopesim: "0.9" date_modified: 2024-09-04 changes: - 2021-12-16 (OC) chopnod defaults to perpendicular @@ -365,6 +366,7 @@ mode_yamls: name: lms_cube description: "METIS LM-band integral-field spectroscopy, nominal mode, cube output" status: experimental + needs_scopesim: "0.10.0a1" yamls: - Armazones.yaml - ELT.yaml From b7b9a4ca036928d10ac0627693800111bc171b21 Mon Sep 17 00:00:00 2001 From: teutoburg Date: Mon, 19 May 2025 18:35:48 +0200 Subject: [PATCH 12/19] Re-include ADConversion and AutoExposure --- METIS/METIS_DET_IFU_SMPL.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/METIS/METIS_DET_IFU_SMPL.yaml b/METIS/METIS_DET_IFU_SMPL.yaml index f3c17c4f..e8401671 100644 --- a/METIS/METIS_DET_IFU_SMPL.yaml +++ b/METIS/METIS_DET_IFU_SMPL.yaml @@ -42,7 +42,7 @@ effects: - name: auto_exposure description: automatic determination of DIT and NDIT class: AutoExposure - include: False + include: True kwargs: fill_frac: "!OBS.auto_exposure.fill_frac" @@ -77,7 +77,7 @@ effects: - name: ad_conversion description: Apply gain and convert electron count into integers class: ADConversion - include: False + include: True kwargs: dtype: uint16 gain: "!DET.gain" From 4ab7758a4d1521cd2d31e3046f3d486f528daa93 Mon Sep 17 00:00:00 2001 From: oczoske Date: Wed, 21 May 2025 14:44:45 +0200 Subject: [PATCH 13/19] Include LineSpreadFunction --- METIS/METIS_LMS_SMPL.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/METIS/METIS_LMS_SMPL.yaml b/METIS/METIS_LMS_SMPL.yaml index 719d4ef7..08127324 100644 --- a/METIS/METIS_LMS_SMPL.yaml +++ b/METIS/METIS_LMS_SMPL.yaml @@ -38,6 +38,14 @@ effects: wave_key: "WAVELENG" bkg_width: -1 + - name: lsf + description: line-spread function for spectroscopic domain + class: LineSpreadFunction + kwargs: + wavelen: "!OBS.wavelen" + fit_slope: 0.96 # pix/um TODO: Change back to lambda + fit_intercept: -0.12 # pix + - name: flux_binning description: turn per arcsec per um to ph per s class: FluxBinning3D From 34ede17cb5d16c5b61e3b28a80422b6311235137 Mon Sep 17 00:00:00 2001 From: oczoske Date: Wed, 21 May 2025 14:54:29 +0200 Subject: [PATCH 14/19] Slice width explicit (somewhat redundant) --- METIS/METIS_LMS_SMPL.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/METIS/METIS_LMS_SMPL.yaml b/METIS/METIS_LMS_SMPL.yaml index 08127324..56a5d348 100644 --- a/METIS/METIS_LMS_SMPL.yaml +++ b/METIS/METIS_LMS_SMPL.yaml @@ -13,6 +13,7 @@ properties: pixel_scale: 0.0082 # arcsec / pixel plate_scale: 0.455555555556 # arcsec / mm fp2_platescale: 0.303 # arcsec / mm + slice_width: 0.0207 # arcsec / slice decouple_detector_from_sky_headers: True # needed for spectroscopy flatten: False # cube output From e2ae38ca2964bcc372599391dd5cb91a50944076 Mon Sep 17 00:00:00 2001 From: oczoske Date: Wed, 21 May 2025 21:47:48 +0200 Subject: [PATCH 15/19] script to compute dispersion fit parameters --- METIS/code/fit_ifu_dispersion.py | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 METIS/code/fit_ifu_dispersion.py diff --git a/METIS/code/fit_ifu_dispersion.py b/METIS/code/fit_ifu_dispersion.py new file mode 100644 index 00000000..30bf46dc --- /dev/null +++ b/METIS/code/fit_ifu_dispersion.py @@ -0,0 +1,46 @@ +"""Compute IFU mean dispersion as a function of central wavelength + +The LineSpreadFunction effect needs the dispersion dlam_per_pix on +the LMS detector to determine the width of the LSF kernel to be +applied to the cube in mode `lms_cube`. The script computes the mean +dispersion as (lam_max - lam_min)/4220 for a number of wavelength settings, +and then performs a linear regression of dlam_per_pix against wavelength. +LineSpreadFunction() uses the slope and intercept to get a sufficient +approximation to the dispersion without having to reference TRACE_LMS.fits +or instantiate MetisLMSSpectralTraces itself. +""" +# Author: Oliver Czoske +# Date: 2025-05-21 + +import numpy as np +from scipy.stats import linregress +from matplotlib import pyplot as plt +import scopesim as sim + +if __name__ == "__main__": + sim.link_irdb("../../") # from METIS/code/ + + NPIX = 4220 # twice 2048 plus gap, from FPA_metis_lms_layout.dat + wavelens = np.linspace(2.677, 5.332, 100) # um + dlam_per_pix = np.zeros_like(wavelens) + + for i, lamc in enumerate(wavelens): + cmd = sim.UserCommands(use_instrument="METIS", + set_modes=["lms"], + properties={"!OBS.wavelen": lamc}) + metis = sim.OpticalTrain(cmd) + splist = metis['lms_spectral_traces'] + lam_min = splist.meta['wave_min'] + lam_max = splist.meta['wave_max'] + + dlam_per_pix[i] = (lam_max - lam_min) / NPIX + + linfit = linregress(wavelens, dlam_per_pix) + slope = linfit.slope + intercept = linfit.intercept + print("Slope: ", slope, "# um/pix") + print("Intercept:", intercept, "# um") + + plt.plot(wavelens, dlam_per_pix, 'o') + plt.plot(wavelens, intercept + slope * wavelens) + plt.show() From 9ff96158dd2b5fe821c5424b34ca41b18103bfc5 Mon Sep 17 00:00:00 2001 From: oczoske Date: Wed, 21 May 2025 23:15:28 +0200 Subject: [PATCH 16/19] Complete parameters for LSF --- METIS/METIS_LMS_SMPL.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/METIS/METIS_LMS_SMPL.yaml b/METIS/METIS_LMS_SMPL.yaml index 56a5d348..4984bc42 100644 --- a/METIS/METIS_LMS_SMPL.yaml +++ b/METIS/METIS_LMS_SMPL.yaml @@ -44,8 +44,11 @@ effects: class: LineSpreadFunction kwargs: wavelen: "!OBS.wavelen" - fit_slope: 0.96 # pix/um TODO: Change back to lambda - fit_intercept: -0.12 # pix + fit_slope: 3.795e-06 # use to compute dlam_per_pix [um/pix] as + fit_intercept: -4.659e-07 # a function of wavelength [um] + slice_width: "!INST.slice_width" + pixel_scale: "!INST.pixel_scale" + spec_binwidth: "!SIM.spectral.spectral_bin_width" - name: flux_binning description: turn per arcsec per um to ph per s From f176c84391c74cfc322543df95b6781d9effe0ca Mon Sep 17 00:00:00 2001 From: oczoske Date: Sun, 25 May 2025 10:18:37 +0200 Subject: [PATCH 17/19] add required 'v' for needs_scopesim --- METIS/default.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/METIS/default.yaml b/METIS/default.yaml index f3504a3c..64407d68 100644 --- a/METIS/default.yaml +++ b/METIS/default.yaml @@ -6,7 +6,7 @@ alias: OBS name: METIS_default_configuration description: default parameters needed for a METIS simulation status: development -needs_scopesim: "0.9" +needs_scopesim: "v0.9" date_modified: 2024-09-04 changes: - 2021-12-16 (OC) chopnod defaults to perpendicular @@ -366,7 +366,7 @@ mode_yamls: name: lms_cube description: "METIS LM-band integral-field spectroscopy, nominal mode, cube output" status: experimental - needs_scopesim: "0.10.0a1" + needs_scopesim: "v0.10.0a1" yamls: - Armazones.yaml - ELT.yaml From 55f06ae97079f6ec22298a01f651fe5069fa095d Mon Sep 17 00:00:00 2001 From: teutoburg Date: Sun, 25 May 2025 15:58:54 +0200 Subject: [PATCH 18/19] Fix ins_mode, add psf switch --- METIS/default.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/METIS/default.yaml b/METIS/default.yaml index 64407d68..d4648297 100644 --- a/METIS/default.yaml +++ b/METIS/default.yaml @@ -374,8 +374,9 @@ mode_yamls: - METIS_LMS_SMPL.yaml - METIS_DET_IFU_SMPL.yaml properties: - ins_mode: LMS # use as FITS header keyword + ins_mode: LMS_cube # use as FITS header keyword psf_file: PSF_LM_9mag_06seeing.fits + interp_psf: False slit: false adc: false trace_file: TRACE_LMS.fits From 3e2a4f2a8e5e413d33d5811db1ece0b2c4028a09 Mon Sep 17 00:00:00 2001 From: oczoske Date: Wed, 18 Jun 2025 17:09:05 +0200 Subject: [PATCH 19/19] Output float32 --- METIS/METIS_DET_IFU_SMPL.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/METIS/METIS_DET_IFU_SMPL.yaml b/METIS/METIS_DET_IFU_SMPL.yaml index e8401671..23b9cb80 100644 --- a/METIS/METIS_DET_IFU_SMPL.yaml +++ b/METIS/METIS_DET_IFU_SMPL.yaml @@ -79,5 +79,5 @@ effects: class: ADConversion include: True kwargs: - dtype: uint16 + dtype: float32 gain: "!DET.gain"