import astromatic as ast import sys if len(sys.argv)<3: print '' print 'ERROR: run_sext_scam_2.py requires 2 parameters:' print ' 1. Input science fits filename' print ' 2. Zero point' print '' print 'Example: python run_sext_scam_2.py 0435_scam_mar14_r.fits 27.685' print '' exit() infile = sys.argv[1] zeropoint = float(sys.argv[2]) whtfile = infile.replace('.fits','_wht.fits') regfile = infile.replace('.fits','.reg') outcat = infile.replace('.fits','.cat') configfile = 'sext_scam_final.config' print 'Running SExtractor on %s' % infile ast.make_cat_suprimecam(infile,outcat=outcat,regfile=regfile, configfile=configfile,whtfile=whtfile, zeropt=zeropoint)
import astromatic as ast import sys infile = sys.argv[1] whtfile = infile.replace(".fits", "_wht_init.fits") regfile = infile.replace(".fits", ".reg") outcat = infile.replace(".fits", ".cat") print "Running SExtractor on %s" % infile ast.make_cat_suprimecam( infile, outcat=outcat, regfile=regfile, whtfile=whtfile, configfile="sext_scam_astrom.config", satur=60000.0 )
hdr = pf.getheader(scifile) except: print '' print 'ERROR: Could not open header for fits file %s' % scifile print '' exit() try: zeropoint = hdr['magzpt'] except: print '' print 'ERROR: Could not get zeropoint in header for fits file %s' % scifile print '' del hdr exit() del hdr """ Summarize input information """ print '' print 'SExtractor input parameters' print '-------------------------------------------------------' print 'Science file: %s' % scifile print 'Weight file: %s' % whtfile print 'Output catalog: %s' % catfile print 'Regions file: %s' % regfile print 'Config file: %s' % configfile print 'Zeropoint %6.3f' % zeropoint print '' """ Actually run SExtractor """ astrom.make_cat_suprimecam(scifile,catfile,regfile,configfile=configfile,whtfile=whtfile,zeropt=zeropoint)