Thursday, January 28, 2016

Swift Supernova Analysis Workflow

I'm writing this mostly for some undergraduates who will help with some data reduction, but others might find the links and steps useful.

Swift supernova spreadsheet

https://docs.google.com/spreadsheets/d/1h1RB28-5BK1D-KmThlyTyvfvWO9oVJJ8-zfa22ZHXR4/

The first few columns of that spreadsheet are used to create the Swift supernova website with links added for images, data, and light curves which exist in the folder

http://people.physics.tamu.edu/pbrown/SwiftSN/swift_sn.html

The official target of opportunity list is at:
https://www.swift.psu.edu/secure/toop/summary.php

Current supernova are listed at
https://www.swift.psu.edu/secure/toop/supernovae.php

Those pages can be used to find which supernovae have been proposed and which are still being observed.  With a name or target id (the name of the supernova or host is preferred when searching as sometimes multiple target ids are used for the same target).

########   Downloading data

For recent (less than one week) data on current supernovae, you can download the data from the quicklook site.  For these quick reductions I just download the *_sk.img images into a folder /currentSwiftSNe/SNname/

>cd Desktop /SN/currentSwiftSNe/

http://swift.gsfc.nasa.gov/cgi-bin/sdc/ql?

For archived data, I download all image files from the Swift Archive checking the Swift auxiliary data and Swift uvot data boxes.  These I download into a /SwiftSNarchive/SNname/ folder

>cd Desktop /SN/SwiftSNarchive/

http://heasarc.gsfc.nasa.gov/cgi-bin/W3Browse/swift.pl

########## Processing data

My scripts look for all the gzipped data (so you can exclude data by unzipping it) so first zip it.  And at some point you might need to go into the tcsh shell

>mkdir SNname
>  cd SNname

>touch SNname_downloadcommands.txt &
>edit  SNname_downloadcommands.txt

Paste the downloaded data from the archive into the text editor and then source it

>source SNname_downloadcommands.txt

create a ds9 region file with a radius of 3 arcseconds centered on the supernova and called SNname_3.reg.  Also make a background region file named SNname_bkg.reg which has a similar background and a SNname_bkgclear.reg region clear of background stars and galaxy flux.

> gzip -f */uvot/image/*sk.img
> tcsh
> source $SNSCRIPTS/makecommands14.1.txt   <SNname>  <optional template obs id>

This generates commands to sum together the data by observation id and then append them together into one multi-extension fits file per filter plus the template images

> source SNname_allcommands.txt
> source $SNSCRIPTS/SNgalsub15.1.maghist.txt SNname

and a bunch of figures might pop up and a SNname_uvotB15.1.dat file will be created (among others).  Then I exit tcsh and make a plot with xmgrace.


> exit
> xmgrace &

I save it as a pnm file and then convert it to jpg
> convert SNname_lightcurve.pnm SNname_lightcurve.jpg

I also make a three color image

ds9 -scale log -rgb -red SNname_vv_sum.img.gz -green SNname_uu_sum.img.gz -blue SNname_m2_sum.img.gz

adjust the colors contrast and brightness.
Then save image > png >    save as SNname_uvot.png





1 comment: