


/net/andicam/data/observer
To see what data is available, run:
cl < /uw50/nick/daophot/irafcl/yalo/ir/setup
hsel ir*.fits $I,IRFLTID,exptime,ncoadds,title yes
hsel ccd*.fits $I,CCDFLTID,exptime,title yes
/uu55/reu7/ | ||
| | ||
| | ||
apr17 | ||
| | ||
opt---------------------------------- | ||
| | ||
| | ||
ir |
.daophot
setenv i20020416 /uw55/reu7/apr17/ir
alias i20020416 "cd $i20020416
You can also set them up for IRAF as:
loginuser.cl:
set i20020416 = /uw55/reu7/apr17/ir/
copy /uw50/nick/daophot/irafcl/yalo/ir/* .
Create, or point to the uparm$ directory with the IR data information. Here is my file:
setup:
set stdimage = imt2048
set uparm = /uw50/nick/uparm/yaloir/
noao
ctio
nickcl
imred
ccdred
astutil
digi
apphot
artdata
ccdred.instrument = "myiraf$yalo_ir.dat"
ccdred.ssfile = "myiraf$yalo_ir.sub"
loadit.format = "2048"
loadit.statsec = "700:800,700:800"
keep
cpimh ir*.fits,nick*.fits del+
equinox ==> epoch
observat ==> "ctio"
and move the jd to JD-OLD
I run the script "yalohead" to convert the FITS headers into something more standard for IRAF.
yalohead *.imh
The task now does the setjd and the setairmass. If you need to do it by hand, do this:
setjd *.imh date="UTDATE" time="UT" exposure="EXPTIME" epoch="EQUINOX"
setairmass *.imh
The normal observing procedure is to observe the SN at 2 dither positions with a give dither offset, say 40 units (which is 20"). Since there is vignetting as a function of dither, each dither position has its own flat field. The flats have to be taken at exactly the same dither positions. Since it takes a long time to make the flats, we have defaulted to using two dither positions.
In looking over this data, I found that we used two dither positions for the HK images for the SN with value of 20. The flats were taken with at two dither positions with a value of 40! This is not good. In addition, we took the J data at 7 dithers. I remember deciding to do this, because it was the only way to fill up the U time slot.
So basically the data are a mess and I will have to invent yet another way to reduce the data.
Check the tilt parameters first as:
hsel ir*.imh $I,tilt1,tilt2,tilt3,IRFLTID,title yes
hsel nick*.imh $I,tilt1,tilt2,tilt3,IRFLTID,title yes
Now run for the object frames:
dtilt:
images = | "ir*.imh" | input images | |
(dither = | 20) | Tilt step: 10,20,30,etc | |
(tilt1 = | 1320) | Tilt position 1 | |
(tilt2 = | 2225) | Tilt position 2 | |
(tilt3 = | 1820) | Tilt position 3 | |
(imglist = | "tmp$tmp.562ga") | ||
(mode = | "ql") |
dtilt ir*.imh dither=20
dtilt:
images = | "nick*.imh" | input images | |
(dither = | 40) | Tilt step: 10,20,30,etc | |
(tilt1 = | 1320) | Tilt position 1 | |
(tilt2 = | 2225) | Tilt position 2 | |
(tilt3 = | 1860) | Tilt position 3 | |
(imglist = | "tmp$tmp.562ga") | ||
(mode = | "ql") |
dtilt ir*.imh dither=20
Yeah, but here is gets messy. The J images have dithers up to 7, and the standards up to 4. To make life simple, we are going to set the J and standard star dithers all to 1, and use only the .0001 flat for these images.
To do this, make files as:
del in1
files ir*.imh > in1
hsel @in1 $I,IRFLTID,title yes | grep "SN" - | fields - 1 > inSN
hsel @in1 $I,IRfltid,title yes | grep "J" - | grep "SN" - | fields - 1 > inSNJ
hsel @in1 $I,IRfltid,title yes | grep "H" - | grep "SN" - | fields - 1 > inSNH
hsel @in1 $I,IRfltid,title yes | grep "K" - | grep "SN" - | fields - 1 > inSNK
hsel ir*.imh $I,IRFLTID,title yes | grep "P9" - | fields - 1 > instand
hedit @inSNJ dither 1 up+ ver-
hedit @instand dither 1 up+ ver-
Remove the junk images.
hsel *.imh $I,title yes | grep "junk" | fields - -1 > injunk
emacs injunk
ccdl @injunk
The IR detector has a numerical bias of 400 units. On top of that, the dark frame at the same exptime as an object frame has warm pixels that are similar to biases. It is very important that we get dark frames using the same integration times as the object frames. That is why we always choose the same intergration times for JHK.
The best dark is an averaged dark taken at the same time as the object frame. Check to see if the darks look okay. Sometimes the first one is bad.
displ nickdark.0001 1 zs- zr- z1=400 z2=425
displ nickdark.0002 2 zs- zr- z1=400 z2=425
mkdir old
imren nickdark.0001 old
hedit nickdark*.imh imagetyp zero up+ ver-
zerocomb nickdark.????.imh out=irdark45 comb=med rej=minmax nlow=1 nhigh=1
displ irdark45 1 zs- zr- z1=400 z2=500
hedit irdark45 IMAGETYP zero up+ ver-
It is a good idea to look at the dark and also do an imhist to see if the number of hot pixels is excessive.
imhist irdark45
imhist irdark45 z1=0 z2=20000 nbin=10 list+
This looks reasonable to me.
1000. | 1048361 | |
3000. | 72 | |
5000. | 51 | |
7000. | 56 | |
9000. | 20 | |
11000. | 9 | |
13000. | 7 | |
15000. | 0 | |
17000. | 0 | |
18000. | 0 |
IMPORTANT! Whatever bias you are using, you must declare the image as a ZERO image.
Here we are going to create a flat field for each dither position using the single set of dome images. We will form the flats in the usual manner. We will reduce the data to [ZF] before sky subtraction to remove the vignetting.
1. Form the DOME_ON-DOME_OFF.
First of all, rename the data "irflath.000?.imh,irdarkh.000?.imh" to a subdirectory. We need these names.
imren irflath.000?.imh old
imren irdarkh.000?.imh old
2. Run the following script which will set up the flats correctly for the 2 dither position.
The logic is explained below. This script will make the flats, add the correct CCDMEAN value, and replace all 0 values with 65535.
cl < flat.cl
flat.cl:
imar nickjon.0001 - nickjoff.0001 irflatj.0001
imar nickjon.0002 - nickjoff.0002 irflatj.0002
#
imar nickhon.0001 - nickhoff.0001 irflath.0001
imar nickhon.0002 - nickhoff.0002 irflath.0002
#
imar nickkon.0001 - nickkoff.0001 irflatk.0001
imar nickkon.0002 - nickkoff.0002 irflatk.0002
#
hedit irflat?.????.imh DOMEOFF "Dome-off image was subtracted" add+ ver-
hedit irflat?.????.imh ZEROCOR "Corrected by DOME_OFF" add+
hedit irflat?.????.imh IMAGETYP "FLAT" up+ ver-
imreplace irflat?.????.imh 60000 lower=INDEF upper=1
nstat irflat?.000?.imh niter=9 mkmean+ statsec = "25:640,25:1000"
In some cases, the *.0001.imh images were corrupted because the operator did not throw away the first image. You can copy the usual nightly DOME_ON-DOME_OFF data, which are dither=1, into these images.
imdel irflatj.0001,irflath.0001,irflatk.0001
3. Next is a subtle point. We are going to divide by 2 different flats per filter.
Normally, ccdpr calculates a CCDMEAN parameter for a flat, which has the effect of dividing the flat by CCDMEAN and brining it to an average of 1.0 before applying it to the data. But for vignetting, this is wrong. Consider 2 dither positions, and assume that the dither=2 position shows only 1/2 the counts than dither=1. This could be due to either the flatfield lamp changing, or vignetting. Assume dither=2 has 50% vignetting everywhere. If the flat at dither=1 has 1000ADU, the dither=2 will have 500ADU. The ccdpr program will normalize these two flats to 1.0. The resulting [ZF] data will be wrong for the dither=2 case by 50%.
What we need to do is very carefully to identify a part of the detector where there is no vignetting, and force CCDMEAN to this value. The resulting flats will be okay then. To do this, run nstat with mkmean+:
nstat:
images = | "irflat?.000?.imh" | input images | |
(statsec = | "25:640,25:1000") | Stat sec | |
(binwidth = | 0.1) | Bin width of histogram in sigma | |
(iterate = | yes) | Iterate on the statistics? | |
(niter = | 5) | Number of iterations | |
(sigclip = | 2.) | Sigma clip for statistics | |
(mkmean = | no) | Update CCDMEAN parameter? | |
(imglist = | "tmp$tmp.7826f") | ||
(mode = | "ql") |
nstat irflat?.000?.imh niter=9 mkmean+
Do the following to make sure the flats are all [Z] and the bias is declared [zero] and the flats are declared as flats:
ccdl irflat*.imh,irdark*.imh
irflath.0001.imh[1024,1024][real][flat][H][Z]:Dome H On, Dither=2/40
irflath.0002.imh[1024,1024][real][flat][H][Z]:Dome H On, Dither=2/40
irflatj.0001.imh[1024,1024][real][flat][J][Z]:Dome J On, Dither
irflatj.0002.imh[1024,1024][real][flat][J][Z]:Dome J On, Dither
irflatk.0001.imh[1024,1024][real][flat][K][Z]:Dome K On, Dither=2/40
irflatk.0002.imh[1024,1024][real][flat][K][Z]:Dome K On, Dither=2/40
irdark45.imh[1024,1024][real][zero][DARK]:Dark 45s
3.5 Go ahead and rename the data to something simple:
imren ir011217.0*.imh %ir011217.0%r%*.imh
4. Now we flatten the data with the separate dither flats.
I have written a task called yaloflatir.cl which will form the IRAF script to handle the dither flats. Run it as:
yaloflatir r???.imh
The run
cl < yfir.cl
ccdproc r102.imh zerocor+ zero=irdark45 flatcor+ flat=irflatj.0001
etc.
The data are now [ZF].
ccdr:
(pixeltype = | "real real") | Output and calculation pixel datatypes |
(verbose = | yes) | Print log information to the standard output? |
(logfile = | "logfile") | Text log file |
(plotfile = | "") | Log metacode plot file |
(backup = | "") | Backup directory or prefix |
(instrument = | "myiraf$/yalo_ir.dat") | CCD instrument file |
(ssfile = | "myiraf$/yalo_ir.sub") | Subset translation file |
(graphics = | "stdgraph") | Interactive graphics output device |
(cursor = | "") | Graphics cursor input |
(version = | "2: October 1987") | |
(mode = | "ql") | |
($nargs = | 0) |
ccdpr:
images = | "a*.imh" | List of output CCD images |
(output = | "") | List of output CCD images |
(ccdtype = | "") | CCD image type to correct |
(max_cache = | 0) | Maximum image caching memory (in Mbytes) |
(noproc = | no) | List processing steps only?\n |
(fixpix = | no) | Fix bad CCD lines and columns? |
(overscan = | no) | Apply overscan strip correction? |
(trim = | no) | Trim the image? |
(zerocor = | yes) | Apply zero level correction? |
(darkcor = | no) | Apply dark count correction? |
(flatcor = | no) | Apply flat field correction? |
(illumcor = | no) | Apply illumination correction? |
(fringecor = | no) | Apply fringe correction? |
(readcor = | no) | Convert zero level image readout correction? |
(scancor = | no) | Convert flat field image to scan correction?\n |
(readaxis = | "line") | Read out axis (column|line) |
(fixfile = | "") | File describing the bad lines and columns |
(biassec = | "") | Overscan strip image section |
(trimsec = | "") | Trim data section |
(zero = | "irdark45") | Zero level calibration image |
(dark = | "") | Dark count calibration image |
(flat = | "irflat?.imh") | Flat field images |
(illum = | "") | Illuminaion correction images |
(fringe = | "") | Fringe correction images |
(minreplace = | 1.) | Minimum flat field value |
(scantype = | "shortscan") | Scan type (shortscan|longscan) |
(nscan = | 1) | Number of short scan lines\n |
(interactive = | yes) | Fit overscan interactively? |
(function = | "legendre") | Fitting function |
(order = | 4) | Number of polynomial terms or splie pieces |
(sample = | "*") | Sample points to fit |
(naverage = | 1) | Number of sample points to combine |
(niterate = | 3) | Number of rejecction iterations |
(low_reject = | 2.5) | Low sigma rejection factor |
(high_reject = | 2.5) | High sigma rejection factor |
(grow = | 0.) | Rejection growing radius |
(mode = | "ql") |
myiraf$/yalo_ir.dat:
exptime exptime
imagetyp imagetyp
subset IRFLTID
OBJECT | object | |
DARK | zero | |
FLAT | flat | |
BIAS | zero | |
MASK | other |
myiraf$/yalo_ir.sub
'H' | H |
'J' | J |
'K' | K |
Make a mask image as follows. Here we use the dome flats corrected for DOME_OFF for the mask. Note that there are very many warm pixels with the detector and about 10% of these change flux during the night. If the warm pixels change flux between the ON and OFF images, they will be flagged as bad pixels here.
The philosophy of the masks is that all pixels in a normalize image that are less than some value like 0.7 are probably bad, and will be marked as a bad pixel.
mask1.cl:
# to make the mask, use imhist and look for the limits
# first flatten the flats and remove the edge defects
#
real midpt
string img
img = "irflath.0002"
#
imdel("temp*.imh,mask*.imh,mask.pl", >>& "dev$null")
imstat(img//"[50:600:10,50:1000:10]",fields="midpt",form-) | scan(midpt)
print(img," ",midpt)
imar(img,"/",midpt,"temp1")
imtrans("temp1","temp2")
fmed("temp2","temp3", xwin=201, ywin=1, boundary="wrap",zlo=0.4,zhi=2.0)
imtrans("temp3","temp4")
imar("temp1", "/", "temp4", "mask")
imdel("temp*.imh", >>& "dev$null")
imrep mask.imh[*,1:10] 0 lower=INDEF upper=INDEF
imrep mask.imh[*,1020:1024] 0 lower=INDEF upper=INDEF
imrep mask.imh[1:1,*] 0 lower=INDEF upper=INDEF
imrep mask.imh[1021:1024,*] 0 lower=INDEF upper=INDEF
#
# now check the historgram and change the limits if needed.
#
imhist mask.imh z1=0.4 z2=1.4 nbins=100
displ mask.imh 1 zs- zr- z1=0.5 z2=1.5
mask2.cl
#
# good pix are 0, bad are 1 for IRAF mask
# the values 0.65 and 1.25 need to be checked on the histogram
# each time you make the mask.
#
real lll,uuu
real hist1,hist2,hist3,xjunk,histsum,nax1,nax2,npixx,ratio
lll = 0.75
uuu = 1.19
#
imhist('mask',z1=lll,z2=uuu,list+,nbin=1) | scan(xjunk,hist1)
imhist('mask',z1=INDEF,z2=lll,list+,nbin=1) | scan(xjunk,hist2)
imhist('mask',z1=uuu,z2=INDEF,list+,nbin=1) | scan(xjunk,hist3)
histsum= hist1+hist2+hist3
hsel('mask','naxis1','yes') | scan(nax1)
hsel('mask','naxis2','yes') | scan(nax2)
npixx=nax1*nax2
ratio=(hist2+hist3)/npixx
printf("Fraction rejected=%9.3f\n",ratio)
#
imhist('mask',z1=lll,z2=uuu,list+,nbin=1)
imdel temp.imh
imcopy mask temp
displ mask 1
imrep("mask", lower=INDEF, upper=lll, val=-1 )
imrep("mask", lower=uuu, upper=INDEF, val=-1)
imrep("mask", lower=lll, upper=uuu, val=0)
imar mask * mask mask
imcopy mask.imh mask.pl
# make DAOPHOT mask where bad pix are 0 and good are 1
imrename mask.imh maskdao
imar maskdao - 1 maskdao
imar maskdao * -1 maskdao
#
displ mask.pl 2 zs- zr- z1=0 z2=1
You can check frames 1,2 to see if the mask looks good.
In looking over the 2002bo data, the HK images can be reduced in the usual fashion. But the J images, which only had a dither of 20 units, cannot. So we will reduce the IR with two groups - HK and J.
Make inj,inh,ink files for all the SN data. These will be used to make the sky.
del in*
files r*.imh > in1
hsel @in1 $I,title yes | grep "SN" - | fields - 1 > inSN
hsel @in1 $I,title yes | grep "P9143" - | fields - 1 > in9143
hsel @in1 $I,title yes | grep "P9144" - | fields - 1 > in9144
hsel @in1 $I,title yes | grep "P9149" - | fields - 1 > in9149
etc.
Now grep it to separate out the different SNe
hsel @inSN $I,irfltid yes | grep "J" - | fields - 1 > inSNJ
hsel @inSN $I,irfltid yes | grep "H" - | fields - 1 > inSNH
hsel @inSN $I,irfltid yes | grep "K" - | fields - 1 > inSNK
hsel @in9143 $I,irfltid yes | grep "J" - | fields - 1 > in9143J
hsel @in9143 $I,irfltid yes | grep "H" - | fields - 1 > in9143H
hsel @in9143 $I,irfltid yes | grep "K" - | fields - 1 > in9143K
hsel @in9144 $I,irfltid yes | grep "J" - | fields - 1 > in9144J
hsel @in9144 $I,irfltid yes | grep "H" - | fields - 1 > in9144H
hsel @in9144 $I,irfltid yes | grep "K" - | fields - 1 > in9144K
hsel @in9149 $I,irfltid yes | grep "J" - | fields - 1 > in9149J
hsel @in9149 $I,irfltid yes | grep "H" - | fields - 1 > in9149H
hsel @in9149 $I,irfltid yes | grep "K" - | fields - 1 > in9149K
Do the sky subtraction on HK. Make two files for each dither position as:
dithsep @inSNH
dithsep @inSNK
irsky @inSNH1
cl < sub.cl
imren SkyH SkyH1
^== VERY IMPORTANT TO DO !!!
irsky @inSNH2
cl < sub.cl
imren SkyH SkyH2
irsky @inSNK1
cl < sub.cl
imren SkyK SkyK1
irsky @inSNK2
cl < sub.cl
imren SkyK SkyK2
irsky @in9143J runsky+
imren SkyJ SkyJ9143
irsky @in9143H runsky+
imren SkyH SkyH9143
irsky @in9143K runsky+
imren SkyK SkyK9143
#
irsky @in9144J runsky+
imren SkyJ SkyJ9144
irsky @in9144H runsky+
imren SkyH SkyH9144
irsky @in9144K runsky+
imren SkyK SkyK9144
#
irsky @in9149J runsky+
imren SkyJ SkyJ9149
irsky @in9149H runsky+
imren SkyH SkyH9149
irsky @in9149K runsky+
imren SkyK SkyK9149
Run irsky. MAKE SURE THAT THE INSUF AND OUTSUF ARE CORRECTLY SET OR YOU WILL OVERWRITE YOUR DATA:
irsky:
images = | "@inSNH" | input images |
(statsec = | "[25:600,25:1000]") | Stat sec |
(sigma = | 2.5) | sigma clip for stats |
(niter = | 9) | interactions for sigma clipping |
(irfltid = | "IRFLTID") | keyword for filter |
(outimage = | "Sky") | Output root for sky image |
(nlow = | 0) | number of low pixels to reject |
(nhigh = | 1) | number of high pixels to reject |
(combine = | "median") | type of combine function |
(reject = | "minmax") | type of rejection |
(insuf = | "r") | Root suffixfor input image |
(outsuf = | "s") | Root suffix fro output image |
(imglist1 = | "t1.jnk" | |
(mode = | "al") |
You may have to play with the nhigh to reduce the print-through.
This program outputs a file called sub.cl which you run to do the sky subtractions.
cl < sub.cl
This is now sky subtracted data. All the data should be near 0 sky. You can check this with getsky.
task getsky = home$scripts/getsky.cl
Look at the final subtractions to see if the sky subtracted well, and there is not a large flux "hole" in the image center due to print through of the median combine of the images.
For the J data, we have to be more creative. I have created a mask image based on the apr17 combined H frame which blots out the main part of the galaxy and all the stars. The mask image was made with t2.cl. I suggest that we just use this image as is and not create new ones. The image is called maskgal.
t2.cl:
imdel test*.imh
imcopy SN2002boH[531:1554,500:1523] test
imar test - 4 test
fmedian test test1 zmin=-20 zmax=200 xwin=9 ywin=9
imcopy test1 test2
imrep test2 1 low=INDEF up=18
imrep test2 0 low=18 up=INDEF
displ test 1 zs- zr- z1=-10 z2=50
displ test1 2 zs- zr- z1=-10 z2=50
displ test2 2 zs- zr- z1=00 z2=1
We have to shift the mask image to the data, and divide it into the data to remove the galaxy. To do this, we measure the xy position of a check star using yalocenter. We also measure the same star in the maskgal image.
imcopy ../apr2/maskgal .
yalocenter @inSNJ
!$myprog/prog48b junk.dat
cl < shift.cl
This creates a bunch of images called skyr???.imh which are the r???.imh with the badpix inserted.
You then run irsky to get the sky:
irsky sky*.imh run- hth=60000 nhigh=1
displ SkyJ 1
You have to really look carefully at the SkyJ image to make sure there is no print-through on the SN. Once the sky looks good, you must edit the file "sub.cl" to subtract this sky from the r???.imh images to produce the s???.imh images. You can now calcuate the shifts in the usual manner and combine the data as below with the important caveat: MAKE SURE THAT EACH IMAGE IS PROPERLY SUBTRACTED. IF NOT, THROW OUT THE IMAGE.
The data are now sky subtracted. Do ALL the data before the next step.
For the final mosaic, you should set the bad pixels to a large number. Since saturation is 10000, 65535 ADU is a good value.
imar s*.imh / maskdao s*.imh divzero=65535
The final mosaic is a piece of art, and I don't have the killer technique yet. The following does an excellent job if the night is
photometric. The main problem we face is to detect and remove the warm pixels/cr's without removing flux from the stars.
The first step is to shift the data. If the seeing is >3 pix or so, use integer shifts.
We will now operate on the s*.imh images. Run:
chsuf inSNJ sufin="r" sufout="s"
chsuf inSNH sufin="r" sufout="s"
chsuf inSNK sufin="r" sufout="s"
etc.
rimexam.iterations = 1
yalocenter @inSNH
!$myprog/prog48a junk.dat
cl < shift.cl
displ frame=1 zs- zr- z1=-10 z2=200 image=temp10
displ frame=2 zs- zr- z1=-10 z2=200 image=temp11
This will produce integer shift image called temp*.imh. You can modify prog48 if you want real-valued shifts but I would not recommend it.
The final combine can be made as follows.
Use stsdas.hst_calib.wfpc package and run noisemodel on your data. Converge on the read noise and scalenoise. You will see a plot with a bunch of points at the lower left and two paralllel sequences to the upper right. Fudge the read noise until it passes thought the lower left. Then fugde the scalenoise (in units of percent) until it passes through the LOWER sequence. These are the stars. The upper sequence are warm pixels.
stsdas
hst
wfpc
noisemodel xb=10 yb=10 input=s000
Input these parameter to imcomb, remembering to convert from percent to fraction. For instance, I found:
imdel t.imh,t.pl
# H
#imcomb temp??.imh t plf=t.pl comb=ave reject=ccd lth=-50 hth=15000 \\
# gain=6.5 rdn=50 snoise=0.35 lsig=4 hsig=4
# K
imcomb temp??.imh t plf=t.pl comb=ave reject=ccd lth=-200 hth=15000 \\
gain=6.5 rdn=95 snoise=0.30 lsig=4 hsig=4
# J
imcomb temp??.imh t plf=t.pl comb=ave reject=ccd lth=-50 hth=10000 \\
gain=6.5 rdn=21 snoise=0.3 lsig=4 hsig=4
displ t.imh 1 zs- zr- z1=-20 z2=100
displ t.pl 2
Then
imren t.imh SN2002boJ.imh
imren t.pl old/SN2002boJ.pl
imren t.imh SN2002boH.imh
imren t.pl old/SN2002boH.pl
imren t.imh SN2002boK.imh
imren t.pl old/SN2002boK.pl
imren t.imh P9143J.imh
imren t.pl old/P9143J.pl
imren t.imh P9143H.imh
imren t.pl old/P9143H.pl
imren t.imh P9143K.imh
imren t.pl old/P9143K.pl
imren t.imh P9144J.imh
imren t.pl old/P9144J.pl
imren t.imh P9144H.imh
imren t.pl old/P9144H.pl
imren t.imh P9144K.imh
imren t.pl old/P9144K.pl
imren t.imh P9149J.imh
imren t.pl old/P9149J.pl
imren t.imh P9149H.imh
imren t.pl old/P9149H.pl
imren t.imh P9149K.imh
imren t.pl old/P9149K.pl
When the detector had lots of warm pixels, I used
imdel t.imh,t.pl
# H
#imcomb temp??.imh t plf=t.pl comb=ave reject=ccd lth=-50 hth=10000 \\
# gain=6.5 rdn=72 snoise=0.60 lsig=6 hsig=5
# K
#imcomb temp??.imh t plf=t.pl comb=ave reject=ccd lth=-500 hth=10000 \\
# gain=6.5 rdn=140 snoise=0.55 lsig=7 hsig=6
# J
imcomb temp??.imh t plf=t.pl comb=ave reject=ccd lth=-50 hth=10000 \\
gain=6.5 rdn=55 snoise=0.70 lsig=7 hsig=5
displ t.imh 1 zs- zr- z1=-20 z2=100
displ t.pl 2
If the night was not photometric, we have to estimate a scale factor. I have not figured this out yet but it will require scaling on
the galaxy or some stars, but doing the calculation throwing out bad pixels.
If it is not photometric, I find that I have to change the clipping from sig=4 to sig=6-8.
We need to get the psf photometry done quickly. So let's not waste too much time getting the best psfs.
Here is an outline of the data reduction.
Cleanup the disk a bit:
imdel temp*.imh
imdel test*.imh
imdel sky*.imh
del junk*
mv in* old
!cleanupdao
cleanup
1. Copy over the *.opt files:
copy /uw50/nick/daophot/optfiles/yalo/ir/*.opt .
copy /uw50/nick/daophot/optfiles/yalo/ir/jhk.clb .
copy /uw50/nick/daophot/optfiles/yalo/ir/ntrial.cl .
copy /uw50/nick/daophot/optfiles/yalo/ir/jhk.tfm .
copy /uw50/nick/daophot/optfiles/yalo/ir/jhk.lib .
copy /uw50/nick/daophot/optfiles/yalo/ir/ndaogrow.inp .
We will solve for
[J,J-K]
[H,J-K]
[K,J-K]
because we often don't have K. I don't have color terms for J-H yet, so we will set them to 0 right now.
daophot.opt:
Read noise | = | 2.1 | |
Gain | = | 6.5 | |
FWHM | = | 5.5 | |
Fitting radius | = | 5.5 | |
PSF radius | = | 4 | |
Analytic model PSF | = | 3 | |
Variable PSF | = | 0 | |
Extra PSF cleaning passes | = | 5 | |
High good datum | = | 10000 | |
Watch progess | = | -2 | |
Thershold | = | 7 |
allstar.opt:
Fitting Radius | = | 4.5 | |
IS (Inner sky radius)) | = | 2 | |
OS (Outer sky radius) | = | 25 | |
Redetermine Centroids | = | 1 |
photo.opt (for 12" apertures):
A1 | = | 7.0000 | |
A2 | = | 7.5195 | |
A3 | = | 8.2987 | |
A4 | = | 9.3377 | |
A5 | = | 10.6364 | |
A6 | = | 12.1948 | |
A7 | = | 14.0130 | |
A8 | = | 16.0909 | |
A9 | = | 18.4286 | |
AA | = | 21.0260 | |
AB | = | 23.8831 | |
AC | = | 27.0000 | |
IS | = | 30.0000 | |
OS | = | 35.0000 |
photo.opt (for 10" apertures):
A1 | = | 7.0000 | |
A2 | = | 7.3896 | |
A3 | = | 7.9740 | |
A4 | = | 8.7532 | |
A5 | = | 9.7273 | |
A6 | = | 10.8961 | |
A7 | = | 12.2597 | |
A8 | = | 13.8182 | |
A9 | = | 15.5714 | |
AA | = | 17.5195 | |
AB | = | 19.6623 | |
AC | = | 22.0000 | |
IS | = | 30.0000 | |
OS | = | 44.0000 |
2.5
4. Insert the aziumth into the data. This should run trivially. All
it does is to add a flag of 1 or -1 depending on if the object is E or
W.
azimuth:
images = | "@in1" | input images |
(latitude = | -30.16527778) | Observatory latitude |
(calaz = | no) | Calculate azimuth? |
(flagit = | yes) | Use AZFLAG instead of AZIMUTH? |
(update = | yes) | Update azimuth into header? |
(imglist = | "tmp$tmp15007a") | |
(mode = | "ql") |
mv in* old
del junk.dat
files SN*.imh > in1
hsel s*.imh $I,IRFLTID,title yes | grep "P9" - | fields - 1 >> in1
azimuth @in1
3. To create the *.inf file.
We are using the new Stetson format. You must enter a MCHFILE into the header. This is the master image name.
hedit SN*.imh MCHFILE SN2002boH add+
etc.
hsel @in1 $I,IRFLTID,utmiddle,airmass,azflag,exptime,hjd,mchfile yes > junk.dat
!$myprog/prog3b junk.dat
0
name
/uw50/nick/daophot/irafstuff/filters_yalo_ir.dat
4. Measure the FWHM as:
del junk.dat
yaloshift @in1
etc.
Then run
!$myprog/prog39 junk.dat
You also have to add in the read noise and gain. Run nstat on the data to get the read noise and hsel to get the coadds+ncombine
hsel SN*.imh $I,ncoadds,ncombine yes | fields - 2,3 \\
| filec STDIN "$1;$2;6.5*$1*$2" fo="%6d%6d%6d"
nstat SN*.imh statsec=800:900,800:900 iter+ niter=2 sig=4
Then enter this into the fwhm.dat. Since we have averaged a lot of data together, the gain is 6.5*N where N is the number of frames. Let us assume that N is about n*m where n is the number of coadds and m is the number of frames.
For the standards, just use the following to get the read noise:
hsel P*.imh $I,ncoadds,ncombine yes | fields - 2,3 \\
| filec STDIN "$1;$2;6.5*$1*$2" fo="%6d%6d%6d"
nstat P*.imh statsec=800:900,800:900 iter+ niter=2 sig=4
input into fwhm.dat
name
fwhm psf_rad var gain ron
fwhm.dat:
sn2001bt_h.imh
4.62 15 1 35 3.34
sn2001bt_j.imh
4.51 15 1 35 1.72
sn2001bt_k.imh
4.12 15 1 35 4.36
sn2001cn_h.imh
4.47 15 1 65 2.26
sn2001cn_j.imh
4.31 15 1 65 1.01
Note this program forces a var=1. If there are too few stars, use var=0. THIS IS IMPORTANT!!
5. For SN data, run BYALOIR and enter in the data from fwhm1.dat.
For standards, run BFIND2. Note that BPASSIR and BYALOIR takes 5 parameters: fwhm, psf size, variation, gain, and readnoise. It only solves for var=-1 in this pass. I used a threshold of 10 and var=1. If there are only a few stars in the frame, use var=0. It takes about 4min per frame to run.
This program runs BPASS1, prog11a, and FINAL2. If needed, clean up the psf with.
!$myprog/prog11a sn2001bt_h 0.1
or use dals to edit the lst stars.
6. Add in the supernova if it was missed by BYALOIR with addals. Run FINAL2 again.
If the SN is too faint, you may want to run ALLFRAME. To do this, make the *.mch file (below), run DAOMASTER again to make a *.mag file, and renumber the stars with DAOPHOT. Then run BALLFRAME. After ALLFRAME, you need to run the following to cleanup the data (turn *.alf to *.als, etc).
!$myprog/prog45 SN2001bth
!source SN2001bth
!/uw50/nick/daophot/perl/daomaster.pl SN2001bth
6.5 If you have standards, you will run BFIND2.
Then run NDAOGROW on all the data. If a standard was missed due to a bad pixel, edit with epix.
ls -1 *ap >> i20010618.lis
Also, NDAOGROW does not work well on these data. I had to iterate by hand:
deldaogrow
ndaogrow < ndaogrow.inp
ndaogrow:
i20020416
i20020416
2
0.8 0.9 0
0.025
I had to play with the "0.8" to get it to fit. Making it bigger makes the curve flatter. You can force a minimum aperture using NDAOGROW1.
7. Make the *.mch file for each SN. Use yalocenter to id a star into junk.dat and then run
yalocen @inSN
!$myprog/prog52b junk.dat als
This makes the correct *.mch file in DAOMATCH format.
Run DAOMASTER as:
!/uw50/nick/daophot/perl/daomaster1.pl
This will only do shifts.
8. Make the *.fet file. Use the same star numbers as the optical images.
IMPORTANT - ONLY CHOSE STARS THAT ARE NEAR THE SN AND WERE ON ALL THE FRAMES. DO NOT CHOSE STARS NEAR THE EDGE OR BEYOND COL 600. LOOK AT THE *.PL FILE TO MAKE SURE!
s +
The data are now ready for REDUCE. Copy the *net files and run REDUCE.
cp /uw52/nick/sn/sn01cz/ir/SN2001cz.net .
cp /uw52/nick/sn/sn01bt/ir/SN2001bt.net .
cp /uw52/nick/sn/sn01cn/ir/SN2001cn.net .
cp /uw52/nick/sn/sn01du/ir/SN2001du.net .
cp /uw52/nick/sn/sn01x/ir/SN2001x.net .
reduce
i20010710
SN2001czh
E
SN2001cz.net
SN2001czh
7
1 1 1
etc.
9. If you want to make a *.net file for the photometry, do the following:
a. Find a night which looks photometric. If there were standards taken, great! If not, we can still fake it.
b. I assume the data are reduced through *.fet, *.mch, and *.als. We now run NDAOGROW. Make a *.lis file.
c. Now run NCOLLECT. This runs quickly because the *.mch information is in the *.inf file.
d. Now, if you have real standards, you can run CCDSTD with just the A0,B0, and C0 coeffs missing. Use this updated *.clb file.
d. If you don't have standards, make sure you have a *.clb file that has the name of the night, and the right set of filters. If you have jhk data, use jhk1.clb. If you have only jh data, use jh.clb. Rename *.clb to something like
mv jhk2.clb i20010618.clb
e. Now run NCCDAVE (not NCCDSTD!) to get the *.net file. This will have the prelimiary photometry. I called it sn2001cn_ir.net. Put the *.net file in the appropriate directory for future use. Also put the *.fet and the master image there so we can remember what we did!
DONE!
1. Make the *.mch and *.tfr file
yalocen SN2002bo?.imh
!$myprog/prog52b junk.dat als
Run daomaster.pl? <y/n>n
!/uw50/nick/daophot/perl/daomaster1.pl SN2002boH
2. Make the *.fet file
loadit SN2002boH dispsub-
fetch SN2002boH fetsuf=".als"
3. write the *.clb file to the correct name.
cp jhk.clb i20020425.clb
4. See if you have all the right files
SN2002boH.tfr
i20020424.inf
i20020425.clb
nick% ntrial
Transfer file: | SN2002boH |
Library file (default SN2002boH.lib): | $reu_ir/SN2002bo_JHK.net |
Information file (default SN2002boH.inf): | i20020424 <== EDIT THIS! |
Pair file (default SN2002boH.prs): | END-OF-FILE |
FETCH file (default SN2002boH.fet): | |
Critical radius: | 8 |
Output file name (default SN2002boH.fnl): |
Run it as
del *.fnl
del *.zer
ntrial < ntrial.cl
5. Measure the SN mag
fnl SN2002boH suf="fnl" zl=-10 zh=250 red+