Tutorial: GMOS Imaging Reduction - NGC 6872 - g-band

Datasets:

Science observation UT date(s) 2010 Nov 01
Data filename prefix(es) S20101101S

Target Frames

ScienceS20101101S79-82binning 2x2
Processed Biasfor 20101101S20101101S0169_bias.fits
Processed Twilight Flatfor 20101101S20101102S0018_flat_g.fits
Processed Fringe FrameN/AN/A

Fringe Frames

N/A

Twilight Flats

Processed: S20101102S0018_flat_g.fits
Twilight FramesS20101102S18-29binning 2x2
Processed Biasfor 20101102S20101101S0169_bias.fits

Biases

Processed: S20101101S0169_bias.fits
BiasesS20101101S169-172binning 2x2
S20101102S131-135binning 2x2

STEP 0: Directory structure used by this Notebook

The directory paths used in this notebook are assumed to match this structure:

rootdir/
    calib/
        bias/
        flat/
        fringe/
    raw/
    redux/

STEP 1: Set up the Notebook and the PyRAF session

The data processing will happen in the Notebook. It is also convenient to have a PyRAF interactive session ready to use if needed, eg. to imexam. In this step, we will configure the Notebook and the PyRAF session.

This step needs to be repeated everytime the Notebook and/or the PyRAF session is restarted.

STEP 1.1: Set up the Notebook

STEP 1.1.1: Set up the variables.


In [1]:
import os
import os.path
import shutil

# WARNING: Make sure that the directory structure given in Step 0 
#          is already in place.

# EDIT HERE - Directories
rootdir = '/data/workspace/DRWorkshopAAO/NGC6872'

# EDIT HERE - File numbers and file names
biases = {
    'bias_20101101' : {
        'procbias' : 'S20101101S0169_bias.fits',
        'frames'   : [('S20101101S', '169-172'),
                      ('S20101102S', '131-135'),
                     ]
    },
}

flats = {
    'flat_20101102' : {
        'procflat'   : 'S20101102S0018_flat_g.fits',
        'frames'     : [('S20101102S', '18-29')],
        'flatbias'   : biases['bias_20101101']['procbias'],
    }
}

science = {
    'procsci'   : 'ngc6872_g.fits',
    'sciroot'   : 'S20101101S',
    'sciframes' : '79-82',
    'scibias'   : biases['bias_20101101']['procbias'],
    'sciflat'   : flats['flat_20101102']['procflat'],
    #'scifringe' : fringes['fringe_20101111']['procfringe'],
}

logfile = 'NGC6872_g.log'

# Automatically set directories to match structure from Step 0
raw_path = os.path.join(rootdir, 'raw') + '/'
redux_path = os.path.join(rootdir, 'redux') + '/'
procbias_path = os.path.join(rootdir, 'calib', 'bias') + '/'
procflat_path = os.path.join(rootdir, 'calib', 'flat') + '/'
procfringe_path = os.path.join(rootdir, 'calib', 'fringe') + '/'
products_path = os.path.join(rootdir, 'products') + '/'

# Change to work directory
os.chdir(redux_path)

Step 1.1.2: Load and initialize the package

---> LAUNCH DS9 before proceeding further

Load the package required for the Notebook session and reset tasks to the default parameters.


In [2]:
from pyraf import iraf
iraf.gemini()
iraf.gmos()

iraf.unlearn(iraf.gemini, iraf.gmos, iraf.gemtools)

iraf.gmos.logfile = logfile

iraf.set(stdimage='imtgmos')


This is the initial release of the IRAF FITSUTIL package
to include support for FITS tile compression via 'fpack'.
Please send comments and questions to seaman@noao.edu.

 
     +------------------- Gemini IRAF Package -------------------+
     |             Version 1.13.1, December 7, 2015              |
     |             Requires IRAF v2.14.1 or greater              |
     |              Tested with Ureka IRAF v2.16                 |
     |             Gemini Observatory, Hilo, Hawaii              |
     |    Please use the help desk for submission of questions   |
     |  http://www.gemini.edu/sciops/helpdesk/helpdeskIndex.html |
     +-----------------------------------------------------------+
 
     Warning setting imtype=fits
     Warning setting use_new_imt=no
 
gemini/:
 f2/            gemtools/       gsaoi/          niri/
 flamingos/     gmos/           midir/          oscir/
 gemlocal/      gnirs/          nifs/           quirc/
gmos/:
 gbias          gfquick         gmosaic         gsappwave       gssdist
 gbpm           gfreduce        gmosexamples    gscalibrate     gsskysub
 gdark          gfresponse      gmosinfo        gscrmask        gsslitfunction
 gdisplay       gfscatsub       gmosinfoifu     gscrrej         gsstandard
 gfapsum        gfskysub        gmosinfoimag    gscut           gstransform
 gfcombine      gftransform     gmosinfospec    gsdrawslits     gswavelength
 gfcopy         giflat          gnscombine      gsextract       mostools/
 gfcube         gifringe        gnsdark         gsflat
 gfdisplay      giillum         gnsskysub       gsfquick
 gfextract      gireduce        gprepare        gsreduce
 gffindblocks   girmfringe      gqecorr         gsscatsub

STEP 1.2: Set up the PyRAF session

The commands shown here need to be run from the shell.

Open an xterm or a Terminal, then:

cd /data/workspace/DRWorkshopAAO/NGC6872/redux
pyraf

Then in the PyRAF session:

gemini
gmos
unlearn gemini
unlearn gmos
unlearn gemtools

Get your PyRAF configured. In the PyRAF session:

iraf.gmos.logfile = "NGC6872_g.log"
set stdimage=imtgmos

STEP 2: Create the file lists


In [3]:
os.chdir(redux_path)

# delete any pre-existing lists
iraf.delete('*.lis', verify='no')

# biases
for (root, frames) in biases['bias_20101101']['frames']:
    iraf.gemlist(root, frames, Stdout='tmp_'+root+'.lis')
iraf.concat('tmp_*.lis', 'bias_20101101.lis')
iraf.delete('tmp_*.lis', verify='no')

# flats
for (root, frames) in flats['flat_20101102']['frames']:
    iraf.gemlist(root, frames, Stdout='tmp_'+root+'.lis')
iraf.concat('tmp_*.lis', 'flat_20101102.lis')
iraf.delete('tmp_*.lis', verify='no')


# science
iraf.gemlist(science['sciroot'], science['sciframes'], \
             Stdout='sci.lis')

# Get a full list
iraf.concat('*.lis', 'all.lis')

STEP 3: Visually inspect all the data


In [4]:
all_files = open('all.lis', 'r')
for line in all_files:
    image = line.strip() + '[1]'
    print image
    iraf.gdisplay(raw_path + image, 1, fl_paste='no')
    iraf.sleep(5)
    
all_files.close()


S20101101S0169[1]

GDISPLAY - Started: 2016-03-23T09:19:05

GDISPLAY: Temporary image name tmpout94296oS20101101S0169.fits

GMULTIAMP - Started: 2016-03-23T09:19:05


GMULTIAMP - Finished: 2016-03-23T09:19:06
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:19:07

S20101101S0170[1]

GDISPLAY - Started: 2016-03-23T09:19:12

GDISPLAY: Temporary image name tmpout94296_10S20101101S0170.fits

GMULTIAMP - Started: 2016-03-23T09:19:12


GMULTIAMP - Finished: 2016-03-23T09:19:13
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:19:14

S20101101S0171[1]

GDISPLAY - Started: 2016-03-23T09:19:19

GDISPLAY: Temporary image name tmpout94296_31S20101101S0171.fits

GMULTIAMP - Started: 2016-03-23T09:19:19


GMULTIAMP - Finished: 2016-03-23T09:19:20
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:19:21

S20101101S0172[1]

GDISPLAY - Started: 2016-03-23T09:19:26

GDISPLAY: Temporary image name tmpout94296_52S20101101S0172.fits

GMULTIAMP - Started: 2016-03-23T09:19:26


GMULTIAMP - Finished: 2016-03-23T09:19:27
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:19:28

S20101102S0131[1]

GDISPLAY - Started: 2016-03-23T09:19:33

GDISPLAY: Temporary image name tmpout94296_73S20101102S0131.fits

GMULTIAMP - Started: 2016-03-23T09:19:33


GMULTIAMP - Finished: 2016-03-23T09:19:34
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:19:35

S20101102S0132[1]

GDISPLAY - Started: 2016-03-23T09:19:40

GDISPLAY: Temporary image name tmpout94296_94S20101102S0132.fits

GMULTIAMP - Started: 2016-03-23T09:19:40


GMULTIAMP - Finished: 2016-03-23T09:19:41
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:19:42

S20101102S0133[1]

GDISPLAY - Started: 2016-03-23T09:19:47

GDISPLAY: Temporary image name tmpout94296_115S20101102S0133.fits

GMULTIAMP - Started: 2016-03-23T09:19:47


GMULTIAMP - Finished: 2016-03-23T09:19:48
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:19:49

S20101102S0134[1]

GDISPLAY - Started: 2016-03-23T09:19:54

GDISPLAY: Temporary image name tmpout94296_136S20101102S0134.fits

GMULTIAMP - Started: 2016-03-23T09:19:54


GMULTIAMP - Finished: 2016-03-23T09:19:55
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:19:56

S20101102S0135[1]

GDISPLAY - Started: 2016-03-23T09:20:01

GDISPLAY: Temporary image name tmpout94296_157S20101102S0135.fits

GMULTIAMP - Started: 2016-03-23T09:20:01


GMULTIAMP - Finished: 2016-03-23T09:20:02
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:20:03

S20101102S0018[1]

GDISPLAY - Started: 2016-03-23T09:20:08

GDISPLAY: Temporary image name tmpout94296_178S20101102S0018.fits

GMULTIAMP - Started: 2016-03-23T09:20:08


GMULTIAMP - Finished: 2016-03-23T09:20:08
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:20:10

S20101102S0019[1]

GDISPLAY - Started: 2016-03-23T09:20:15

GDISPLAY: Temporary image name tmpout94296_199S20101102S0019.fits

GMULTIAMP - Started: 2016-03-23T09:20:15


GMULTIAMP - Finished: 2016-03-23T09:20:15
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:20:17

S20101102S0020[1]

GDISPLAY - Started: 2016-03-23T09:20:22

GDISPLAY: Temporary image name tmpout94296_220S20101102S0020.fits

GMULTIAMP - Started: 2016-03-23T09:20:22


GMULTIAMP - Finished: 2016-03-23T09:20:22
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:20:23

S20101102S0021[1]

GDISPLAY - Started: 2016-03-23T09:20:29

GDISPLAY: Temporary image name tmpout94296_241S20101102S0021.fits

GMULTIAMP - Started: 2016-03-23T09:20:29


GMULTIAMP - Finished: 2016-03-23T09:20:29
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:20:30

S20101102S0022[1]

GDISPLAY - Started: 2016-03-23T09:20:35

GDISPLAY: Temporary image name tmpout94296_262S20101102S0022.fits

GMULTIAMP - Started: 2016-03-23T09:20:36


GMULTIAMP - Finished: 2016-03-23T09:20:36
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:20:37

S20101102S0023[1]

GDISPLAY - Started: 2016-03-23T09:20:42

GDISPLAY: Temporary image name tmpout94296_283S20101102S0023.fits

GMULTIAMP - Started: 2016-03-23T09:20:43


GMULTIAMP - Finished: 2016-03-23T09:20:43
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:20:44

S20101102S0024[1]

GDISPLAY - Started: 2016-03-23T09:20:49

GDISPLAY: Temporary image name tmpout94296_304S20101102S0024.fits

GMULTIAMP - Started: 2016-03-23T09:20:50


GMULTIAMP - Finished: 2016-03-23T09:20:50
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:20:51

S20101102S0025[1]

GDISPLAY - Started: 2016-03-23T09:20:56

GDISPLAY: Temporary image name tmpout94296_325S20101102S0025.fits

GMULTIAMP - Started: 2016-03-23T09:20:56


GMULTIAMP - Finished: 2016-03-23T09:20:57
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:20:58

S20101102S0026[1]

GDISPLAY - Started: 2016-03-23T09:21:03

GDISPLAY: Temporary image name tmpout94296_346S20101102S0026.fits

GMULTIAMP - Started: 2016-03-23T09:21:03


GMULTIAMP - Finished: 2016-03-23T09:21:04
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:21:05

S20101102S0027[1]

GDISPLAY - Started: 2016-03-23T09:21:10

GDISPLAY: Temporary image name tmpout94296_367S20101102S0027.fits

GMULTIAMP - Started: 2016-03-23T09:21:10


GMULTIAMP - Finished: 2016-03-23T09:21:11
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:21:12

S20101102S0028[1]

GDISPLAY - Started: 2016-03-23T09:21:17

GDISPLAY: Temporary image name tmpout94296_388S20101102S0028.fits

GMULTIAMP - Started: 2016-03-23T09:21:17


GMULTIAMP - Finished: 2016-03-23T09:21:18
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:21:19

S20101102S0029[1]

GDISPLAY - Started: 2016-03-23T09:21:24

GDISPLAY: Temporary image name tmpout94296_409S20101102S0029.fits

GMULTIAMP - Started: 2016-03-23T09:21:24


GMULTIAMP - Finished: 2016-03-23T09:21:25
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:21:26

S20101101S0079[1]

GDISPLAY - Started: 2016-03-23T09:21:31

GDISPLAY: Temporary image name tmpout94296_430S20101101S0079.fits

GMULTIAMP - Started: 2016-03-23T09:21:31


GMULTIAMP - Finished: 2016-03-23T09:21:32
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:21:33

S20101101S0080[1]

GDISPLAY - Started: 2016-03-23T09:21:38

GDISPLAY: Temporary image name tmpout94296_451S20101101S0080.fits

GMULTIAMP - Started: 2016-03-23T09:21:38


GMULTIAMP - Finished: 2016-03-23T09:21:39
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:21:40

S20101101S0081[1]

GDISPLAY - Started: 2016-03-23T09:21:45

GDISPLAY: Temporary image name tmpout94296_472S20101101S0081.fits

GMULTIAMP - Started: 2016-03-23T09:21:45


GMULTIAMP - Finished: 2016-03-23T09:21:46
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:21:47

S20101101S0082[1]

GDISPLAY - Started: 2016-03-23T09:21:52

GDISPLAY: Temporary image name tmpout94296_493S20101101S0082.fits

GMULTIAMP - Started: 2016-03-23T09:21:52


GMULTIAMP - Finished: 2016-03-23T09:21:53
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY - Finished: 2016-03-23T09:21:54

STEP 4: Process the biases

This will produce the bias defined above. That bias will be used later to process the science frames, and the twilight flats.


In [5]:
os.chdir(redux_path)

for biaskey in biases.keys():
    iraf.imdelete(biases[biaskey]['procbias'], verify='no')
    iraf.imdelete('g//@'+biaskey+'.lis', verify='no')

    print 'Creating bias ', biases[biaskey]['procbias']
    iraf.gbias('@'+biaskey+'.lis', outbias=biases[biaskey]['procbias'], \
               rawpath=raw_path, fl_over='yes', fl_trim='yes', \
               fl_vardq='yes')
    shutil.copy(biases[biaskey]['procbias'], procbias_path)

# The processed biases are:
os.listdir(procbias_path)


Creating bias  S20101101S0169_bias.fits
----------------------------------------------------------------------------
GBIAS -- Wed Mar 23 09:22:10 HST 2016

Input images:
  S20101101S0169
  S20101101S0170
  S20101101S0171
  S20101101S0172
  S20101102S0131
  S20101102S0132
  S20101102S0133
  S20101102S0134
  S20101102S0135

Output bias image: S20101101S0169_bias.fits
 

----------------------------------------------------------------------------
GIREDUCE -- Wed Mar 23 09:22:11 HST 2016

----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:22:11 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/raw/S20101101S0169
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101101S0169.fits   Output  gS20101101S0169.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:22:12 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/raw/S20101101S0170
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101101S0170.fits   Output  gS20101101S0170.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:22:13 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/raw/S20101101S0171
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101101S0171.fits   Output  gS20101101S0171.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:22:14 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/raw/S20101101S0172
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101101S0172.fits   Output  gS20101101S0172.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:22:15 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/raw/S20101102S0131
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101102S0131.fits   Output  gS20101102S0131.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:22:16 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/raw/S20101102S0132
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101102S0132.fits   Output  gS20101102S0132.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:22:17 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/raw/S20101102S0133
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101102S0133.fits   Output  gS20101102S0133.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:22:18 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/raw/S20101102S0134
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101102S0134.fits   Output  gS20101102S0134.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:22:19 HST 2016

Input list    = /data/workspace/DRWorkshopAAO/raw/S20101102S0135
Output list   = 
Output prefix = g
Raw path      = 
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101102S0135.fits   Output  gS20101102S0135.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------

Input files:
gS20101101S0169
gS20101101S0170
gS20101101S0171
gS20101101S0172
gS20101102S0131
gS20101102S0132
gS20101102S0133
gS20101102S0134
gS20101102S0135

Output files:
tmpfile94296_519S20101101S0169
tmpfile94296_519S20101101S0170
tmpfile94296_519S20101101S0171
tmpfile94296_519S20101101S0172
tmpfile94296_519S20101102S0131
tmpfile94296_519S20101102S0132
tmpfile94296_519S20101102S0133
tmpfile94296_519S20101102S0134
tmpfile94296_519S20101102S0135

GIREDUCE: Image tmpfile94296_519S20101101S0169 overscan subtracted
GIREDUCE: Image tmpfile94296_519S20101101S0170 overscan subtracted
GIREDUCE: Image tmpfile94296_519S20101101S0171 overscan subtracted
GIREDUCE: Image tmpfile94296_519S20101101S0172 overscan subtracted
GIREDUCE: Image tmpfile94296_519S20101102S0131 overscan subtracted
GIREDUCE: Image tmpfile94296_519S20101102S0132 overscan subtracted
GIREDUCE: Image tmpfile94296_519S20101102S0133 overscan subtracted
GIREDUCE: Image tmpfile94296_519S20101102S0134 overscan subtracted
GIREDUCE: Image tmpfile94296_519S20101102S0135 overscan subtracted
GIREDUCE: Image tmpfile94296_519S20101101S0169 trimmed
GIREDUCE: Image tmpfile94296_519S20101101S0170 trimmed
GIREDUCE: Image tmpfile94296_519S20101101S0171 trimmed
GIREDUCE: Image tmpfile94296_519S20101101S0172 trimmed
GIREDUCE: Image tmpfile94296_519S20101102S0131 trimmed
GIREDUCE: Image tmpfile94296_519S20101102S0132 trimmed
GIREDUCE: Image tmpfile94296_519S20101102S0133 trimmed
GIREDUCE: Image tmpfile94296_519S20101102S0134 trimmed
GIREDUCE: Image tmpfile94296_519S20101102S0135 trimmed


GIREDUCE - Cleaning up -- Wed Mar 23 09:23:11 HST 2016

GIREDUCE -- Wed Mar 23 09:23:11 HST 2016
GIREDUCE exit status:  good.
----------------------------------------------------------------------------
--------------------------------------------------------------------------------
GEMCOMBINE -- Wed Mar 23 09:23:11 HST 2016
 
GEMCOMBINE: input = @tmpcombin94296_516
GEMCOMBINE: output = S20101101S0169_bias.fits
GEMCOMBINE: title = Bias
GEMCOMBINE: bpmfile = 
GEMCOMBINE: sci_ext = SCI
GEMCOMBINE: var_ext = VAR
GEMCOMBINE: dq_ext = DQ
 

Mar 23  9:23: IMCOMBINE
  combine = average, scale = none, zero = none, weight = none
  reject = avsigclip, mclip = yes, nkeep = 1
  lsigma = 3., hsigma = 3.
  blank = 0.
  statsec = Mar 23  9:23
                Images     Exp
  tmpfile94296_519S20101101S0169.fits[SCI,1]    0.0
  tmpfile94296_519S20101101S0170.fits[SCI,1]    0.0
  tmpfile94296_519S20101101S0171.fits[SCI,1]    0.0
  tmpfile94296_519S20101101S0172.fits[SCI,1]    0.0
  tmpfile94296_519S20101102S0131.fits[SCI,1]    0.0
  tmpfile94296_519S20101102S0132.fits[SCI,1]    0.0
  tmpfile94296_519S20101102S0133.fits[SCI,1]    0.0
  tmpfile94296_519S20101102S0134.fits[SCI,1]    0.0
  tmpfile94296_519S20101102S0135.fits[SCI,1]    0.0

  Output image = tmpcombout94296_593, ncombine = 9
  Number rejected mask = tmpcombdq94296_594.pl
  Sigma image = tmpcombsig94296_595

Mar 23  9:23: IMCOMBINE
  combine = average, scale = none, zero = none, weight = none
  reject = avsigclip, mclip = yes, nkeep = 1
  lsigma = 3., hsigma = 3.
  blank = 0.
  statsec = Mar 23  9:23
                Images     Exp
  tmpfile94296_519S20101101S0169.fits[SCI,2]    0.0
  tmpfile94296_519S20101101S0170.fits[SCI,2]    0.0
  tmpfile94296_519S20101101S0171.fits[SCI,2]    0.0
  tmpfile94296_519S20101101S0172.fits[SCI,2]    0.0
  tmpfile94296_519S20101102S0131.fits[SCI,2]    0.0
  tmpfile94296_519S20101102S0132.fits[SCI,2]    0.0
  tmpfile94296_519S20101102S0133.fits[SCI,2]    0.0
  tmpfile94296_519S20101102S0134.fits[SCI,2]    0.0
  tmpfile94296_519S20101102S0135.fits[SCI,2]    0.0

  Output image = tmpcombout94296_600, ncombine = 9
  Number rejected mask = tmpcombdq94296_601.pl
  Sigma image = tmpcombsig94296_602

Mar 23  9:23: IMCOMBINE
  combine = average, scale = none, zero = none, weight = none
  reject = avsigclip, mclip = yes, nkeep = 1
  lsigma = 3., hsigma = 3.
  blank = 0.
  statsec = Mar 23  9:23
                Images     Exp
  tmpfile94296_519S20101101S0169.fits[SCI,3]    0.0
  tmpfile94296_519S20101101S0170.fits[SCI,3]    0.0
  tmpfile94296_519S20101101S0171.fits[SCI,3]    0.0
  tmpfile94296_519S20101101S0172.fits[SCI,3]    0.0
  tmpfile94296_519S20101102S0131.fits[SCI,3]    0.0
  tmpfile94296_519S20101102S0132.fits[SCI,3]    0.0
  tmpfile94296_519S20101102S0133.fits[SCI,3]    0.0
  tmpfile94296_519S20101102S0134.fits[SCI,3]    0.0
  tmpfile94296_519S20101102S0135.fits[SCI,3]    0.0

  Output image = tmpcombout94296_604, ncombine = 9
  Number rejected mask = tmpcombdq94296_605.pl
  Sigma image = tmpcombsig94296_606
 
GEMCOMBINE -- Finished: Wed Mar 23 09:23:23 HST 2016
 
GEMCOMBINE -- Exit status: GOOD
--------------------------------------------------------------------------------

GBIAS: Exit status: GOOD.
----------------------------------------------------------------------------
Out[5]:
['S20101101S0169_bias.fits',
 'S20101107S0228_bias.fits',
 'S20101111S0061_bias.fits']

Visually inspect the processed biases


In [6]:
# WARNING: interactive.  It launches imexam.  Type 'q' to quit.
for biaskey in biases.keys():
    iraf.gdisplay(biases[biaskey]['procbias'], 1, fl_paste='yes')


GDISPLAY - Started: 2016-03-23T09:23:46

GDISPLAY: Temporary image name tmpout94296_609S20101101S0169_bias.fits

GMULTIAMP - Started: 2016-03-23T09:23:46

GMULTIAMP: Tiling image...
               Image tiled.

GMULTIAMP - Finished: 2016-03-23T09:23:48
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-03-23T09:23:52

STEP 5: Process the twilight flats

This will produce the twilight flat defined above. That flat will be used later to process the science frames.


In [7]:
os.chdir(redux_path)

for flatkey in flats.keys():
    iraf.imdelete('g//@'+flatkey+'.lis', verify='no')
    iraf.imdelete('rg//@'+flatkey+'.lis', verify='no')
    
    flatlist = flatkey+'.lis'
    procbias = os.path.join(procbias_path, flats[flatkey]['flatbias'])
    
    print 'Processing raw twilight flats'
    
    # gprepare and bias correct the raw flats
    iraf.gireduce('@'+flatlist, rawpath=raw_path, \
                  fl_over='yes', fl_trim='yes', \
                  fl_bias='yes', bias=procbias, fl_flat='no', \
                  fl_vardq='yes')


Processing raw twilight flats
----------------------------------------------------------------------------
GIREDUCE -- Wed Mar 23 09:24:16 HST 2016

----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:24:16 HST 2016

Input list    = S20101102S0018
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101102S0018.fits   Output  gS20101102S0018.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:24:17 HST 2016

Input list    = S20101102S0019
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101102S0019.fits   Output  gS20101102S0019.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:24:18 HST 2016

Input list    = S20101102S0020
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101102S0020.fits   Output  gS20101102S0020.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:24:19 HST 2016

Input list    = S20101102S0021
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101102S0021.fits   Output  gS20101102S0021.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:24:20 HST 2016

Input list    = S20101102S0022
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101102S0022.fits   Output  gS20101102S0022.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:24:21 HST 2016

Input list    = S20101102S0023
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101102S0023.fits   Output  gS20101102S0023.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:24:22 HST 2016

Input list    = S20101102S0024
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101102S0024.fits   Output  gS20101102S0024.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:24:23 HST 2016

Input list    = S20101102S0025
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101102S0025.fits   Output  gS20101102S0025.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:24:24 HST 2016

Input list    = S20101102S0026
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101102S0026.fits   Output  gS20101102S0026.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:24:25 HST 2016

Input list    = S20101102S0027
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101102S0027.fits   Output  gS20101102S0027.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:24:27 HST 2016

Input list    = S20101102S0028
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101102S0028.fits   Output  gS20101102S0028.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:24:28 HST 2016

Input list    = S20101102S0029
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101102S0029.fits   Output  gS20101102S0029.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------

Input files:
gS20101102S0018
gS20101102S0019
gS20101102S0020
gS20101102S0021
gS20101102S0022
gS20101102S0023
gS20101102S0024
gS20101102S0025
gS20101102S0026
gS20101102S0027
gS20101102S0028
gS20101102S0029

Output files:
rgS20101102S0018
rgS20101102S0019
rgS20101102S0020
rgS20101102S0021
rgS20101102S0022
rgS20101102S0023
rgS20101102S0024
rgS20101102S0025
rgS20101102S0026
rgS20101102S0027
rgS20101102S0028
rgS20101102S0029

WARNING - GIREDUCE: Bad Pixel Mask filename is an empty string
                    Only saturated pixels will be flagged
GIREDUCE: Image rgS20101102S0018 overscan subtracted
GIREDUCE: Image rgS20101102S0019 overscan subtracted
GIREDUCE: Image rgS20101102S0020 overscan subtracted
GIREDUCE: Image rgS20101102S0021 overscan subtracted
GIREDUCE: Image rgS20101102S0022 overscan subtracted
GIREDUCE: Image rgS20101102S0023 overscan subtracted
GIREDUCE: Image rgS20101102S0024 overscan subtracted
GIREDUCE: Image rgS20101102S0025 overscan subtracted
GIREDUCE: Image rgS20101102S0026 overscan subtracted
GIREDUCE: Image rgS20101102S0027 overscan subtracted
GIREDUCE: Image rgS20101102S0028 overscan subtracted
GIREDUCE: Image rgS20101102S0029 overscan subtracted
GIREDUCE: Image rgS20101102S0018 trimmed
GIREDUCE: Image rgS20101102S0019 trimmed
GIREDUCE: Image rgS20101102S0020 trimmed
GIREDUCE: Image rgS20101102S0021 trimmed
GIREDUCE: Image rgS20101102S0022 trimmed
GIREDUCE: Image rgS20101102S0023 trimmed
GIREDUCE: Image rgS20101102S0024 trimmed
GIREDUCE: Image rgS20101102S0025 trimmed
GIREDUCE: Image rgS20101102S0026 trimmed
GIREDUCE: Image rgS20101102S0027 trimmed
GIREDUCE: Image rgS20101102S0028 trimmed
GIREDUCE: Image rgS20101102S0029 trimmed

Output image       Bias                 Flat               Dark       Scale 
rgS20101102S0018   /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias from rgS20101102S0018
GIREDUCE: multiplying image rgS20101102S0018 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgS20101102S0019   /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias from rgS20101102S0019
GIREDUCE: multiplying image rgS20101102S0019 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgS20101102S0020   /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias from rgS20101102S0020
GIREDUCE: multiplying image rgS20101102S0020 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgS20101102S0021   /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias from rgS20101102S0021
GIREDUCE: multiplying image rgS20101102S0021 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgS20101102S0022   /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias from rgS20101102S0022
GIREDUCE: multiplying image rgS20101102S0022 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgS20101102S0023   /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias from rgS20101102S0023
GIREDUCE: multiplying image rgS20101102S0023 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgS20101102S0024   /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias from rgS20101102S0024
GIREDUCE: multiplying image rgS20101102S0024 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgS20101102S0025   /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias from rgS20101102S0025
GIREDUCE: multiplying image rgS20101102S0025 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgS20101102S0026   /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias from rgS20101102S0026
GIREDUCE: multiplying image rgS20101102S0026 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgS20101102S0027   /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias from rgS20101102S0027
GIREDUCE: multiplying image rgS20101102S0027 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgS20101102S0028   /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias from rgS20101102S0028
GIREDUCE: multiplying image rgS20101102S0028 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgS20101102S0029   /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias INDEF              INDEF       0.00
GIREDUCE: Subtracted bias /data/workspace/DRWorkshopAAO/calib/bias/S20101101S0169_bias from rgS20101102S0029
GIREDUCE: multiplying image rgS20101102S0029 by gain
GIREDUCE: output counts in electrons

GIREDUCE - Cleaning up -- Wed Mar 23 09:27:10 HST 2016

GIREDUCE -- Wed Mar 23 09:27:10 HST 2016
GIREDUCE exit status:  good.
----------------------------------------------------------------------------

In [8]:
os.chdir(redux_path)

for flatkey in flats.keys():
    iraf.imdelete(flats[flatkey]['procflat'], verify='no')
    
    flatlist = flatkey+'.lis'
    procflat = flats[flatkey]['procflat']
    
    print 'Creating twilight flat ', procflat
    
    # Create the processed flat
    iraf.giflat('rg//@'+flatlist, outflat=procflat, fl_vardq='yes')
    
    # Copy the processed flat to the calibration directory
    shutil.copy(procflat, procflat_path)

# The processed flats are:
os.listdir(procflat_path)


Creating twilight flat  S20101102S0018_flat_g.fits
----------------------------------------------------------------------------
GIFLAT -- Wed Mar 23 09:30:31 HST 2016
 
Flat field images = rg//@flat_20101102.lis
Output flat field image = S20101102S0018_flat_g.fits
 
WARNING - GIFLAT: using previously gireduce'd image: rgS20101102S0018
WARNING - GIFLAT: using previously gireduce'd image: rgS20101102S0019
WARNING - GIFLAT: using previously gireduce'd image: rgS20101102S0020
WARNING - GIFLAT: using previously gireduce'd image: rgS20101102S0021
WARNING - GIFLAT: using previously gireduce'd image: rgS20101102S0022
WARNING - GIFLAT: using previously gireduce'd image: rgS20101102S0023
WARNING - GIFLAT: using previously gireduce'd image: rgS20101102S0024
WARNING - GIFLAT: using previously gireduce'd image: rgS20101102S0025
WARNING - GIFLAT: using previously gireduce'd image: rgS20101102S0026
WARNING - GIFLAT: using previously gireduce'd image: rgS20101102S0027
WARNING - GIFLAT: using previously gireduce'd image: rgS20101102S0028
WARNING - GIFLAT: using previously gireduce'd image: rgS20101102S0029
Using input files:
rgS20101102S0018
rgS20101102S0019
rgS20101102S0020
rgS20101102S0021
rgS20101102S0022
rgS20101102S0023
rgS20101102S0024
rgS20101102S0025
rgS20101102S0026
rgS20101102S0027
rgS20101102S0028
rgS20101102S0029
Using STATSEC: [50:900,50:2250] from CCD2
Using NORMSEC: [50:900,50:2250] from CCD2
GIFLAT: Normalization factor 58323.79

GIFLAT exit status: good.
----------------------------------------------------------------------------
Out[8]:
['S20101102S0018_flat_g.fits',
 'S20101102S0100_flat_i.fits',
 'S20101107S0201_flat_r.fits']

Visually inspect the processed twilight flats


In [9]:
for flatkey in flats.keys():
    iraf.gdisplay(flats[flatkey]['procflat'], 1, fl_paste='yes')


GDISPLAY - Started: 2016-03-23T09:31:08

GDISPLAY: Temporary image name tmpout94296_1043S20101102S0018_flat_g.fits

GMULTIAMP - Started: 2016-03-23T09:31:08

GMULTIAMP: Tiling image...
               Image tiled.

GMULTIAMP - Finished: 2016-03-23T09:31:10
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-03-23T09:31:19

STEP 6: Process the fringe frame

STEP 7: Process the target

There is no significant fringing in the g-band. No extra fringing correction will be necessary. If you do want to learn about how to correct for fringing, see the i-band notebook.

All we need to do here is the straighforward processing, i.e. the bias and flat correction. (And overscan and trim.)

STEP 7.1: Bias and flat fielding of the target


In [10]:
os.chdir(redux_path)

iraf.imdelete('g//@sci.lis', verify='no')
iraf.imdelete('rg//@sci.lis', verify='no')

iraf.gireduce('@sci.lis', rawpath=raw_path, fl_over='yes', fl_trim='yes', \
              fl_bias='yes', bias=science['scibias'], \
              fl_flat='yes', flat1=science['sciflat'], \
              fl_vardq='yes')


----------------------------------------------------------------------------
GIREDUCE -- Wed Mar 23 09:31:33 HST 2016

----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:31:33 HST 2016

Input list    = S20101101S0079
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101101S0079.fits   Output  gS20101101S0079.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:31:34 HST 2016

Input list    = S20101101S0080
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101101S0080.fits   Output  gS20101101S0080.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:31:35 HST 2016

Input list    = S20101101S0081
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101101S0081.fits   Output  gS20101101S0081.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
GPREPARE -- Wed Mar 23 09:31:36 HST 2016

Input list    = S20101101S0082
Output list   = 
Output prefix = g
Raw path      = /data/workspace/DRWorkshopAAO/raw/
MDF dir       = gmos$data/
Add MDF       = no

Input  /data/workspace/DRWorkshopAAO/raw/S20101101S0082.fits   Output  gS20101101S0082.fits

GPREPARE exit status: good.
----------------------------------------------------------------------------

Input files:
gS20101101S0079
gS20101101S0080
gS20101101S0081
gS20101101S0082

Output files:
rgS20101101S0079
rgS20101101S0080
rgS20101101S0081
rgS20101101S0082

WARNING - GIREDUCE: Bad Pixel Mask filename is an empty string
                    Only saturated pixels will be flagged
GIREDUCE: Image rgS20101101S0079 overscan subtracted
GIREDUCE: Image rgS20101101S0080 overscan subtracted
GIREDUCE: Image rgS20101101S0081 overscan subtracted
GIREDUCE: Image rgS20101101S0082 overscan subtracted
GIREDUCE: Image rgS20101101S0079 trimmed
GIREDUCE: Image rgS20101101S0080 trimmed
GIREDUCE: Image rgS20101101S0081 trimmed
GIREDUCE: Image rgS20101101S0082 trimmed

Output image       Bias                 Flat               Dark       Scale 
rgS20101101S0079   S20101101S0169_bias  S20101102S0018_flat_g INDEF       0.00
GIREDUCE: Subtracted bias S20101101S0169_bias from rgS20101101S0079
GIREDUCE: Divided image rgS20101101S0079 by flatfield S20101102S0018_flat_g
GIREDUCE: multiplying image rgS20101101S0079 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgS20101101S0080   S20101101S0169_bias  S20101102S0018_flat_g INDEF       0.00
GIREDUCE: Subtracted bias S20101101S0169_bias from rgS20101101S0080
GIREDUCE: Divided image rgS20101101S0080 by flatfield S20101102S0018_flat_g
GIREDUCE: multiplying image rgS20101101S0080 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgS20101101S0081   S20101101S0169_bias  S20101102S0018_flat_g INDEF       0.00
GIREDUCE: Subtracted bias S20101101S0169_bias from rgS20101101S0081
GIREDUCE: Divided image rgS20101101S0081 by flatfield S20101102S0018_flat_g
GIREDUCE: multiplying image rgS20101101S0081 by gain
GIREDUCE: output counts in electrons
Output image       Bias                 Flat               Dark       Scale 
rgS20101101S0082   S20101101S0169_bias  S20101102S0018_flat_g INDEF       0.00
GIREDUCE: Subtracted bias S20101101S0169_bias from rgS20101101S0082
GIREDUCE: Divided image rgS20101101S0082 by flatfield S20101102S0018_flat_g
GIREDUCE: multiplying image rgS20101101S0082 by gain
GIREDUCE: output counts in electrons

GIREDUCE - Cleaning up -- Wed Mar 23 09:32:37 HST 2016

GIREDUCE -- Wed Mar 23 09:32:37 HST 2016
GIREDUCE exit status:  good.
----------------------------------------------------------------------------

Visually inspect the reduce science frames


In [11]:
sciframes = open('sci.lis', 'r')
for line in sciframes:
    frame = line.strip()
    iraf.gdisplay('rg'+frame, 1, fl_paste='yes')
sciframes.close()


GDISPLAY - Started: 2016-03-23T09:37:04

GDISPLAY: Temporary image name tmpout94296_1135rgS20101101S0079.fits

GMULTIAMP - Started: 2016-03-23T09:37:04

GMULTIAMP: Tiling image...
               Image tiled.

GMULTIAMP - Finished: 2016-03-23T09:37:06
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-03-23T09:37:18


GDISPLAY - Started: 2016-03-23T09:37:18

GDISPLAY: Temporary image name tmpout94296_1169rgS20101101S0080.fits

GMULTIAMP - Started: 2016-03-23T09:37:19

GMULTIAMP: Tiling image...
               Image tiled.

GMULTIAMP - Finished: 2016-03-23T09:37:20
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-03-23T09:37:22


GDISPLAY - Started: 2016-03-23T09:37:22

GDISPLAY: Temporary image name tmpout94296_1203rgS20101101S0081.fits

GMULTIAMP - Started: 2016-03-23T09:37:22

GMULTIAMP: Tiling image...
               Image tiled.

GMULTIAMP - Finished: 2016-03-23T09:37:24
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-03-23T09:37:26


GDISPLAY - Started: 2016-03-23T09:37:26

GDISPLAY: Temporary image name tmpout94296_1237rgS20101101S0082.fits

GMULTIAMP - Started: 2016-03-23T09:37:26

GMULTIAMP: Tiling image...
               Image tiled.

GMULTIAMP - Finished: 2016-03-23T09:37:28
GMULTIAMP - Exit status: GOOD

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-03-23T09:37:29

STEP 7.2: Fringe removal

STEP 8: Mosaic the reduced target frames


In [12]:
iraf.imdelete('mrg//@sci.lis', verify='no')

iraf.gmosaic('rg//@sci.lis', fl_vardq='yes')


GMOSAIC 
GMOSAIC -------------------------------------------------------------------
GMOSAIC Log opened at [Wed 09:37:35 23-Mar-2016]
GMOSAIC 
GMOSAIC --------------------
GMOSAIC Input Parameters:
GMOSAIC      inimages       = rg//@sci.lis
GMOSAIC      outimages      = 
GMOSAIC      outpref        = m
GMOSAIC      fl_paste       = no
GMOSAIC      fl_vardq       = yes
GMOSAIC      fl_fixpix      = no
GMOSAIC      fl_clean       = yes
GMOSAIC      fl_fulldq      = no
GMOSAIC      bitflags       = all
GMOSAIC      dqthresh       = 0.1
GMOSAIC      geointer       = linear
GMOSAIC      gap            = default
GMOSAIC      bpmfile        = gmos$data/chipgaps.dat
GMOSAIC      statsec        = default
GMOSAIC      obsmode        = IMAGE
GMOSAIC      sci_ext        = SCI
GMOSAIC      var_ext        = VAR
GMOSAIC      dq_ext         = DQ
GMOSAIC      key_detsec     = DETSEC
GMOSAIC      key_ccdsec     = CCDSEC
GMOSAIC      key_datsec     = DATASEC
GMOSAIC      key_ccdsum     = CCDSUM
GMOSAIC      key_obsmode    = OBSMODE
GMOSAIC      logfile        = 
GMOSAIC      verbose        = yes
GMOSAIC      fl_real        = no
GMOSAIC --------------------
GMOSAIC Input: rgS20101101S0079  Output: mrgS20101101S0079.fits
GMOSAIC Setting rotation Xrot[1]= 0.011000, Yrot[1]= 0.011000
GMOSAIC Setting rotation Xrot[2]= 0.000000, Yrot[2]= 0.000000
GMOSAIC Setting rotation Xrot[3]= 0.012000, Yrot[3]= 0.012000
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1282[SCI,1][1:1024,1:2304] to image tmpchipsci94296_1289
GMOSAIC     xshift: 1.02 yshift: 0.21 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1282[VAR,1][1:1024,1:2304] to image tmpchipvar94296_1290
GMOSAIC     xshift: 1.02 yshift: 0.21 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1282[DQ,1][1:1024,1:2304] to image tmpdq_transimg94296_1278.fits
GMOSAIC     xshift: 1.02 yshift: 0.21 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1282[SCI,2][1:1024,1:2304] to image tmpchipsci94296_1292
GMOSAIC     xshift: 0.00 yshift: 0.00 xmag: 1.00 ymag: 1.00 xrot: 0.00 yrot: 0.00
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1282[VAR,2][1:1024,1:2304] to image tmpchipvar94296_1293
GMOSAIC     xshift: 0.00 yshift: 0.00 xmag: 1.00 ymag: 1.00 xrot: 0.00 yrot: 0.00
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1282[SCI,3][1:1024,1:2304] to image tmpchipsci94296_1295
GMOSAIC     xshift: -2.90 yshift: -0.91 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1282[VAR,3][1:1024,1:2304] to image tmpchipvar94296_1296
GMOSAIC     xshift: -2.90 yshift: -0.91 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1282[DQ,3][1:1024,1:2304] to image tmpdq_transimg94296_1278.fits
GMOSAIC     xshift: -2.90 yshift: -0.91 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC imcopy  tmpchipsci94296_1289  mrgS20101101S0079.fits[1,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipsci94296_1292  mrgS20101101S0079.fits[1,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipsci94296_1295  mrgS20101101S0079.fits[1,append][2085:3108,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar94296_1290  mrgS20101101S0079.fits[2,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar94296_1293  mrgS20101101S0079.fits[2,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar94296_1296  mrgS20101101S0079.fits[2,append][2085:3108,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq94296_1291  mrgS20101101S0079.fits[3,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq94296_1294  mrgS20101101S0079.fits[3,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq94296_1297  mrgS20101101S0079.fits[3,append][2085:3108,1:2304]  INDEF  0.
gmos$data/gmos-s_bpm_EEV_22_3amp_v2_mosaic.pl
GMOSAIC Cleaning areas outside imaging field, cleaning value = 1636.676
GMOSAIC Input: rgS20101101S0080  Output: mrgS20101101S0080.fits
GMOSAIC Setting rotation Xrot[1]= 0.011000, Yrot[1]= 0.011000
GMOSAIC Setting rotation Xrot[2]= 0.000000, Yrot[2]= 0.000000
GMOSAIC Setting rotation Xrot[3]= 0.012000, Yrot[3]= 0.012000
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1298[SCI,1][1:1024,1:2304] to image tmpchipsci94296_1305
GMOSAIC     xshift: 1.02 yshift: 0.21 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1298[VAR,1][1:1024,1:2304] to image tmpchipvar94296_1306
GMOSAIC     xshift: 1.02 yshift: 0.21 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1298[DQ,1][1:1024,1:2304] to image tmpdq_transimg94296_1278.fits
GMOSAIC     xshift: 1.02 yshift: 0.21 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1298[SCI,2][1:1024,1:2304] to image tmpchipsci94296_1308
GMOSAIC     xshift: 0.00 yshift: 0.00 xmag: 1.00 ymag: 1.00 xrot: 0.00 yrot: 0.00
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1298[VAR,2][1:1024,1:2304] to image tmpchipvar94296_1309
GMOSAIC     xshift: 0.00 yshift: 0.00 xmag: 1.00 ymag: 1.00 xrot: 0.00 yrot: 0.00
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1298[SCI,3][1:1024,1:2304] to image tmpchipsci94296_1311
GMOSAIC     xshift: -2.90 yshift: -0.91 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1298[VAR,3][1:1024,1:2304] to image tmpchipvar94296_1312
GMOSAIC     xshift: -2.90 yshift: -0.91 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1298[DQ,3][1:1024,1:2304] to image tmpdq_transimg94296_1278.fits
GMOSAIC     xshift: -2.90 yshift: -0.91 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC imcopy  tmpchipsci94296_1305  mrgS20101101S0080.fits[1,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipsci94296_1308  mrgS20101101S0080.fits[1,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipsci94296_1311  mrgS20101101S0080.fits[1,append][2085:3108,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar94296_1306  mrgS20101101S0080.fits[2,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar94296_1309  mrgS20101101S0080.fits[2,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar94296_1312  mrgS20101101S0080.fits[2,append][2085:3108,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq94296_1307  mrgS20101101S0080.fits[3,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq94296_1310  mrgS20101101S0080.fits[3,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq94296_1313  mrgS20101101S0080.fits[3,append][2085:3108,1:2304]  INDEF  0.
gmos$data/gmos-s_bpm_EEV_22_3amp_v2_mosaic.pl
GMOSAIC Cleaning areas outside imaging field, cleaning value = 1642.487
GMOSAIC Input: rgS20101101S0081  Output: mrgS20101101S0081.fits
GMOSAIC Setting rotation Xrot[1]= 0.011000, Yrot[1]= 0.011000
GMOSAIC Setting rotation Xrot[2]= 0.000000, Yrot[2]= 0.000000
GMOSAIC Setting rotation Xrot[3]= 0.012000, Yrot[3]= 0.012000
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1314[SCI,1][1:1024,1:2304] to image tmpchipsci94296_1321
GMOSAIC     xshift: 1.02 yshift: 0.21 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1314[VAR,1][1:1024,1:2304] to image tmpchipvar94296_1322
GMOSAIC     xshift: 1.02 yshift: 0.21 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1314[DQ,1][1:1024,1:2304] to image tmpdq_transimg94296_1278.fits
GMOSAIC     xshift: 1.02 yshift: 0.21 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1314[SCI,2][1:1024,1:2304] to image tmpchipsci94296_1324
GMOSAIC     xshift: 0.00 yshift: 0.00 xmag: 1.00 ymag: 1.00 xrot: 0.00 yrot: 0.00
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1314[VAR,2][1:1024,1:2304] to image tmpchipvar94296_1325
GMOSAIC     xshift: 0.00 yshift: 0.00 xmag: 1.00 ymag: 1.00 xrot: 0.00 yrot: 0.00
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1314[SCI,3][1:1024,1:2304] to image tmpchipsci94296_1327
GMOSAIC     xshift: -2.90 yshift: -0.91 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1314[VAR,3][1:1024,1:2304] to image tmpchipvar94296_1328
GMOSAIC     xshift: -2.90 yshift: -0.91 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1314[DQ,3][1:1024,1:2304] to image tmpdq_transimg94296_1278.fits
GMOSAIC     xshift: -2.90 yshift: -0.91 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC imcopy  tmpchipsci94296_1321  mrgS20101101S0081.fits[1,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipsci94296_1324  mrgS20101101S0081.fits[1,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipsci94296_1327  mrgS20101101S0081.fits[1,append][2085:3108,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar94296_1322  mrgS20101101S0081.fits[2,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar94296_1325  mrgS20101101S0081.fits[2,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar94296_1328  mrgS20101101S0081.fits[2,append][2085:3108,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq94296_1323  mrgS20101101S0081.fits[3,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq94296_1326  mrgS20101101S0081.fits[3,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq94296_1329  mrgS20101101S0081.fits[3,append][2085:3108,1:2304]  INDEF  0.
gmos$data/gmos-s_bpm_EEV_22_3amp_v2_mosaic.pl
GMOSAIC Cleaning areas outside imaging field, cleaning value = 1645.113
GMOSAIC Input: rgS20101101S0082  Output: mrgS20101101S0082.fits
GMOSAIC Setting rotation Xrot[1]= 0.011000, Yrot[1]= 0.011000
GMOSAIC Setting rotation Xrot[2]= 0.000000, Yrot[2]= 0.000000
GMOSAIC Setting rotation Xrot[3]= 0.012000, Yrot[3]= 0.012000
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1330[SCI,1][1:1024,1:2304] to image tmpchipsci94296_1337
GMOSAIC     xshift: 1.02 yshift: 0.21 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1330[VAR,1][1:1024,1:2304] to image tmpchipvar94296_1338
GMOSAIC     xshift: 1.02 yshift: 0.21 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1330[DQ,1][1:1024,1:2304] to image tmpdq_transimg94296_1278.fits
GMOSAIC     xshift: 1.02 yshift: 0.21 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1330[SCI,2][1:1024,1:2304] to image tmpchipsci94296_1340
GMOSAIC     xshift: 0.00 yshift: 0.00 xmag: 1.00 ymag: 1.00 xrot: 0.00 yrot: 0.00
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1330[VAR,2][1:1024,1:2304] to image tmpchipvar94296_1341
GMOSAIC     xshift: 0.00 yshift: 0.00 xmag: 1.00 ymag: 1.00 xrot: 0.00 yrot: 0.00
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1330[SCI,3][1:1024,1:2304] to image tmpchipsci94296_1343
GMOSAIC     xshift: -2.90 yshift: -0.91 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1330[VAR,3][1:1024,1:2304] to image tmpchipvar94296_1344
GMOSAIC     xshift: -2.90 yshift: -0.91 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC 
GMOSAIC Transforming image tmpimg94296_1330[DQ,3][1:1024,1:2304] to image tmpdq_transimg94296_1278.fits
GMOSAIC     xshift: -2.90 yshift: -0.91 xmag: 1.00 ymag: 1.00 xrot: 0.01 yrot: 0.01
GMOSAIC imcopy  tmpchipsci94296_1337  mrgS20101101S0082.fits[1,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipsci94296_1340  mrgS20101101S0082.fits[1,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipsci94296_1343  mrgS20101101S0082.fits[1,append][2085:3108,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar94296_1338  mrgS20101101S0082.fits[2,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar94296_1341  mrgS20101101S0082.fits[2,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipvar94296_1344  mrgS20101101S0082.fits[2,append][2085:3108,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq94296_1339  mrgS20101101S0082.fits[3,append][1:1024,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq94296_1342  mrgS20101101S0082.fits[3,append][1043:2066,1:2304]  INDEF  0.
GMOSAIC imcopy  tmpchipdq94296_1345  mrgS20101101S0082.fits[3,append][2085:3108,1:2304]  INDEF  0.
gmos$data/gmos-s_bpm_EEV_22_3amp_v2_mosaic.pl
GMOSAIC Cleaning areas outside imaging field, cleaning value = 1676.854
GMOSAIC All 4 images successfully mosaiced.
GMOSAIC --------------------
GMOSAIC Exit status: SUCCESS
GMOSAIC Log closed at [Wed 09:38:16 23-Mar-2016]
GMOSAIC -------------------------------------------------------------------
GMOSAIC 

Visually inspect the mosaiced frames


In [13]:
sciframes = open('sci.lis', 'r')
for line in sciframes:
    frame = line.strip()
    iraf.gdisplay('mrg'+frame, 1, z2=20000, fl_paste='yes')
sciframes.close()


GDISPLAY - Started: 2016-03-23T09:39:57

WARNING - GDISPLAY: only one science extension found, turning paste off

WARNING - GDISPLAY: Input image has been processed by GMOSAIC.
                    Switching off the following flags:
                          ret_roi=no

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-03-23T09:40:25


GDISPLAY - Started: 2016-03-23T09:40:25

WARNING - GDISPLAY: only one science extension found, turning paste off

WARNING - GDISPLAY: Input image has been processed by GMOSAIC.
                    Switching off the following flags:
                          ret_roi=no

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-03-23T09:40:26


GDISPLAY - Started: 2016-03-23T09:40:27

WARNING - GDISPLAY: only one science extension found, turning paste off

WARNING - GDISPLAY: Input image has been processed by GMOSAIC.
                    Switching off the following flags:
                          ret_roi=no

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-03-23T09:40:28


GDISPLAY - Started: 2016-03-23T09:40:28

WARNING - GDISPLAY: only one science extension found, turning paste off

WARNING - GDISPLAY: Input image has been processed by GMOSAIC.
                    Switching off the following flags:
                          ret_roi=no

GDISPLAY: Displaying image...

GDISPLAY: Starting imexamine - quit with q

GDISPLAY - Finished: 2016-03-23T09:40:29

STEP 9: Align and stack the mosaic target frames


In [14]:
iraf.imdelete(science['procsci'], verify='no')

iraf.imcoadd('mrg//@sci.lis', outimage=science['procsci'], logfile=logfile)


-----------------------------------------------------------------------------
IMCOADD -- Wed Mar 23 09:40:37 HST 2016

Images (and masks) in list
mrgS20101101S0079
mrgS20101101S0080
mrgS20101101S0081
mrgS20101101S0082
Alignment method: wcs
Making individual masks from DQ
Fixpix input images using DQ
Instrument + camera      : GMOS-S  
Telescope ISS port number: 3
Bad pixel file gmos$data/gmos-s_bpm_EEV_22_3amp_v2_mosaic.pl
Read noise:   3.85 e-   Gain:   1.00 e-/ADU
Co-added cleaned output image: ngc6872_g
Pixel scale: 0.1461
Statistics section: [100:3008,100:2204]
Finding objects in mrgS20101101S0079
Sampling for geotran  : 20  20
Block size for geotran: 2048  2048
Centering objects in mrgS20101101S0079
Number of objects successfully centered in reference image 479
Alignment method: wcs

Coordinate list: imxymatch.1  Transform: mrgS20101101S0080_trn
    Results file: 
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.006376649  0.006066529
Coordinate mapping parameters
    Mean Xref and Yref: 1554.5  1152.5
    Mean Xin and Yin: 1520.273  1152.51
    X and Y shift: -34.20962  -0.007519372  (xin  yin)
    X and Y scale: 0.9999979  0.9999979  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99927  359.99927  (degrees  degrees)
Centering objects in mrgS20101101S0080

Xmax =  3108   Ymax = 2304
Entering geomap
Fitting geometry rscale
Iterating a maximum of 5 times

Coordinate list: mrgS20101101S0080_trn  Transform: mrgS20101101S0080_trn
    Results file: tmpres94296_1367
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 10.66747  11.80431
Coordinate mapping parameters
    Mean Xref and Yref: 1578.701  1189.045
    Mean Xin and Yin: 1540.07  1188.051
    X and Y shift: -32.87099  0.8791504  (xin  yin)
    X and Y scale: 0.998768  0.9987679  (xin / xref  yin / yref)
    X and Y axis rotation: 359.97919  359.97919  (degrees  degrees)

Coordinate list: mrgS20101101S0080_trn  Transform: mrgS20101101S0080_trn
    Results file: tmpres94296_1367
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 1.928898  2.856887
Coordinate mapping parameters
    Mean Xref and Yref: 1582.183  1178.936
    Mean Xin and Yin: 1547.752  1179.083
    X and Y shift: -34.27618  -0.3265381  (xin  yin)
    X and Y scale: 0.9998376  0.9998376  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99789  359.99789  (degrees  degrees)

Coordinate list: mrgS20101101S0080_trn  Transform: mrgS20101101S0080_trn
    Results file: tmpres94296_1367
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.2244764  0.2227877
Coordinate mapping parameters
    Mean Xref and Yref: 1581.822  1174.077
    Mean Xin and Yin: 1547.389  1173.564
    X and Y shift: -34.37864  -0.5596924  (xin  yin)
    X and Y scale: 1.000032  1.000032  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99820  359.99820  (degrees  degrees)

Coordinate list: mrgS20101101S0080_trn  Transform: mrgS20101101S0080_trn
    Results file: tmpres94296_1367
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.1304441  0.108666
Coordinate mapping parameters
    Mean Xref and Yref: 1600.856  1151.246
    Mean Xin and Yin: 1566.495  1150.766
    X and Y shift: -34.41573  -0.5427246  (xin  yin)
    X and Y scale: 1.000036  1.000036  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99936  359.99936  (degrees  degrees)

Coordinate list: imxymatch.1  Transform: mrgS20101101S0081_trn
    Results file: 
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.006469058  0.006328654
Coordinate mapping parameters
    Mean Xref and Yref: 1554.5  1152.5
    Mean Xin and Yin: 1554.478  1118.258
    X and Y shift: -0.01755141  -34.23986  (xin  yin)
    X and Y scale: 0.9999977  0.9999977  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99997  359.99997  (degrees  degrees)
Centering objects in mrgS20101101S0081

Xmax =  3108   Ymax = 2304
Entering geomap
Fitting geometry rscale
Iterating a maximum of 5 times

Coordinate list: mrgS20101101S0081_trn  Transform: mrgS20101101S0081_trn
    Results file: tmpres94296_1367
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 10.68991  11.0293
Coordinate mapping parameters
    Mean Xref and Yref: 1582.098  1190.153
    Mean Xin and Yin: 1543.365  1154.852
    X and Y shift: -34.37299  -33.54431  (xin  yin)
    X and Y scale: 0.9994388  0.9994388  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99374  359.99374  (degrees  degrees)

Coordinate list: mrgS20101101S0081_trn  Transform: mrgS20101101S0081_trn
    Results file: tmpres94296_1367
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 1.619312  2.631857
Coordinate mapping parameters
    Mean Xref and Yref: 1570.093  1173.383
    Mean Xin and Yin: 1535.885  1139.239
    X and Y shift: -34.5015  -35.1217  (xin  yin)
    X and Y scale: 1.000136  1.000136  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99335  359.99335  (degrees  degrees)

Coordinate list: mrgS20101101S0081_trn  Transform: mrgS20101101S0081_trn
    Results file: tmpres94296_1367
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.2357521  0.2067228
Coordinate mapping parameters
    Mean Xref and Yref: 1581.517  1186.771
    Mean Xin and Yin: 1547.247  1151.961
    X and Y shift: -34.35462  -34.88684  (xin  yin)
    X and Y scale: 1.000071  1.000071  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99884  359.99884  (degrees  degrees)

Coordinate list: mrgS20101101S0081_trn  Transform: mrgS20101101S0081_trn
    Results file: tmpres94296_1367
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.1541364  0.1178112
Coordinate mapping parameters
    Mean Xref and Yref: 1583.421  1171.082
    Mean Xin and Yin: 1549.158  1136.302
    X and Y shift: -34.34524  -34.89685  (xin  yin)
    X and Y scale: 1.000068  1.000068  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99872  359.99872  (degrees  degrees)

Coordinate list: imxymatch.1  Transform: mrgS20101101S0082_trn
    Results file: 
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.006644911  0.006563063
Coordinate mapping parameters
    Mean Xref and Yref: 1554.5  1152.5
    Mean Xin and Yin: 1588.727  1152.492
    X and Y shift: 34.24274  -0.02162275  (xin  yin)
    X and Y scale: 0.9999974  0.9999974  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99939  359.99939  (degrees  degrees)
Centering objects in mrgS20101101S0082

Xmax =  3108   Ymax = 2304
Entering geomap
Fitting geometry rscale
Iterating a maximum of 5 times

Coordinate list: mrgS20101101S0082_trn  Transform: mrgS20101101S0082_trn
    Results file: tmpres94296_1367
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 10.8326  10.80101
Coordinate mapping parameters
    Mean Xref and Yref: 1580.676  1186.48
    Mean Xin and Yin: 1576.63  1151.835
    X and Y shift: -0.1975668  -32.7406  (xin  yin)
    X and Y scale: 0.9993216  0.9993215  (xin / xref  yin / yref)
    X and Y axis rotation: 0.00498  0.00498  (degrees  degrees)

Coordinate list: mrgS20101101S0082_trn  Transform: mrgS20101101S0082_trn
    Results file: tmpres94296_1367
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 2.148307  2.971612
Coordinate mapping parameters
    Mean Xref and Yref: 1574.05  1174.098
    Mean Xin and Yin: 1574.076  1140.068
    X and Y shift: 0.08651213  -34.20557  (xin  yin)
    X and Y scale: 0.9997593  0.9997593  (xin / xref  yin / yref)
    X and Y axis rotation: 0.00119  0.00119  (degrees  degrees)

Coordinate list: mrgS20101101S0082_trn  Transform: mrgS20101101S0082_trn
    Results file: tmpres94296_1367
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.1983735  0.1692968
Coordinate mapping parameters
    Mean Xref and Yref: 1579.009  1183.723
    Mean Xin and Yin: 1578.899  1149.057
    X and Y shift: -0.07601867  -34.67151  (xin  yin)
    X and Y scale: 1.000032  1.000032  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99896  359.99896  (degrees  degrees)

Coordinate list: mrgS20101101S0082_trn  Transform: mrgS20101101S0082_trn
    Results file: tmpres94296_1367
Coordinate mapping status
    X fit ok.  Y fit ok.
    Xin and Yin fit rms: 0.1242769  0.1127741
Coordinate mapping parameters
    Mean Xref and Yref: 1596.65  1167.627
    Mean Xin and Yin: 1596.604  1133.032
    X and Y shift: -0.09013443  -34.68982  (xin  yin)
    X and Y scale: 1.000047  1.000047  (xin / xref  yin / yref)
    X and Y axis rotation: 359.99857  359.99857  (degrees  degrees)

Median sky level for mrgS20101101S0079:   1590.3
Transforming mrgS20101101S0080 to mrgS20101101S0080_trn

Transforming image mrgS20101101S0080[SCI] to image mrgS20101101S0080_trn
    Using transform mrgS20101101S0080_trn in database imcoadd.dat
Median sky level for mrgS20101101S0080:   1596.0
Transforming mrgS20101101S0081 to mrgS20101101S0081_trn

Transforming image mrgS20101101S0081[SCI] to image mrgS20101101S0081_trn
    Using transform mrgS20101101S0081_trn in database imcoadd.dat
Median sky level for mrgS20101101S0081:   1600.9
Transforming mrgS20101101S0082 to mrgS20101101S0082_trn

Transforming image mrgS20101101S0082[SCI] to image mrgS20101101S0082_trn
    Using transform mrgS20101101S0082_trn in database imcoadd.dat
Median sky level for mrgS20101101S0082:   1608.0
Median sky level for mrgS20101101S0079:   1590.3
Median sky level for mrgS20101101S0080:   1596.0
Transforming mrgS20101101S0079badpix +mask to mrgS20101101S0080badpix

Transforming image tmpmsk94296_1361 to image mrgS20101101S0080badpix
    Using transform mrgS20101101S0080_trn in database imcoadd.dat
Median sky level for mrgS20101101S0081:   1600.9
Transforming mrgS20101101S0079badpix +mask to mrgS20101101S0081badpix

Transforming image tmpmsk94296_1398 to image mrgS20101101S0081badpix
    Using transform mrgS20101101S0081_trn in database imcoadd.dat
Median sky level for mrgS20101101S0082:   1608.0
Transforming mrgS20101101S0079badpix +mask to mrgS20101101S0082badpix

Transforming image tmpmsk94296_1402 to image mrgS20101101S0082badpix
    Using transform mrgS20101101S0082_trn in database imcoadd.dat

Mean intensity for   mrgS20101101S0079_trn:  (N,absolute,relative)=  194  1533307  1.000
Mean intensity for   mrgS20101101S0080_trn:  (N,absolute,relative)=  194  1538577  1.003
Mean intensity for   mrgS20101101S0081_trn:  (N,absolute,relative)=  194  1534460  1.001
Mean intensity for   mrgS20101101S0082_trn:  (N,absolute,relative)=  194  1532384  0.999

Masking cosmic ray events in mrgS20101101S0079_trn
Applying growth radius 1
Masking cosmic ray events in mrgS20101101S0080_trn
Applying growth radius 1
Masking cosmic ray events in mrgS20101101S0081_trn
Applying growth radius 1
Masking cosmic ray events in mrgS20101101S0082_trn
Applying growth radius 1
IMCOADD exit status: good
-----------------------------------------------------------------------------

STEP 10: Inspect and save product


In [15]:
iraf.display(science['procsci']+'[sci,1]', 1, \
             zrange='no', zscale='no', z1=1000, z2=20000)

shutil.copy(science['procsci'], products_path)

# Final reduced image
os.listdir(products_path)


z1=1000. z2=20000.
Out[15]:
['ngc6872_g.fits', 'ngc6872_i.fits', 'ngc6872_r.fits']

In [ ]: