Extract a spectrum from a cube.
This recipe extracts a spectrum from a datacube. The datacube must be in F3I KMOS FITS format (either with or without noise). The output will be a similarly formatted F1I KMOS FITS file.
DO KMOS
category Type Explanation Required #Frames
-------- ----- ----------- -------- -------
<none or any> F3I The datacubes Y 1
<none or any> F2I The mask N 0,1
DO KMOS
category Type Explanation
-------- ----- -----------
EXTRACT_SPEC F1I Extracted spectrum
EXTRACT_SPEC_MASK F2I (optional, if --save_mask=true and
--mask_method='optimal': The calculated mask)
Create an object for the recipe kmo_extract_spec.
import cpl
kmo_extract_spec = cpl.Recipe("kmo_extract_spec")
Either apply ‘mask’, ‘integrated’ or ‘optimal’ masking method. (str; default: ‘integrated’) [default=”integrated”].
The centre of the circular mask (pixel). (str; default: ‘7.5,7.5’) [default=”7.5,7.5”].
The radius of the circular mask (pixel). (float; default: 3.0) [default=3.0].
True if the calculated mask should be saved. (bool; default: False) [default=False].
Either apply “average”, “median”, “sum”, “min_max.” or “ksigma”. (str; default: ‘ksigma’) [default=”ksigma”].
The positive rejection threshold for kappa-sigma-clipping (sigma). (float; default: 3.0) [default=3.0].
The negative rejection threshold for kappa-sigma-clipping (sigma). (float; default: 3.0) [default=3.0].
The number of iterations for kappa-sigma-clipping. (long; default: 3) [default=3].
The number of maximum pixel values to clip with min/max-clipping. (long; default: 1) [default=1].
The number of minimum pixel values to clip with min/max-clipping. (long; default: 1) [default=1].
The following code snippet shows the default settings for the available parameters.
import cpl
kmo_extract_spec = cpl.Recipe("kmo_extract_spec")
kmo_extract_spec.param.mask_method = "integrated"
kmo_extract_spec.param.centre = "7.5,7.5"
kmo_extract_spec.param.radius = 3.0
kmo_extract_spec.param.save_mask = False
kmo_extract_spec.param.cmethod = "ksigma"
kmo_extract_spec.param.cpos_rej = 3.0
kmo_extract_spec.param.cneg_rej = 3.0
kmo_extract_spec.param.citer = 3
kmo_extract_spec.param.cmax = 1
kmo_extract_spec.param.cmin = 1
You may also set or overwrite some or all parameters by the recipe parameter param, as shown in the following example:
import cpl
kmo_extract_spec = cpl.Recipe("kmo_extract_spec")
[...]
res = kmo_extract_spec( ..., param = {"mask_method":"integrated", "centre":"7.5,7.5"})
See also
cpl.Recipe for more information about the recipe object.
Please report any problems to Alex Agudo Berbel. Alternatively, you may send a report to the ESO User Support Department.
This file is part of the KMOS Instrument Pipeline Copyright (C) 2002,2003 European Southern Observatory
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
Code author: Alex Agudo Berbel <kmos-spark@mpe.mpg.de>