PyEmir: Data Reduction Pipeline for EMIR
the GTC Near-IR Multi-Object Spectrograph
S. Pascual, J. Gallego, N. Cardiel, M. C. Eliche-Moral
Departamento de Astrofísica y CC. Atmósfera, Facultad de CC. Físicas,
Universidad Complutense de Madrid, 28040 Madrid, Spain
http://guaix.fis.ucm.es/projects/emirsergiopr@astrax.fis.ucm.es
Gran Telescopio Canarias

EMIR Data Reduction Pipeline• The Data Reduction Pipeline (DRP) will process data acquired withEMIR in a nutshell
The Espectrógrafo Multi-Objeto Infrarrojo (EMIR)

EMIR. It shall deliver reduced images, by means of robust software

is a state-of-the-art near-infrared wide-field

tools and algorithms optimized for handling near-IR data.

camera and multi-object spectrograph which is• The DRP is prepared to handle wide-field frames in imaging mode,

designed to work at the Nasmyth focus of theas well as, multi-object observations (up to 45 slitlets).

10.4m Gran Telescopio Canarias.

• The frames obtained with EMIR shall be reduced into scientificimages and delivered to astronomers.
●Some of the feature included are:●Check and quality control procedures●Error propagation is considered.

The reduction process is fully automatic●The 10.4m Gran Telescopio Canarias (GTC) is located in
one of the best observing sites in the NorthernHemisphere, Observatory Roque de los Muchachos (LaPalma, the Canary islands, Spain). The telescope

The PyEmir package

primary mirror is made of 36 segments and it has been

• The development is compatible with Python 2.5

designed to work in the optical-nIR range.

• Several python packages provide different functionalities:•Scipy (multidimensional arrays)•Nose (extended unit testing)•Setuptools (installation)

Python EMIR pipeline•PyFits (FITS files handling)• The EMIR Data Reduction Pipeline is being• The Python EMIR DRP (PyEmir) will be released under GPLv3.

developed in Python by developers of the Guaix

It will be free for everyone to install, share and modify.

group at the UCM. Several reasons led us to change•The code is documented using Sphynx, online and offline

from our previous approach (based on a GTC C++

documentation of the pipeline will be provided in different formatslibrary) to a Python solution, namely:(html, PDF).

• The ability to create interactive processing
sessions using the same tools used in offline
processing (astronomers are very used to finetune parameters in interactive sessions).
• Python is being used in multiple astronomical
projects.
• Python is object-oriented and interfaces with
C/C++. We can reuse part of our previousdevelopment.

• Parts of the code (extensive numeric operations within arrays)
are implemented in C++ using the Python/Numpy API for

The Guaix group at the UCM
The Extragalactic Astrophysics and Astronomical
Instrumentation group of the Universidad
Complutense de Madrid is composed of more than 20astronomers.
The research interests of the group include stellar
populations in dwarf and elliptical galaxies, local star
forming galaxies and cosmological surveys and thedevelopment of astronomical software andinstrumentation.
For more information, please visit:
http://guaix.fis.ucm.es

efficiency.
• Our plan is to provide a development environment for other
GTC instruments. We divide our package in two modules.
• Module emir contains Emir specific code and processing

Data flow diagram of a user- driven
reduction

routines.
• Module numina contains classes to develop compatible
reduction recipes, the command line recipe runner, logging
capabilities, generic image manipulation, etc.

Reduction recipes• Recipes are the basic unit of data processing.
●

Each instrument has a list of predefined observing

modes (OM).
●

Each OM has a Recipe prepared to process thedata. It defines also the metadata needed for thereduction

Common Interface
Recipes implement a plugin interface so that they●

can be loaded from the system given their name.
●

An application (recipe runner) is in charge of loading

the recipe, configure it and run it with the appropriateddata.

The recipe runner (either command line or GUI) is incharge of handling the raw data and the files
describing the observation. The recipe runner will
select the suitable reduction recipe based on theobserving mode of the observation.
The recipe will process the data and will return theprocessed data to the runner. The runner will save theresults in the appropriated place.