Monday, August 8, 2016

Interpreting Flux from Broadband Photometry

Many of the techniques used on optical data to convert broadband photometry to flux, including creating spectral energy distributions and integrating the pseudobolometric flux, don't work very well in the ultraviolet.  After struggling with these issues for years, I wrote the following paper to demonstrate the difficulties and quantify the effects.  It is now on astro-ph and published in the Astronomical Journal.

The figures in the paper were designed to compare effects with a consistent wavelength range within the confines of a two column article.  So many of the figures are tall and hard to read if you are reading or projecting the paper onto a typical wide screen (like for many astro-ph/astrocoffee style discussions).  I have created a pdf with most of the figures reproduced as single panels.  That version is here. 

Comments are welcome.

Wednesday, May 25, 2016

Swift Target of Opportunity Priorities (urgency)

The stated meanings of the Swift Target of Opportunity (ToO) priorities are listed below.  For new supernovae I recommend a "High Urgency" ToO.  During the day it will sometimes be executed within a few hours as an uploaded target directly to the spacecraft.  At the latest it will be discussed the next morning--if you submit it after hours it is visible to the Swift team but does not actively page them until the next morning.  If the SN is older, a medium or low urgency request would be more appropriate.  This includes requests for continued campaigns on Swift SNe which can be planned and rerequested several days before the already requested exposures are completed so that the campaign goes on continuously but without requiring immediate action by the Swift team or bumping out previously planned targets.  The normal planning schedule is also copied from the Swift ToO page below.


A "Highest Urgency" ToO might be appropriate for a very nearby, very young supernova.  SN2011fe, with a very recent upper limit, would certainly qualify.  If a SN is discovered one night and confirmed the next night, it is probably is fine to do it as a high urgency.



From the Swift Target of Opportunity request page:


####################  (previous version used yellow highlighting which was awful to read)



Response Priorities:

    A "Highest Urgency" ToO will immediately page the Swift PI and Science Operations team, even in the middle of the night.
    "High Urgency" ToO requests will page the PI and Science Operations team immediately during working hours.
    "Medium Urgency" requests will be handled during daylight hours.
    "Low Urgency" requests will be handled at the daily planning meeting which is 9-10am Eastern Time (USA) M-F.

Please avoid using the Highest Urgency unless absolutely essential, for example

    Galactic or local-group supernova
    High-probability gravitational wave event
    High-probability neutrino event
    Highly exceptional GRB or SGR

Normal Planning Timeline: Below is the typical schedule for producing and submitting the observing schedules. Please give a few extra days for submitting ToOs around the holidays.





Day of the Week
Submit the Schedule for*
Create the Schedule for
Monday
Tuesday
Wednesday
Tuesday
Wednesday
Thursday
Wednesday
Thursday
Friday & Saturday
Thursday
Friday & Saturday
Sunday & Monday
Friday
Sunday & Monday
Tuesday
All times are in Eastern Time (USA).
*Schedules are submitted in the mornings.

Monday, February 22, 2016

uvot analysis error messages

This is just a listing I'm starting of error messages I see while doing UVOT analysis of supernovae , what the real problem was, and how to fix it.  Most (possibly all) are not issues with the software but problems with how one is trying to use the software.

uvotmaghist getting hung up -- activity monitor listing uvotinteg as taking 99% of the CPU time but not getting anywhere. 

problem -- region files contained two lines, one with the correct source position and one with some other position not in the field of view

fix -- fix the region files, rerun uvotmaghist


uvotmaghist reporting divide by zero error --

problem -- background region was not covered by the image (though it may have fallen within the zero count square made to encompass the full height and width of the image).  Especially a problem when combining full field and smaller hardware/software windows.

fix -- fix the region so it stays within the image for all the images being processed with uvotmaghist

frankenstein images where parts of a summed image seem to be wrapped around rather than just mosaiced

problem -- I think the problem was having multiple instances of uvotimsum running at the same time so the parameter file contained values from the other terminal

fix -- do them one at a time rather than multi-tasking the same command in different windows


if the galaxy count rates come out as negative, it could be that the supernova comes from a clean region and the background region happens to have a higher average count rate.  But the source region file could be bogus -- two entries for example -- confusing the standard 5" aperture that is computed for coincidence loss.


processing vv data for PSNJ09100885+5003396
# Beware of galaxy count rates > ~ 6
vv count rate is 1.65534055233002
ftcalc(4838,0x7fff7375f000) malloc: *** error for object 0x7fca3af001d0: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
^CAbort
Dumping CFITSIO error stack:
--------------------------------------------------
ffopen could not interpret primary array header of file:
PSNJ09100885+5003396_vv_phot.fits
--------------------------------------------------
CFITSIO error stack dump complete.
CFITSIO ERROR END_OF_FILE: tried to move past end of file
Task fthedit 2.00 terminating with status 107
fparkey4.3 : unable to open the FITS file PSNJ09100885+5003396_vv_phot.fits
fparkey4.3 : Error Status Returned :  107
fparkey4.3 : tried to move past end of file

fparkey4.3 :  ***** FITSIO Error Stack Dump *****
ffopen could not interpret primary array header of file:
PSNJ09100885+5003396_vv_phot.fits
Dumping CFITSIO error stack:
--------------------------------------------------
ffopen could not interpret primary array header of file:
PSNJ09100885+5003396_vv_phot.fits
--------------------------------------------------
CFITSIO error stack dump complete.
CFITSIO ERROR END_OF_FILE: tried to move past end of file
Task fthedit 2.00 terminating with status 107
Dumping CFITSIO error stack:
--------------------------------------------------
ffopen could not interpret primary array header of file:
PSNJ09100885+5003396_vv_phot.fits
--------------------------------------------------
CFITSIO error stack dump complete.
CFITSIO ERROR END_OF_FILE: tried to move past end of file
Task fthedit 2.00 terminating with status 107
Dumping CFITSIO error stack:
--------------------------------------------------

fix -- this may have been caused by the '+' in the name.  Changing the name to PSN it ran fine.

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