MUSE specific tools (mpdaf.MUSE)

Python interface for MUSE slicer numbering scheme

The Slicer class contains a set of static methods to convert a slice number between the various numbering schemes. The definition of the various numbering schemes and the conversion table can be found in the “Global Positioning System” document (VLT-TRE-MUSE-14670-0657).

All the methods are static and thus there is no need to instanciate an object to use this class.

For example, we convert slice number 4 in CCD numbering to SKY numbering:

In [1]: from mpdaf.MUSE import Slicer

In [2]: Slicer.ccd2sky(4)
Out[2]: 10

Now we convert slice number 12 of stack 3 in OPTICAL numbering to CCD numbering:

In [3]: Slicer.optical2sky((2, 12))
Out[3]: 25

MUSE LSF models

Warning

LSF class is currently under development

Only one model of LSF (Line Spread Function) is currently available.

LSF qsim_v1

This is a simple model where the LSF is supposed to be constant over the filed of view. It uses a simple parametric model of variation with wavelength.

The model is a convolution of a step function with a gaussian. The resulting function is then sample by the pixel size:

LSF = T(y2+dy/2) - T(y2-dy/2) - T(y1+dy/2) + T(y1-dy/2)

T(x) = exp(-x**2/2) + sqrt(2*pi)*x*erf(x/sqrt(2))/2

y1 = (y-h/2) / sigma

y2 = (y+h/2) / sigma

The slit width is assumed to be constant (h = 2.09 pixels). The gaussian sigma parameter is a polynomial approximation of order 3 with wavelength:

c = [-0.09876662, 0.44410609, -0.03166038, 0.46285363]

sigma(x) = c[3] + c[2]*x + c[1]*x**2 + c[0]*x**3

To use it, create a LSF object with attribute ‘typ’ equal to ‘qsim_v1’:

In [4]: from mpdaf.MUSE import LSF

In [5]: lsf = LSF(typ='qsim_v1')

Then get the LSF array by using get_LSF:

In [6]: lsf_6000 = lsf.get_LSF(lbda=6000, step=1.25, size=11)

In [7]: import matplotlib.pyplot as plt

In [8]: import numpy as np

In [9]: plt.plot(np.arange(-5,6), lsf_6000, drawstyle='steps-mid')
Out[9]: [<matplotlib.lines.Line2D at 0x7fb735c8dbd0>]
_images/simple_LSF.png

MUSE FSF models

Warning

FSF class is currently under development

Only one model of FSF (Field Spread Function) is currently available.

FSF MOFFAT1

The MUSE FSF is supposed to be a Moffat function with a FWHM which varies linearly with the wavelength.

The model is defined with 3 parameters:
  • beta (float) Power index of the Moffat.
  • a (float) constant in arcsec which defined the FWHM (fwhm=a+b*lbda)
  • b (float) constant which defined the FWHM (fwhm=a+b*lbda)

We create the FSF object like this:

In [10]: from mpdaf.MUSE import FSF

In [11]: fsf = FSF(typ='MOFFAT1')

get_FSF returns for each wavelength an array and the FWHM in pixel and in arcseconds.

In [12]: fsf_array, fwhm_pix, fwhm_arcsec = fsf.get_FSF(lbda=[5000, 9000], step=0.2, size=21, beta=2.8, a=0.885, b=-2.94E-05)

In [13]: print fwhm_pix
[ 3.69   3.102]

In [14]: print fwhm_arcsec
[ 0.738   0.6204]

In [15]: plt.figure()
Out[15]: <matplotlib.figure.Figure at 0x7fb7443d0790>

In [16]: plt.imshow(fsf_array[1], vmin=0, vmax=60, interpolation='nearest')
Out[16]: <matplotlib.image.AxesImage at 0x7fb74428af10>

In [17]: plt.figure()
Out[17]: <matplotlib.figure.Figure at 0x7fb7443d06d0>

In [18]: plt.imshow(fsf_array[0], vmin=0, vmax=60, interpolation='nearest')
Out[18]: <matplotlib.image.AxesImage at 0x7fb737f92710>
_images/FSF1.png _images/FSF2.png

It is also possible to use get_FSF_cube that returns a cube of FSFs with the same coordinates that the MUSE data cube given as input.

MUSE mosaic field map

Warning

FieldsMap class is currently under development

FieldsMap reads the possible FIELDMAP extension of the MUSE data cube.

In [19]: from mpdaf.MUSE import FieldsMap

In [20]: fmap = FieldsMap('../data/sdetect/subcub_mosaic.fits', extname='FIELDMAP')

get_pixel_fields returns a list of fields that cover a given pixel (y, x):

In [21]: fmap.get_pixel_fields(0,0)
Out[21]: ['UDF-06', 'UDF-09']

In [22]: fmap.get_pixel_fields(20,20)
Out[22]: ['UDF-06']

get_field_mask returns an array with non-zeros values for pixels matching a field:

In [23]: plt.figure()
Out[23]: <matplotlib.figure.Figure at 0x7fb748f7ea50>

In [24]: plt.imshow(fmap.get_field_mask('UDF-06'), vmin=0, vmax=1)
Out[24]: <matplotlib.image.AxesImage at 0x7fb749024710>

In [25]: plt.figure()
Out[25]: <matplotlib.figure.Figure at 0x7fb748f7ef50>

In [26]: plt.imshow(fmap.get_field_mask('UDF-09'), vmin=0, vmax=1)
Out[26]: <matplotlib.image.AxesImage at 0x7fb7441916d0>
_images/fmap1.png _images/fmap2.png

Reference/API

mpdaf.MUSE Package

Copyright (c) 2010-2016 CNRS / Centre de Recherche Astrophysique de Lyon Copyright (c) 2013-2016 Laure Piqueras <laure.piqueras@univ-lyon1.fr> Copyright (c) 2015-2016 Simon Conseil <simon.conseil@univ-lyon1.fr>

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Classes

FSF([typ]) This class offers Field Spread Function models for MUSE.
FieldsMap([filename, nfields]) Class to work with the mosaic field map.
LSF([typ]) This class offers Line Spread Function models for MUSE.
Slicer Convert slice number between the various numbering schemes.

Class Inheritance Diagram

Inheritance diagram of mpdaf.MUSE.PSF.FSF, mpdaf.MUSE.FieldsMap.FieldsMap, mpdaf.MUSE.PSF.LSF, mpdaf.MUSE.slicer.Slicer