Lbc data reduction

24
LBC data reduction 1 with IRAF and SCAMP & SWARP 2 Poon Panichpibool 3 December 27, 2015 1 Edited by Dr. Ricky Patterson. 2 SCAMP and SWARP by Dr. Emmanuel Bertin. 3 http://www.astro.virginia.edu/~pp9mx/

Transcript of Lbc data reduction

LBC data reduction 1with IRAF and SCAMP & SWARP 2

Poon Panichpibool3

December 27, 2015

1Edited by Dr. Ricky Patterson.2SCAMP and SWARP by Dr. Emmanuel Bertin.3http://www.astro.virginia.edu/~pp9mx/

ii

Contents

1 Introduction 31.1 Required Software packages . . . . . . . . . . . . . . . . . . . 3

2 Data Reduction with IRAF 5

3 Final step to combine object frames 15

iii

iv CONTENTS

CONTENTS 1

Acknowledgements• A special word of thanks goes to Professor Don Knuth1 (for TEX) and

Leslie Lamport2 (for LATEX).

• I’ll also like to thank Gummi3 developers and LaTeXila4 developmentteam for their awesome LATEX editors.

• I’m deeply indebted my parents, colleagues and friends for their sup-port and encouragement.

Amber Jainhttp://amberj.devio.us/

1http://www-cs-faculty.stanford.edu/~uno/2http://www.lamport.org/3http://gummi.midnightcoding.org/4http://projects.gnome.org/latexila/

2 CONTENTS

1

Introduction

1.1 Required Software packages

There are several methods to reduce the LBC data. If you are proficientwith Python you can try these two methods

LBC_redux package by Dr. Neil Crighton.https://github.com/nhmc/LBC_redux

LBC GUI piepline V 1.0 (Dec 2007) by Researchers at the INAF Astronom-ical Observatory of Rome.http://lbc.oa-roma.inaf.it/commissioning/data/LBCGUI_PIPELINE/index.html#introIf you want to use IDL, then you can try

LBC-reduction package by Dr. Benjamin Weiner is an alternative method.https://github.com/bjweiner/LBC-reduction

However, in this LBC data reduction document, I will show you how touse available software packages at the Astronomy department of the Uni-versity of Virginia. You will require the following software packages andfiles.

1. IDL (also need IDLUTILIS to be installed)2. IRAF (CCDRED package)3. SExtractor (should be already installed in the department pc)4. SCAMP (should be already installed in the department pc)5. SWARP (should be already installed in the department pc)6. LBC translation files (lbc.dat and subssets)7. Configuration files for SExtractor, SCAMP, and SWARP

3

4 1. INTRODUCTION

LBC translation fiels and configuration files can be retrieved from https://github.com/poonpa/lbc.git

2

Data Reduction with IRAF

Once you have retrieve all data from the LBT archive, the next step will begetting IRAF to run all reduction process. In this part, I will use the stepsthat I followed from Massey’s IRAF data reduction handbook: A User’sGuide to CCD Reductions with IRAF http://iraf.noao.edu/iraf/ftp/iraf/docs/ccduser3.ps.Z

Typical process of CCD data reduction is shown in Figure 2.1. Firstof all, you should create a RAW images directory to store all your rawdata. Then create a processing directory to store copies of raw data. Itis critical to separate raw data from processing data since you can alwaysretrive untouched raw data in case you make a mistake on processing theimages.

Here are steps to reduce the LBC data with IRAF.1. First, load the CCDRED package, which is the part of the IMRED

package:

2. Now you have to set up the setinstrument task and create subsets file.To finish the setting up for setinstrument, you simply download "lbc.dat"(Credit Mr. Scott Adams) and then store it in working directory or inspecific directory e.g. /net/home/pp9mx/iraf/agnproj/lbc/lbc.dat

5

6 2. DATA REDUCTION WITH IRAF

This is what the lbc.dat looks like.

This "lbc.dat" will help IRAF to be able to understand and read theheader of your images. Next you have to set up the subsets file. the subsetsfile will contain information about all filters for your images. This is whatthe subsets file looks like.

Now do "epar setinstrument" to set up parameters correctly:

then doccdred> setinstrument

7

Instrument ID (type ? for a list) (lbc):

And do "epar ccdred" (once you hit return/enter in the previous step,IRAF will pop up epar ccdred automatically.)

3. Check if you set up the setintrument correctly by using "CCDLIST"task. then doccdred> ccdlist *.fits

Here is what it shoule look like

You can see that ccdlist will tell information about each image such asimage type, and filter.

Once these images are processed then there will be processing codesadded into the output from ccdlist.

Here are processing codes:B - Bad pixel replacementO - Overscan bias subtractionT - TrimmingZ - Zero level subtractionD - Dark count subtractionF - Flat field calibrationI - Illumination correction

8 2. DATA REDUCTION WITH IRAF

Q - Fringe correction4. CCDPROC steps. overall process for this step is shown in figure 2.1 i.e.Starting with zerocombine to make a master bias, then overscan subtraction,making a master flat, bias correction, and flat fielding/flat correction.

4.1 Now starting with making a master bias. It will be easier to createa list of files by

ccdred> ls lbcb* > biasb.list thenccdred> cat biasb.listthen do "epar zerocombine" to set up input and output. It should look likethis

4.2 Then run CCDPROC for the first round (to do overscan bias subtrac-tion and Trimming). First you have to determine the section to be trimmed.These information are in the image header which you can find by do "imheadimage l+".For bias section, you should be looking forBIASSEC = ’[2099:2304,1:4608]’ / Bias section

For trim section, you should be looking forTRIMSEC = ’[51:2098,1:4608]’ / Section of useful dataNext do "epar CCDPROC" to edit parameters for CCDPROC process. Itshould look like this

9

Figure 2.1: Typicall data reduction process.

10 2. DATA REDUCTION WITH IRAF

Now the CCDPROC is ready for the first. However, for the first run youshould run this step interactively to see if there is anything wrong with theoverscan region or not. You can run CCDPROC interactively by choosing"yes" in (interact = ) line.(interac= yes) Fit overscan interactively?

11

Now all frames should have [OT] when run "CCDLIST" task.4.3 Next, run "CCDPROC" again now with zerocorrection on.

(zerocor= yes) Apply zero level correction?(zero = biasb.fits) Zero level calibration image

After the process is done, you should see [OTZ] after running the "CCDLIST"task.

4.4 Next, create a master flat field by do "epar flatcombine" to edit pa-rameters.

input = zlbcb* List of flat field images to combine(output = bflat.fits) Output flat field root name(combine= median) Type of combine operation(reject = avsigclip) Type of rejection(ccdtype= flat) CCD image type to combine(process= no) Process images before combining?(subsets= no) Combine images by subset parameter?(delete = no) Delete input images after combining?

12 2. DATA REDUCTION WITH IRAF

(clobber= no) Clobber existing output image?(scale = mode) Image scaling

At the end of this flatcombine step, you will get a master flat field.4.5 Now it’s time to run "CCDPROC" again but this time, the flatcor

will be turn on.

(flatcor= yes) Apply flat field correction?(flat = bflat.fits) Flat field images

After the 2nd CDDPROC run finish, all images should have [OTZF]showed up after runnung "CCDLIST" task.

ccdred> ccdlist FZ*.fitsFZlbcb.20150423.031814_2.fits[2048,4608][real][object][g_SLOAN][OTZF]:WISE_1046-02FZlbcb.20150423.032110_2.fits[2048,4608][real][object][g_SLOAN][OTZF]:WISE_1046-02

Now your images are Overscan corrected, Trimmed, Bias subtracted, andFlattened. The images are ready to be combined into the final image. Inorder to combine all object frames, you will have to use SExtractor, SCAMPSWARP to do Astrometry correction and stack all object images.

Here is the example of a combined object frame without using SCAMPand SWARP to correct astrometry error. As you can see in Figure 2.2, starsand galaxies are not matched with SDSS R-6 Catalog in DS9.

Steps to run SExtractor, SCAMP SWARP will be in the next chapter.

13

Figure 2.2: A combined object frame without using SCAMP andSWARP.Green circles are SDSS R-6 catalog positions of celestial objects.If astrometry is corrected, the circles should be on top of objects in theframe.

14 2. DATA REDUCTION WITH IRAF

3

Final step to combine objectframes

In the previous chapter all object frames are ready to be combined. How-ever, if you display the object frame in DS9 and overlay with SDSS R-6catalog or any optical catalog, you will notice that objects are not alignedwith catalog. The astrometic calibration must be done prior any combiningprocess since the projection of sky coordinates onto a detector CCD planeis not perfect due to the basic geometry of the observation, effects from at-mospheric refraction and distortions inroduced by the telescope and opticalinstruments (shown in Figure 3.1). Therefore, astrometic correction need tobe implement before finally combine all object frames.

Overall steps will be

SExtractor ⇒ Retrieve catalog from all object frames↓SCAMP ⇒ use Retrieved catalogs and Reference catalog to get Astrometiccorrrection, stored in new header for each object frame.↓SWARP ⇒ use corrected header to "Swarp" each object frame in order toachieve correct coordinates, then stack and combine all object frames.↓Now you have an astrometry corrected combined object fram ready to beused!

1. Making catalog with SExtractor. In this step, you will use SEx-tractor by Dr. Emmanuel Bertin (should be installed on the department’spc. You can also download SExtractor from http://www.astromatic.net/

15

16 3. FINAL STEP TO COMBINE OBJECT FRAMES

Figure 3.1: Illustration of possible problems of astrometry.

17

Figure 3.2: Flow diagram of Astrometic calibration using SExtractor,SCAMP, and SWARP.

18 3. FINAL STEP TO COMBINE OBJECT FRAMES

software/sextractor)Starting with running SExtractor on all OTZF object frames. *Make

sure that you have all configuration files in the working directory. For thisstep, you will use ldac.sex to create FIT_LDAC catalog file which is re-quired by SCAMP.You will also need forscamp.param. Then dovocl> !sex FZlbcr.20150420.110806_2.fits -c ldac.sexNow you will have a FITS_LDAC catalog. Repeat this step for the rest ofobject frames.FZlbcr.20150420.110806_2.catFZlbcr.20150420.111050_2.catFZlbcr.20150420.111346_2.catFZlbcr.20150420.111622_2.catFZlbcr.20150420.111906_2.catThen make a list file of all 5 catalogs e.g. bcat.list and rcat.list

2. Running SCAMP to get astrometic calibration solution. First, youhave to make ".ahead files" for all object frames. Then you will create ".headfiles" as well. Please note that you have to make sure that your object isin the reference catalog. For instance, if the object can be found in SDSScatalog then you can use SDSS R-6 reference catalog.

Next, do

vocl> !scamp @bcat.list -c makeahead.scampvocl> !scamp @rcat.list -c makeahead.scamp

19

Then, do

vocl> !scamp @bcat.list -c default.scampvocl> !scamp @rcat.list -c default.scamp

Now you will have a astrometry corrected header files for each objectframe.

3. Running SWARP to stack astrometic calibrated object frames into acombined image. Prior running SWARP, you also have to make a directorycalled "resample" for SWARP to temporarily store resampled intermediateimages. If you forget to do so, SWARP will use original images to combine.As a result, your combined image will have a wrong coordinates i.e. noastrometic correction.

Next, after create list files for all object frames, do

vocl> !swarp @bim.list -c default.swarpvocl> !swarp @rim.list -c default.swarp

*Note that you have to change the name of output file in default.swarp(IMAGEOUT_NAME line and WEIGHT_OUT line).

Now you will have a final combined and astrometic calibrated image!Nonetheless, you have to further confirm with reference catalog by display-ing the combined image on DS9 and then overlaying with reference Catalogsuch as SDSS R-6 or USNO A2. As shown in Figure 3.3, if the astrometiccalibration is done correctly, the overlay references should be on top of ob-jects in the frame.

δ(R−I)2 = 11−∆a2

[δr2 + δi2 + δa2

0,R + δa20,I + δa2

1,RX + δa21,IX + (R− I)(δa2

2,R + δa22,I)]

(3.1)

20 3. FINAL STEP TO COMBINE OBJECT FRAMES

Figure 3.3: A combined object frame using SCAMP and SWARP. Magentacircles are SDSS R-6 catalog positions of celestial objects.