def run(args): """Generate the residual image using Ellipse run.""" """Call the STSDAS.ANALYSIS.ISOPHOTE package""" if args.isophote is None: if args.verbose: print '\n' + SEP print "## Call STSDAS.ANALYSIS.ISOPHOTE() " print SEP iraf.stsdas() iraf.analysis() iraf.isophote() iraf.ttools()
def __init__(self, shortparlists, parlists, FitsDir, logfile, verbose=1, clean_up=1, skyKey='ALIGNSKY', hdrGain=0, crlower=None, imNsci=1): self.modName = string.split(string.split(str(self))[0], '.')[0][1:] self.shortparlists = shortparlists self.parlists = parlists self.Fits = FitsDir self.verbose = verbose self.crmasks = {} # cosmic ray masks names self.removeList = [] self.clean_up = clean_up self.skyKey = skyKey self.hdrGain = hdrGain self.crlower = crlower if imNsci < 1: raise ValueError, 'Error: pyblot got imNsci = ' + imNsci self.imNsci = imNsci self.logfile = logfile print self.modName, 'version', __version__ self.logfile.write('Instantiating ' + self.modName + ' version ' + __version__) # make sure these packages are loaded iraf.stsdas() iraf.toolbox() iraf.imgtool() iraf.fourier() iraf.fitting() iraf.ttools() iraf.analysis() iraf.dither() # flush the cash! twice! iraf.flpr() iraf.flpr() iraf.reset(imtype='fits') # seems to make deriv task a bit happier iraf.set(tmp='./')
#!/usr/bin/env python print('This version of galTables works for *cutout-24-rot.tab files and *cutout-sdss.tab files. If you are not using rotated 24m files then use galTablesv2.py') from pylab import * import glob from pyraf import iraf import os iraf.stsdas() iraf.analysis() iraf.toolbox() iraf.ttools() flag = str(raw_input('Which files? a=24 b=sdss ')) flag = str(flag) if flag.find('a') > -1: tabfiles = glob.glob('*cutout-24-rot.tab') if flag.find('b') > -1: tabfiles = glob.glob('*cutout-sdss.tab') #tabfiles=glob.glob('*.tab') #print tabfiles for i in range(len(tabfiles)): tfile = tabfiles[i] nfile = tfile.split('.') dfile = nfile[0]+'.dat' print tfile,' -> ',dfile iraf.tprint(table=tfile,pwidth='INDEF',showhdr='no',showunits='no',Stdout=dfile)
repeatflag = 0 print 'i think repeatflag = 0 ', repeatflag print 'repeatflag = ', repeatflag os.system('mkdir Finished') os.system('mkdir NearbyObjects') os.system('mkdir PartialImages') os.system('mkdir OffCenter') raw_input('Make sure ds9 is open. Hit return when ready.') iraf.stsdas() iraf.analysis() iraf.isophote() iraf.tables() iraf.ttools() mipsfiles = glob.glob('*cutout-24.fits') mipsfiles.sort() mipswcsfiles = glob.glob('*cutout-24-rot.fits') mipswcsfiles.sort() sdssrfiles = glob.glob('*cutout-sdss.fits') sdssrfiles.sort() ipa = 0 xcenter = 23.0 ycenter = 23.0 minr = 2 initialr = 6 maxr = 20
basename = os.path.splitext(os.path.basename(self.dataset.frames[n]['irafpath']))[0] shutil.copy(os.path.join(self.pars.wdir, self.dataset.masterdir, 'master.final'), os.path.join(self.pars.wdir, self.irafphotdir, basename + '.coord')) f2.write(os.path.join(self.pars.wdir, self.irafphotdir, basename + '.phot') + '\n') f3.write(os.path.join(self.pars.wdir, self.irafphotdir, basename + '.coord') + '\n') f2.close() f3.close() logging.info('Photometry will be performed using the following apertures: %s' % self. apsizestr) # initialize IRAF iraf.noao(Stdout=1) iraf.digiphot(Stdout=1) iraf.daophot(Stdout=1, verify='no') iraf.tables(Stdout=1) iraf.ttools(Stdout=1) iraf.astutil(Stdout=1) # set some parameters for iraf photometry iraf.fitskypars.setParam('salgori', self.pars.iraf_phot['salgori']) iraf.fitskypars.setParam('annulus', self.pars.iraf_phot['annulus']) iraf.fitskypars.setParam('dannulu', self.pars.iraf_phot['dannulu']) iraf.centerpars.setParam('calgori', self.pars.iraf_phot['calgori']) iraf.centerpars.setParam('cbox', self.pars.iraf_phot['cbox']) iraf.centerpars.setParam('maxshif', self.pars.iraf_phot['maxshif']) iraf.photpars.setParam('apertur', self.apsizestr) o = iraf.phot(image='@'+os.path.join(self.pars.wdir, self.dataset.framesdir, 'imagelist'), wcsin='world', coords='@'+os.path.join(self.pars.wdir, self.irafphotdir, 'coordlist'), output='@'+os.path.join(self.pars.wdir, self.irafphotdir, 'outputlist'), interactive='no', verify='no', Stdout=1)