Here I document the development of code for estimateing sky surface brightness with acm image. The code is roughly fashioned in the same manner as zpmido. Bsically there is a part that runs ds9_imstats to get the instrumental photometry, a section that computes the calibaretd sky surface brightness in mags per sq.arcsec, and a section that creates and installs FITS header cards about these data. I also added cards that characterise the night such as moon angle, phase, and estimated model V sky brightness.
The basic script call, and the supporting scripst are shown below:
% skysb_mido 20190217T122456.6_acm_sci.fits N Add useful header info: acm_rstrct $locim Y $debug Usage: acm_rstrct 20180206T022042.6_acm_sci_proc.fits Y N arg1 - Name of LOCAL FITS image with table file to be analysed arg2 - install RSTRCT stats into header? (Y/N) arg3 - run in debug mode (Y/N) skymoon $locim Y $debug Usage: skymoon 20180206T022042.6_acm_sci_proc.fits Y N arg1 - Name of LOCAL FITS image to be checked arg2 - install cards into header? (Y/N) arg3 - run in debug mode? (Y/N) The relevant header cards instlled here: RSTRT = -1050.6305 / Radius position of tracker at start (mm) MILLUM = -99.0000 / percentage moon illumination PHIMOON= -99.0000 / angle of separation to moon (deg) VSKYSB = 21.9000 / predicted V sky surface brightness To compute the basic instrumental phtometry: ds9_imstats $fitsname $bugo Usage: ds9_imstats a.fits Y arg1 - FITS image name arg2 - query user about image scalling (Y/N) To gather a table of sky surface brightenss estimates: Gather header data and mido files, run skysb_mido_table_values Usage: skysb_mido_table 20190217T122456.6_acm_sci.fits Y arg1 - name of FITS image arg2 - run in debug/verbose mode (Y/N) Calculate sky SB values and build table (otw code): Usage: skysb_mido_table_values.sh 6 -3.455 0.271 N arg1 - exposure time in seconds arg2 - ZP for 1-sec exposure )ZPSEC) arg3 - plate scale in arcsec/pix arg4 - run in debug/verbose mode (Y/N) NOTE: table files are skysb_mido_table_values.parlab skysb_mido_table_values.table Add final mean sky surface brightness header info: Usage: hcards_skysb.sh 22.504 0.055 8 N arg1 - sky surface brightness (mss)_ arg2 - mean error (mss) arg3 - number of sky boxes arg4 - run in debug/verbose mode Usage: headrev.sh a.fits wcs_skysb.cards new.fits arg1 - name of input FITS image being modified arg2 - name of ASCII file of header cards arg3 - name of revised (output) FITS image