diff --git a/MICADO/MASK_slit_Short_offset.dat b/MICADO/MASK_slit_Short_offset.dat index 252042d0..bc0c3680 100644 --- a/MICADO/MASK_slit_Short_offset.dat +++ b/MICADO/MASK_slit_Short_offset.dat @@ -7,14 +7,18 @@ # type : aperture:slit_geometry # x_unit : arcsec # y_unit : arcsec +# offset_type : detector +# offset_x : 0 +# offset_y : 4.5 # changes : # - 2019-07-10 (KL) Created the file # - 2020-03-24 (KL) Changed geometry to 3000x20mas # - 2023-07-13 (OC) Changed geometry to 3000x16mas # - 2026-02-03 (OC) Initialised from MASK_slit_3000x16.dat +# - 2026-05-07 (OC) Put offset into meta data # x y --1.5 1.192 -1.5 1.192 -1.5 1.208 --1.5 1.208 +-1.5 -0.008 ++1.5 -0.008 ++1.5 +0.008 +-1.5 +0.008 diff --git a/MICADO/MICADO_IFU.yaml b/MICADO/MICADO_IFU.yaml new file mode 100644 index 00000000..2155fc7a --- /dev/null +++ b/MICADO/MICADO_IFU.yaml @@ -0,0 +1,42 @@ +--- +### MICADO IFU mode +object: instrument +alias: INST +name: MICADO_IFU +description: additional effects for the IFU mode +date_modified: 2026-04-07 +changes: + - 2026-04-07 (OC) include image slicer + +properties: + pixel_scale: 0.004 # arcsec / pixel + plate_scale: 0.266666666666 # arcsec / pixel + decouple_detector_from_sky_headers: True # needed for spectroscopy + +effects: + - name: image_slicer + description: field of view of the image slicer + class: MetisLMSImageSlicer + kwargs: + filename: "!OBS.trace_file" + ext_id: "Aperture List" + + - name: spectral_traces + description: spectral order trace geometry on the focal plane + class: MicadoIFUSpectralTraceList + kwargs: + filename: "!OBS.trace_file" + wave_colname: "wavelength" + s_colname: "xi" + col_number_start: 1 + slice_samples: 5 # number of samples along slice width + +--- +### set observation mode +object: observation +alias: OBS +name: MICADO_IFU + +properties: + obs_mode: "IFU" + fits_ins_mode: "IFU" diff --git a/MICADO/TRACE_MICADO_IFU.fits b/MICADO/TRACE_MICADO_IFU.fits new file mode 100644 index 00000000..e8bc6fe0 Binary files /dev/null and b/MICADO/TRACE_MICADO_IFU.fits differ diff --git a/MICADO/default.yaml b/MICADO/default.yaml index 6f5937f9..cc9c9ae2 100644 --- a/MICADO/default.yaml +++ b/MICADO/default.yaml @@ -125,6 +125,22 @@ mode_yamls : fits_ins_mode: SPE fits_ins_filt: Spec_IJ +- object: observation + alias: OBS + name: IFU + description: "Integral-field spectroscopy" + status: experimental + yamls: + - MICADO_IFU.yaml + properties: + trace_file: TRACE_MICADO_IFU.fits + filter_name_fw1: Spec_HK + filter_name_fw2: open + filter_name_pupil: open + fits_ins_mode: IFU + fits_ins_filt: Spec_HK + +#### Deprecated modes - object : observation alias: OBS name : SPEC_15000x20 diff --git a/MICADO/docs/example_notebooks/MICADO_IFU.ipynb b/MICADO/docs/example_notebooks/MICADO_IFU.ipynb new file mode 100644 index 00000000..310aa6c4 --- /dev/null +++ b/MICADO/docs/example_notebooks/MICADO_IFU.ipynb @@ -0,0 +1,214 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "fe82dad8-f30b-4d6b-a8a4-70b322955831", + "metadata": {}, + "source": [ + "This notebook demonstrates the ScopeSim implementation of the MICADO IFU mode. The IFU mode has only recently been added to MICADO. It will consist of an image slicer with 32 slices with an on-sky width of 0.012 arcsec and a length of 0.45 arcsec. The slices are rearranged before the light is passed through the standard MICADO spectrograph, which results in 32 non-overlapping traces for each spectral order. The IFU will be offered in HK only, so that there are two orders (ORDER_3_1 and ORDER_4_1)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "74ef81df-7c46-49f1-8ec2-5ccf1037b844", + "metadata": {}, + "outputs": [], + "source": [ + "from matplotlib import pyplot as plt\n", + "from astropy import units as u" + ] + }, + { + "cell_type": "markdown", + "id": "f040e328-20d2-4223-b393-bf446a93f0c3", + "metadata": {}, + "source": [ + "We start by importing ScopeSim and pointing it to the relevant instrument packages. Most users should download the latest version of the instrument packages." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5dcc145d-0616-45fa-baa3-25b99d399967", + "metadata": {}, + "outputs": [], + "source": [ + "import scopesim as sim" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a2f6d6a9-8bda-4744-8cad-aab2405f42ad", + "metadata": {}, + "outputs": [], + "source": [ + "# If you want/need to download the instrument packages uncomment the following line\n", + "#sim.download_packages([\"Armazones\", \"ELT\", \"METIS\"])" + ] + }, + { + "cell_type": "markdown", + "id": "5c490464-f6e3-402b-bf80-647f4049bdfa", + "metadata": {}, + "source": [ + "The following command gives the versions of python packages that are used by Scopesim as well as of instrument packages (called IRDB packages). We ask to include the output of this command in any communication with us, in particular in bug reports." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5f86135c-dd97-4647-af27-de85b69b92b5", + "metadata": {}, + "outputs": [], + "source": [ + "sim.bug_report()" + ] + }, + { + "cell_type": "markdown", + "id": "9803afd8-3257-45c0-81b7-8568951e6302", + "metadata": {}, + "source": [ + "# Setting up the instrument\n", + "We set up MICADO to use the IFU in SCAO (stand-alone) mode." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3af4d5ec-1403-45aa-ac91-5bf4789c0134", + "metadata": {}, + "outputs": [], + "source": [ + "cmds = sim.UserCommands(use_instrument=\"MICADO\", set_modes=[\"SCAO\", \"IFU\"])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1a382f8a-9d8c-42f5-acdc-a4fbaa30d844", + "metadata": {}, + "outputs": [], + "source": [ + "micado = sim.OpticalTrain(cmds)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "488baefc-0567-4eaa-8992-47d78e9dd8ed", + "metadata": {}, + "outputs": [], + "source": [ + "micado.effects.show_in_notebook()" + ] + }, + { + "cell_type": "markdown", + "id": "ca723bb3-06d8-4c83-9423-1fb906f870c9", + "metadata": {}, + "source": [ + "# Define a source and simulate" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "25f0c843-7f6e-4c89-97b8-6f9f19c227fc", + "metadata": {}, + "outputs": [], + "source": [ + "star = sim.source.source_templates.star(x=0, y=0, flux=15*u.mag)" + ] + }, + { + "cell_type": "markdown", + "id": "6a714cce-36c9-49a4-ad64-d075d7c0887d", + "metadata": {}, + "source": [ + "To simulate the full MICADO field, we need to switch two effects:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9734379c-515a-4825-987f-f9ea700a7dba", + "metadata": {}, + "outputs": [], + "source": [ + "micado[\"full_detector_array\"].include = True\n", + "micado[\"detector_window\"].include = False" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a0c00218-1784-453c-bc66-a34cd3f0da80", + "metadata": {}, + "outputs": [], + "source": [ + "micado.observe(star)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "010296c5-d034-4f60-984c-58a435b5530e", + "metadata": {}, + "outputs": [], + "source": [ + "hdul = micado.readout(dit=100, ndit=10)[0]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "69383a4c-5b91-4417-b9ad-5936b9bd55b1", + "metadata": {}, + "outputs": [], + "source": [ + "plt.imshow(hdul[5].data, origin='lower', vmax=1000)\n", + "plt.colorbar()" + ] + }, + { + "cell_type": "markdown", + "id": "593afd4c-d040-4f07-9d39-62945d2ff88a", + "metadata": {}, + "source": [ + "To view the entire detector array we recommend saving to disk (`hdul.writeto(\"your_file.fits\")`) and using `ds9`. Open the file with `File -> Open as -> Mosaic WCS` and select `WCS d` to arrange the nine detectors correctly in the detector plane. " + ] + }, + { + "cell_type": "markdown", + "id": "c4c50800-909b-4527-84b5-4e8f78d9dffb", + "metadata": {}, + "source": [ + "# Rectification (not yet available)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.9" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}