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

Oc/metis wcu alt1 #205

Open
wants to merge 20 commits into
base: dev_master
Choose a base branch
from
Open
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
21 changes: 21 additions & 0 deletions METIS/LIST_METIS_mirrors_wcu.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# author : Oliver Czoske
# source : E-REP-UZK-MET-1008_3-0
# date_created : 2024-09-09
# date_modified : 2024-09-09
# status : FDR design
# type : mirror:list
# outer_unit : m
# inner_unit : m
# angle_unit : degree
# temperature_unit : deg_C
# changes:
# - 2024-09-09 (OC) created
#
name outer inner angle temperature action filename
WCU_table_fold_1 0.217 0.0 45 !WCU.temperature reflection TER_mirror_gold.dat
WCU_table_fold_2 0.271 0.0 45 !WCU.temperature reflection TER_mirror_gold.dat
WCU_CM1 0.274 0.0 0 !WCU.temperature reflection TER_mirror_gold.dat
WCU_CM2 0.100 0.0 0 !WCU.temperature reflection TER_mirror_gold.dat
WCU_CM3 0.196 0.0 0 !WCU.temperature reflection TER_mirror_gold.dat
WCU_fold_down 0.184 0.0 45 !WCU.temperature reflection TER_mirror_gold.dat
WCU_periscopic_feed 0.217 0.0 45 !WCU.temperature reflection TER_mirror_gold.dat
46 changes: 46 additions & 0 deletions METIS/METIS_WCU.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
### METIS Warm Calibration Unit effects

object: warm calibration unit
alias : WCU
name: METIS_WCU
description: base configuration for METIS/WCU
date_modified: 2024-11-25
changes:
- 2024-09-03 (OC) file created
- 2024-11-06 (OC) add BlackBodySource
- 2024-11-25 (OC) config file, test TEL.area
- 2024-11-26 (OC) rename to WCUSource

properties:
temperature: 15 # Celsius! needed for relay optics
config_file: "metis_wcu_config.yaml"

effects:
- name: wcu_source
description: Source of the WCU
class: WCUSource
kwargs:
config_file: "!WCU.config_file"

- name: wcu_relay_optics
description: surface list for METIS WCU relay optics
class: SurfaceList
kwargs:
filename: LIST_METIS_mirrors_wcu.dat

- name: pupil_masks
description: pupil masks (transmission only)
class: PupilMaskWheel
kwargs:
pupil_masks:
names: [APP-LMS, APP-LM, CLS-LMS, CLS-LM, CLS-N, PPS-LMS, PPS-LM, PPS-N, PPS-CFO2, RLS-LMS, RLS-LM, SPM-LMS, SPM-LM, SPM-N, open]
transmissions: [0.6098, 0.6312, 0.5879, 0.6073, 0.5795, 0.7342, 0.7509, 0.7429, 0.6170, 0.4362, 0.4476, 0.6098, 0.6312, 0.6076, 0.8201]
current_mask: "open"

---
# Required parameters to replace telescope
alias: TEL
properties:
#area: 975.23478998
area: 1354.593 #### TEST, needed to agree with RvB's calculation
98 changes: 98 additions & 0 deletions METIS/code/wcu_bb_to_is_throughput.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
"""Utility functions for the WCU radiometry

These functions create lookup tables that are stored in the irdb.
"""
import os
from datetime import datetime
import numpy as np
from astropy.table import Table
from astropy.io import fits
from scopesim.utils import seq

def bb_to_is_throughput(rho_tube, **kwargs):
"""Compute the effective transmission through the tube between BB source
and integrating-sphere entrance port


"""
diam = 25.4 # diameter of the tube [mm].
height = 28.2 # height of the tube [mm]
drad = 0.1 # grid step in radius [mm]
dalpha = 0.01 # grid step in "zenith angle" [rad]
dphi = 0.02 # grid step in azimuthal angle [rad]

alpha = seq(dalpha/2, (np.pi - dalpha)/2, dalpha)
rad = seq(drad/2, (diam - drad)/2, drad)
phi = seq(dphi/2, np.pi - dphi/2, dphi)

nalpha = len(alpha)
nrad = len(rad)
nphi = len(phi)

# expand to grid
xyz = np.array(np.meshgrid(alpha, rad, phi)).reshape((3, nalpha * nrad * nphi))
alpha = xyz[0,]
rad = xyz[1,]
phi = xyz[2,]
if "special" in kwargs:
nref = n_reflections(alpha, 0, phi, diam, height)
else:
nref = n_reflections(alpha, rad, phi, diam, height)

result = np.zeros_like(rho_tube)
for i, rho in enumerate(rho_tube):
integrand = rho**nref * 0.5 * np.sin(2 * alpha) * rad * drad * dalpha * dphi
result[i] = np.sum(integrand)
return result * 16 / (np.pi * diam**2)



def n_reflections(alpha, rad, phi, diam, height):
"""Compute number of reflections of a photon emitted at radius r in direction alpha,phi"""

beta = np.arcsin(2 * rad /diam * np.sin(phi))

numerator = height - diam * np.sin(phi + beta)/(2 * np.sin(phi)) * np.tan(np.pi/2 - alpha)
denominator = diam * np.cos(beta) * np.tan(np.pi/2 - alpha)
return (np.floor(1 + numerator/denominator)).astype(int)


#def integrating_sphere(wavelength):
# """Compute the magnification factor due to the integrating sphere"""


def make_pri_hdu():
"""Create primary header with meta data"""
pri_hdu = fits.PrimaryHDU()

meta = {"author": "Oliver Czoske",
"descript": "METIS WCU, throughput from Blackbody to integrating sphere",
"source": "E-REP-MPIA-MET-1203",
"date-cre": "2024-11-19",
"date-mod": datetime.today().strftime("%Y-%m-%d"),
"status": "model",
"code": os.path.basename(__file__)
}
pri_hdu.header.update(meta)
return pri_hdu

def do_main():
"""Create and write out lookup table for BB to IS transfer"""
rho_tube = seq(0, 1, 0.02)
t_general_no_gap = bb_to_is_throughput(rho_tube)
t_special_no_gap = bb_to_is_throughput(rho_tube, special=True)

arr = {"rho_tube": rho_tube,
"t_gen_no_gap": t_general_no_gap,
"t_spec_no_gap": t_special_no_gap}
tab = Table(arr)
table_hdu = fits.table_to_hdu(tab)
table_hdu.header["EXTNAME"] = "BB_to_IS_throughput"
pri_hdu = make_pri_hdu()
hdul = fits.HDUList([pri_hdu, table_hdu])
hdul.writeto("WCU_BB_to_IS_throughput.fits", overwrite=True)



if __name__ == "__main__":
do_main()
159 changes: 154 additions & 5 deletions METIS/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ alias: OBS
name: METIS_default_configuration
description: default parameters needed for a METIS simulation
status: development
date_modified: 2022-03-14
date_modified: 2024-09-04
changes:
- 2021-12-16 (OC) chopnod defaults to perpendicular
- 2021-12-16 (OC) default slits renamed
Expand All @@ -16,16 +16,17 @@ 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-09-04 (OC) rearrange to include WCU modes

packages:
- Armazones
- ELT
- METIS

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

properties:
instrument: "METIS"
Expand Down Expand Up @@ -67,6 +68,9 @@ mode_yamls:
description: "METIS LM-band imaging"
status: development
yamls:
- Armazones.yaml
- ELT.yaml
- METIS.yaml
- METIS_IMG_LM.yaml
- METIS_DET_IMG_LM.yaml
properties:
Expand All @@ -83,6 +87,9 @@ mode_yamls:
description: "METIS N-band imaging"
status: development
yamls:
- Armazones.yaml
- ELT.yaml
- METIS.yaml
- METIS_IMG_N.yaml
- METIS_DET_IMG_N_GeoSnap.yaml
properties:
Expand All @@ -101,6 +108,9 @@ mode_yamls:
description: "METIS L-band slit spectroscopy"
status: development
yamls:
- Armazones.yaml
- ELT.yaml
- METIS.yaml
- METIS_IMG_LM.yaml
- METIS_LSS.yaml
- METIS_DET_IMG_LM.yaml
Expand All @@ -120,6 +130,9 @@ mode_yamls:
description: "METIS M-band slit spectroscopy"
status: development
yamls:
- Armazones.yaml
- ELT.yaml
- METIS.yaml
- METIS_IMG_LM.yaml
- METIS_LSS.yaml
- METIS_DET_IMG_LM.yaml
Expand All @@ -139,6 +152,9 @@ mode_yamls:
description: "METIS N-band slit spectroscopy"
status: development
yamls:
- Armazones.yaml
- ELT.yaml
- METIS.yaml
- METIS_IMG_N.yaml
- METIS_LSS.yaml
- METIS_DET_IMG_N_GeoSnap.yaml
Expand All @@ -158,6 +174,9 @@ mode_yamls:
description: "METIS LM-band integral-field spectroscopy, nominal mode"
status: experimental
yamls:
- Armazones.yaml
- ELT.yaml
- METIS.yaml
- METIS_LMS.yaml
- METIS_DET_IFU.yaml
properties:
Expand All @@ -174,6 +193,136 @@ mode_yamls:
description: "METIS LM-band integral-field spectroscopy, extended mode"
status: experimental
yamls:
- Armazones.yaml
- ELT.yaml
- METIS.yaml
- METIS_LMS_EXT.yaml
- METIS_DET_IFU.yaml
properties:
slit: false
adc: false
detector_readout_mode: slow

- object: observation
alias: OBS
name: wcu_img_lm
description: "METIS LM-band imaging with WCU"
yamls:
- METIS_WCU.yaml
- METIS.yaml
- METIS_IMG_LM.yaml
- METIS_DET_IMG_LM.yaml
properties:
psf_file: PSF_SCAO_9mag_06seeing.fits # REPLACE!
filter_name: Lp
nd_filter_name: open
slit: false
adc: false
detector_readout_mode: fast

- object: observation
alias: OBS
name: wcu_img_n
description: "METIS N-band imaging"
yamls:
- METIS_WCU.yaml
- METIS.yaml
- METIS_IMG_N.yaml
- METIS_DET_IMG_N_GeoSnap.yaml
properties:
psf_file: PSF_SCAO_9mag_06seeing.fits # REPLACE!
filter_name: N2
nd_filter_name: open
slit: false
adc: false
chop_offsets: [3, 0] # perpendicular chopping and nodding
nod_offsets: [0, 3]
detector_readout_mode: high_capacity

- object: observation
alias: OBS
name: wcu_lss_l
description: "METIS L-band slit spectroscopy"
yamls:
- METIS_WCU.yaml
- METIS.yaml
- METIS_IMG_LM.yaml
- METIS_LSS.yaml
- METIS_DET_IMG_LM.yaml
properties:
psf_file: PSF_LM_9mag_06seeing.fits # REPLACE!
trace_file: TRACE_LSS_L.fits
efficiency_file: TER_grating_L.fits
slit: C-38_1
adc: const_90
filter_name: L_spec
nd_filter_name: open
detector_readout_mode: slow

- object: observation
alias: OBS
name: wcu_lss_m
description: "METIS M-band slit spectroscopy"
yamls:
- METIS_WCU.yaml
- METIS.yaml
- METIS_IMG_LM.yaml
- METIS_LSS.yaml
- METIS_DET_IMG_LM.yaml
properties:
psf_file: PSF_LM_9mag_06seeing.fits # REPLACE!
trace_file: TRACE_LSS_M.fits
efficiency_file: TER_grating_M.fits
slit: C-38_1
adc: const_90
filter_name: M_spec
nd_filter_name: open
detector_readout_mode: slow

- object: observation
alias: OBS
name: wcu_lss_n
description: "METIS N-band slit spectroscopy"
yamls:
- METIS_WCU.yaml
- METIS.yaml
- METIS_IMG_N.yaml
- METIS_LSS.yaml
- METIS_DET_IMG_N_GeoSnap.yaml
properties:
psf_file: PSF_N_9mag_06seeing.fits # REPLACE!
trace_file: TRACE_LSS_N.fits
efficiency_file: TER_grating_N.fits
slit: D-57_1
adc: false
filter_name: N_spec
nd_filter_name: open
detector_readout_mode: low_capacity

- object: observation
alias: OBS
name: wcu_lms
description: "METIS LM-band integral-field spectroscopy, nominal mode"
yamls:
- METIS_WCU.yaml
- METIS.yaml
- METIS_LMS.yaml
- METIS_DET_IFU.yaml
properties:
psf_file: PSF_LM_9mag_06seeing.fits # REPLACE!
slit: false
adc: false
trace_file: TRACE_LMS.fits
wavelen: 4.2
detector_readout_mode: slow

- object: observation # is this a separate mode from nominal LMS?
alias: OBS
name: wcu_lms_extended
description: "METIS LM-band integral-field spectroscopy, extended mode"
yamls:
- METIS_WCU.yaml
- METIS.yaml
- METIS_LMS_EXT.yaml
- METIS_DET_IFU.yaml
properties:
Expand Down
Loading
Loading