Current Processing for Extraction of Sky Brightness at Zenith

C. Stubbs, June 3 2014. 

The FITS files from each image (M,R,G, and B) are analyzed by the script ~/getsky.sh (code listing provided below) in the following sequence:

These results are collected into a single summary file by UT date, called (for example) ~/data/ut052914/ut052914.obslog

The format of these files is shown below:

server:ut031514 christopherstubbs$ head ut031514.obslog 

#image     BIAS EXPTIME MJD-OBS                       M        B       G       R nstars   

ut031514.0001.short.M.fits 2048.274 1.000000 56731.965937 13415.8 13412.4 13419 13419 0

ut031514.0002.long.M.fits  2047.315 10.400000 56731.966019 1169.11 1169.09 1169.18 1169.15 0

ut031514.0003.short.M.fits 2048.193 1.000000 56731.966782 13415.8 13412.7 13419.1 13419 0

ut031514.0004.long.M.fits  2047.395 10.400000 56731.966863 1169.11 1169.07 1169.18 1169.14 0

ut031514.0005.short.M.fits 2048.190 1.000000 56731.967627 13415.8 13412.9 13418.5 13418.8 0

ut031514.0006.long.M.fits  2047.594 10.400000 56731.967697 1169.11 1169.08 1169.18 1169.16 0

ut031514.0007.short.M.fits 2048.327 1.000000 56731.968461 13415.7 13413.2 13418.1 13418 0

ut031514.0008.long.M.fits  2047.719 10.400000 56731.968542 1169.1 1169.07 1169.17 1169.14 0

ut031514.0009.short.M.fits 2048.233 1.000000 56731.969306 13415.8 13414.1 13418 13417.4 0


The B,G,R information is then used to construct a sky brightness plot for each night, with a supermongo script. An example is given below:

 

The *.obslog files are automatically transferred to the Amazon web services machine once analysis is completed. Email Stubbs for information on how to access that account. 

 


getsky.sh:

server:~ christopherstubbs$ cat getsky.sh

#!/bin/bash




# for a rough measure of sky brightness, extract mean for a region near the center of sensor, in each band. Uses header to subtract bias scalar




cd $dirpath/$dirname/M

rm *.sky.*.dat

rm *.bias.*.dat

rm *debias*.dat

for i in *.M.fits; do getpix $i 800-1200 800-1200 -m | grep Mean | awk '{print $2}' >> $dirname.sky.M.dat ; done

gethead *.fits BIAS EXPTIME MJD-OBS  > $dirname.M.obslog 

paste $dirname.M.obslog $dirname.sky.M.dat >> temp

awk '{print ($5-$2)/$3}' temp >> $dirname.skydebiased.M.dat

# put sky rate ADU/sec/pix into obslog file

paste $dirname.M.obslog $dirname.skydebiased.M.dat >> temp2

mv temp2 $dirname.M.obslog

rm temp2

rm temp




cd $dirpath/$dirname/B

rm *.sky.*.dat

rm *.bias.*.dat

rm *debias*.dat

for i in *.B.fits; do getpix $i 800-1200 800-1200 -m | grep Mean | awk '{print $2}' >> $dirname.sky.B.dat ; done

gethead *.fits BIAS EXPTIME MJD-OBS  > $dirname.B.obslog 

paste $dirname.B.obslog $dirname.sky.B.dat >> temp

awk '{print ($5-$2)/$3}' temp >> $dirname.skydebiased.B.dat

# put sky rate ADU/sec/pix into obslog file

paste $dirname.B.obslog $dirname.skydebiased.B.dat >> temp2

mv temp2 $dirname.B.obslog

rm temp2

rm temp




cd $dirpath/$dirname/G

rm *.sky.*.dat

rm *.bias.*.dat

rm *debias*.dat

for i in *.G.fits; do getpix $i 800-1200 800-1200 -m | grep Mean | awk '{print $2}' >> $dirname.sky.G.dat ; done

gethead *.fits BIAS EXPTIME MJD-OBS  > $dirname.G.obslog 

paste $dirname.G.obslog $dirname.sky.G.dat >> temp

awk '{print ($5-$2)/$3}' temp >> $dirname.skydebiased.G.dat

# put sky rate ADU/sec/pix into obslog file

paste $dirname.G.obslog $dirname.skydebiased.G.dat >> temp2

mv temp2 $dirname.G.obslog

rm temp2

rm temp




cd $dirpath/$dirname/R

rm *.sky.*.dat

rm *.bias.*.dat

rm *debias*.dat

for i in *.R.fits; do getpix $i 800-1200 800-1200 -m | grep Mean | awk '{print $2}' >> $dirname.sky.R.dat ; done

gethead *.fits BIAS EXPTIME MJD-OBS  > $dirname.R.obslog 

paste $dirname.R.obslog $dirname.sky.R.dat >> temp

awk '{print ($5-$2)/$3}' temp >> $dirname.skydebiased.R.dat

# put sky rate ADU/sec/pix into obslog file

paste $dirname.R.obslog $dirname.skydebiased.R.dat >> temp2

mv temp2 $dirname.R.obslog

rm temp2

rm temp




cd $dirpath/$dirname/R

ls *.R.fits > listing

mv listing ..

cd ..

              

echo "#image     BIAS EXPTIME MJD-OBS                       M        B       G       R nstars " > $dirname.obslog

paste M/$dirname.M.obslog  B/*.skydebiased.B.dat G/*.skydebiased.G.dat R/*.skydebiased.R.dat >> $dirname.obslog