import numpy as np import sys #Script to return the count rates in the UV filters #by Atreyee Sinha #please report bugs to atreyees@iucaa.in; atreyee.sinha@gmail.com #This script will give the count rates in the UV channels, indicating unsafe channels #run as uvit_checkuv.py magnuv magfuv #please keep the order in mind #put -999 if fuv magnitude not known """ The count rates for NUV & FUV filters using the 7x7 pixel2 window seem to underestimate the flux for the bright GALEX objects, because of the larger FWHM for the saturated stars. Therefore, to make a safer decision, the cataloged magnitude (for point sources, FWHM < 1500), after saturation correction as per the prescriptions in the Proposers Guide document, are used to generate the count rates for the UVIT filters. IMP: Input the magnitude brightest object in the field """ def counts_fuv(mag_fuv): m=mag_fuv if (mag_fuv < 15.0): C0 = 5.371 C1 = 20.000 C2 = -210 m = C0 + np.sqrt(C1*mag_fuv + C2) m0 = 18.22 c0 = [1.0,0.85,0.63,0.22] filt = ["FUV-CaF2","FUV-BaF2","FUV-Sapphire","FUV-Silica"] print "FUV counts for magnitude ", m for i in range(len(c0)): t=" SAFE" k = m0 + 2.5*np.log10(c0[i]) cps = np.power(10.0, (k-m)/2.5) if cps>1500: t=" UNSAFE" print filt[i],cps,t print "\n\n" def counts_nuv(mag_nuv): m=mag_nuv if (mag_nuv < 15.0): C0 = 2.634 C1 = 26.316 C2 = -245.329 m = C0 + np.sqrt(C1*mag_nuv + C2) m0 = 20.0 c0 = [1.0,0.22,0.27,0.074,0.055] filt = ["NUV-Silica","NUV-B4","NUV-B13","NUV-B15","NUV-N2"] print "NUV counts for magnitude ", m for i in range(len(c0)): t=" SAFE" k = m0 + 2.5*np.log10(c0[i]) cps = np.power(10.0, (k-m)/2.5) if cps>1500: t=" UNSAFE" print filt[i],cps,t print "\n\n" def main(): mag_fuv=float(sys.argv[-1]) mag_nuv=float(sys.argv[-2]) print "\n\n" if (mag_fuv==-999): mag_fuv=mag_nuv-1.65 counts_fuv(mag_fuv) counts_nuv(mag_nuv) if __name__=="__main__": main()