procedure lbcstat (imroot) string imroot ="last" {prompt="Root name ('lbc[rb]*'),'lastR', or 'lastB'"} # @(#) lbcstat Author: R.A. Jansen -- Dec 12 2012 # @(#) # @(#) Simple task to compute the image statistics of all four chips in a # @(#) Multi Extension FITS (MEF) file written by an LBT/LBC Red or Blue # @(#) camera. Root names should begin with "lbcb" or "lbcr" for Blue and # @(#) Red cameras, and appending extension ".fits" to the rootname is OK, # @(#) but not necessary. Special root names "lastR" and "lastB" attempt to # @(#) identify the latest LBC-Blue or LBC-Red MEF written to disk and will # @(#) compute its statistics. begin string imr, img, ctmp int i, j, k imr = imroot ctmp = "" if ( imr == "lastB" ) { print ("!\ls -1 lbcb*.fits | sort | tail -1") | cl | scan(ctmp) if (ctmp != "") imr = ctmp } if ( imr == "lastR" ) { print ("!\ls -1 lbcr*.fits | sort | tail -1") | cl | scan(ctmp) if (ctmp != "") imr = ctmp } i = strlen(imr) j = strlen(imr)-4 k = strlen(imr)-5 if ( substr(imr,j,i) == ".fits" ) imr = substr(imr,1,k) # Print selected header information... hselect (imr//"[0]", "$I,telra,teldec,exptime,filter", yes) # Print statistics column header: print ("# IMAGE MEAN MIDPT STDDEV MIN MAX") img = imr//"[1],"//imr//"[2],"//imr//"[3],"//imr//"[4]" # compute the image statistics for each CCD chip in turn... imstat (img, fields="image,mean,midpt,stddev,min,max", lower=INDEF, upper=INDEF, nclip=1., binwidth=0.1, format=no, cache=no) end