Sky brightness Measurement

How to measure the sky brightness

SKY BRIGHTNESS

THE LOGIC:

We will measure the flux (in cts/sec) of stars of a given magnitude through a standard aperture. These fluxes will be corrected to above the atmosphere. An offset between the observed counting rate and standard magnitudes will be caculated. This will be done on a few frames per night of Landolt or E region standards. This zero-point must be recalculated for each new night.

For the object frames, we will calculate the modal value of all the pixels, correct this to 1 arc-sec square, and then convert this to a magnitude. We will *not* correct the object frames for extinction. Kevin can explain why.

We will measure about 6 nights per year over the last 5 years. We will then add these data to the data that Roger Leiton and Kevin Krisciunas have.

 

THE PROCEDURE

Make sure you have a directory like

(home)/uparm/ctio36/
or similar for ctio60, etc.

Edit and run setup:

setup:

set stdimage = imt1024
set uparm = /uw50/nick/uparm/ctio36/
set imdir = HDR$pix/

noao
ctio
nickcl
imred
digi
apphot
astu
ccdr
ccdred.instrument = "myiraf$cfccd.dat"
ccdred.ssfile = "myiraf$c36.sub"

task skyb = "nickcl$skyb.cl"
task skymag = "nickcl$skymag.cl"

task $sed = "$foreign"

loadit.format = "1024"
loadit.statsec = "*,*"
nstat.statsec = "*,*"
keep

IF YOU ARE STARTING A NEW NIGHT, DELETE THE FILE:

rm -f /tmp/skyb.dat

Separate the filters.

hsel obj*.imh $I,filters yes | sed s/.imh// | grep "'dia b'" | field - 1 > inb
hsel obj*.imh $I,filter2 yes | sed s/.imh// | grep v | sed s/v// > inv

Make sure that CTIO is listed as the observatory. Do:

hsel *.imh $I,observat yes

If not, run

hedit *.imh observat CTIO add+ ver- show+

Run setairmass to add UTMIDDLE keyword:

setairmass *.imh

Now run the first program, the sky brightness programs "skyb." This creates a file called /tmp/skyb.dat which contains the information needed for the nightly calculation of the zero-point of the photometric scale.

For skyb, change the following parameters depending on the telescope.
For the 36", 0.40"/pix. We use a standard radius of 7" or 7/0.4=17.5 pixels.

     (epadu = 4.0) CCD gain (e-/adu)
  (readnoi= 3.2) CCD read noise (e-)
  (annulus= 17.5) Inner radius of sky annulus
  (dannulu= 10.) Width of sky annulus
  (apertur= 17.5) Aperture radius

To find the library mags, grep on:

head -1 /uw50/nick/daophot/library/ubvri.lib
grep ru152 /uw50/nick/daophot/library/ubvri.lib

etc. I open an new window, use SMALL type, and widen the window to fit one line per star. With this window I cut/paste the library magnitude so I never have to type it.

Select a field. make sure it is not at high airmass. Check the airmass as:

hsel @inv $I,airmass

Using "skyb", find the star, enter the library magnitude *carefully*, then mark the star. Exit by typing "q" twice while the image cursor is active.

Measure about 5-10 stars in at least two frames. Try to select fields that are near airmass 1.2. Don't go above 1.6.

The form of /tmp/skyb.dat is:

        #object x y exptime airmass filt nat_mag err stand_mag
  obj152 536.820 695.439 20. 1.272 diav 17.242 0.004 13.866
  obj152 416.543 699.798 20.  1.272 diav 16.002 0.002 12.642
  obj152 426.741 598.940 20. 1.272 diav 17.813 0.007 14.425

 

You can check quickly the sky zeropoints as:

sort /tmp/skyb.dat col=6

grep diav /tmp/skyb.dat | filecalc STDIN "$9-$7" form="%7.2f"
grep diab /tmp/skyb.dat | filecalc STDIN "$9-$7" form="%7.2f"

For instance, the output looks like:

-3.80
-3.84
-3.27
-3.85
-3.84

If any of the mags look bad, edit the file /tmp/skyb.dat. You can comment out the bad value using a leading "#".

Now run "skymag." Make sure the read noise and gain are correct. Make sure that UT is set to UTMIDDLE. This parameter is set by "setairmass" so you have to have run that program. You also have to enter an airmass correction. This is to correct the *standard* stars in /tmp/skyb.dat and not the individual frames.

Most importantly - MAKE SURE THAT THE SECPIX IS CORRECT! SEE URL FOR TELESCOPES TO GET THE SCALE.

Run as:

skymag @inb extinct=0.22 out=skyb.dat
skymag @inv extinct=0.12 out=skyv.dat

cc> lpar skymag

filein = "@inb" input image or image list
(ra = "RA") right ascension keyword
(dec = "DEC") declination keyword
(epoch = "EPOCH") epoch of coords keyword
(dateobs = "DATE-OBS") observation date keyword
(ut = "UTMIDDLE") universal time keyword
(airmass = "AIRMASS") airmass keyword
(exptime = "EXPTIME") exposure time keyword
(filters = "FILTERS") filters keyword
(secpix = 0.4) arcsecond per pixel
(sigma = 10.) sigma search window for mode
(gain = 4.) CCD gain (e-/adu)
(rnoise = 3.2) CCD read noise (e-)
(extinct = 0.12) extinction (mag/airmass))
(photzp = 25.) photometric zeropoint
(binsize = 1.) bin size for histograms
(plotit = yes) plot the sky histogram?
(saveit = yes) save data to file?
(outfile = "sky.dat") sky mag file
(newfile = no) new file? if not, will append
(imglist = "tmp$tmp.59lb")  
(mode = "ql")  

     
The screen output of skymag is:

        #object exptime airmass filter ct/s ct/s mag_1 mag_2 zp sig N
  #       hist gaussian          
  #           hist gaussian      
  obj147 30 1.56 diav 8.38 7.82 21.18 21.26 -3.21 0.02   5
  obj152 20 1.27 diav 5.15 5.56 21.27 21.19 -3.21 0.02 5
  obj156 600 1.62 diav 156.16 157.02 21.26 21.25 -3.21 0.02 5

 

Here we have calculated the cts/s two ways - (1) we used the IRAF task histogram to estimate the peak and (2) we used a robust gaussian fit
to the data. It is my experience that these two numbers agree to better than 0.15mag usually. For the text output, we will only use the
Gaussian fit.

Note that the program also plots the histogram and the fit. Usually they are right on top of each other so there is not much to see. Run
the program and watch these fits for anything funny. You can also review the last fits by running gkimosaic, stepping through the data
with the space bar.

gkimosaic sky.gki nx=1 ny=1


The text output of skymag looks like:

      #obj exptime airmass filter UT cts/sec sky mag
  obj146 40 1.56 diab 1:15:16 2.90 22.30
  obj151 30 1.28 diab 1:23:29 2.62 22.10


Check the output with graph. The first one plots against time, the second against airmass, third against UT.

fields skyv.dat 2,7 | graph poin+ rou+ szm=0.02 mar=circle logx+ tit="exptime"
fields skyv.dat 3,7 | graph poin+ rou+ szm=0.02 mar=circle tit="airmass"
fields skyv.dat 5,7 | graph poin+ rou+ szm=0.02 mar=circle tit="UT"

fields skyb.dat 2,7 | graph poin+ rou+ szm=0.02 mar=circle logx+ tit="exptime"
fields skyb.dat 3,7 | graph poin+ rou+ szm=0.02 mar=circle tit="airmass"
fields skyb.dat 5,7 | graph poin+ rou+ szm=0.02 mar=circle tit="UT"

We will create averaged sky brightness measurements after we have some experience. But for now, you can do a simple average as:

fields skyb.dat 7 | ave
fields skyv.dat 7 | ave

back to top