本文整理汇总了Python中GtApp.GtApp类的典型用法代码示例。如果您正苦于以下问题:Python GtApp类的具体用法?Python GtApp怎么用?Python GtApp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GtApp类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: gtselect
def gtselect(self, phased, pulsarMode):
if pulsarMode:
if phased:
phMin=self.phaseMin
phMax=self.phaseMax
outputFile = self.srcName+'_gti_'+self.phaseMin+'_'+self.phaseMax+'.fits'
evfile=self.srcName+'_gti.fits'
else:
phMin=0
phMax=0
evfile='@events.txt'
outputFile = self.srcName+'_filtered.fits'
else:
outputFile = self.srcName+'_filtered.fits'
evfile='@events.txt'
phMin=0
phMax=0
gtselect = GtApp('gtselect')
gtselect.run(
evclass=2,
infile=evfile,
outfile=outputFile,
ra=self.RA,
dec=self.DEC,
rad=self.ROI,
emin=self.EMIN,
emax=self.EMAX,
zmax=self.ZMAX,
phasemin=phMin,
phasemax=phMax,
tmin='0',
tmax='0')
示例2: SrcModelTask
class SrcModelTask(Task):
default_config = {
'srcmaps' : None,
'srcmdl' : None,
'expcube' : None,
'bexpmap' : None,
'srcmdl' : None,
'chatter' : 2,
'irfs' : None,
'outtype' : 'ccube' }
def __init__(self,outfile,config=None,opts=None,**kwargs):
super(SrcModelTask,self).__init__(config,opts=opts,**kwargs)
self._outfile = os.path.abspath(outfile)
self.register_output_file(self._outfile)
self._gtapp = GtApp('gtmodel')
def run_task(self):
outfile = os.path.basename(self._output_files[0])
self._gtapp.run(outfile=outfile,**self.config)
示例3: gtexpcube2
def gtexpcube2(self,mode):
gtexpcube2 = GtApp('gtexpcube2')
if mode=='_expcube_':
nx=400
ny=400
elif mode=='_allsky_':
nx=1800
ny=900
gtexpcube2.run(
infile=self.srcName+'_ltcube_'+self.phaseMin+'_'+self.phaseMax+'.fits',
outfile=self.srcName+mode+self.phaseMin+'_'+self.phaseMax+'.fits',
cmap='none',
irfs=self.irfs,
nxpix=nx,
nypix=ny,
binsz='0.2',
coordsys ='CEL',
xref=self.RA,
yref=self.DEC,
axisrot='0',
proj='AIT',
emin=self.EMIN,
emax=self.EMAX,
enumbins=self.EBIN)
示例4: SrcMapTask
class SrcMapTask(Task):
default_config = { 'scfile' : None,
'expcube' : None,
'bexpmap' : None,
'cmap' : None,
'srcmdl' : None,
'chatter' : 2,
'irfs' : None,
'resample' : 'yes',
'rfactor' : 2,
'minbinsz' : 0.1 }
def __init__(self,outfile,config=None,**kwargs):
super(SrcMapTask,self).__init__()
self.update_default_config(SrcMapTask)
self.configure(config,subsection='gtsrcmaps',**kwargs)
self._outfile = os.path.abspath(outfile)
self.register_output_file(self._outfile)
self._gtapp = GtApp('gtsrcmaps','Likelihood')
def run_task(self):
config = self.config
outfile = os.path.basename(self._output_files[0])
self._gtapp.run(outfile=outfile,emapbnds='no',**config)
示例5: MkTimeTask
class MkTimeTask(Task):
default_config = { 'roicut' : 'no',
'filter' : 'IN_SAA!=T&&DATA_QUAL==1&&LAT_CONFIG==1&&ABS(ROCK_ANGLE)<52',
'evfile' : None,
'scfile' : None }
def __init__(self,infile,outfile,config=None,**kwargs):
super(MkTimeTask,self).__init__()
self.update_default_config(MkTimeTask)
self.configure(config,subsection='gtmktime',**kwargs)
self._infile = os.path.abspath(infile)
self._outfile = os.path.abspath(outfile)
self.register_output_file(self._outfile)
self._gtapp=GtApp('gtmktime','dataSubselector')
def run_task(self):
config = self.config
outfile = os.path.basename(self._output_files[0])
self._gtapp.run(evfile=self._infile,
outfile=outfile,
filter=config['filter'],
roicut=config['roicut'],
scfile=config['scfile'])
示例6: FindSource
def FindSource(self):
"""Run the gtfindsrc tool"""
outfile = utils._dump_findsrcout(self.Configuration)
if (self.clobber=="no" and os.path.isfile(outfile)):
#print("File exists and clobber is False")
return(0)
findsrc = GtApp('gtfindsrc', 'Likelihood')
findsrc['evfile'] = self.mktimefile
findsrc['scfile'] = self.ft2
if self.irfs != 'CALDB':
findsrc['evtype']= self.Configuration['event']['evtype']
else :
findsrc['evtype']= 'INDEF'
findsrc['irfs'] = self.irfs
findsrc['expcube'] = self.Cubename
findsrc['expmap'] = self.Mapname
findsrc['srcmdl'] = utils._dump_xml( self.Configuration)
findsrc['coordsys'] = self.Configuration['space']['coordsys']
findsrc['target'] = self.srcname
findsrc['optimizer'] = self.Configuration["fitting"]["optimizer"]
findsrc['ftol'] = self.Configuration["fitting"]["ftol"]
findsrc['clobber'] = self.clobber
findsrc['reopt'] = self.Configuration["findsrc"]["Refit"]
findsrc['outfile'] = outfile
findsrc.run()
示例7: GtExposure
def GtExposure(self):
exposure = GtApp('gtexposure', 'Likelihood')
exposure['infile'] = self.lcfile
exposure['scfile'] = self.ft2
exposure['irfs'] = self.irfs
exposure['srcmdl'] = "none"
exposure['specin'] = -self.Configuration['AppLC']['index']
exposure.run()
示例8: gtltcube
def gtltcube(self):
gtltcube = GtApp('gtltcube')
gtltcube.run(
evfile =self.srcName+'_gti_'+self.phaseMin+'_'+self.phaseMax+'.fits',
scfile =self.scfile,
outfile =self.srcName+'_ltcube_'+self.phaseMin+'_'+self.phaseMax+'.fits',
dcostheta = '0.025',
binsz = '1')
示例9: BinTask
class BinTask(Task):
default_config = { 'nxpix' : 140,
'nypix' : None,
'xref' : 0.0,
'yref' : 0.0,
'emin' : 1000.0,
'emax' : 100000.0,
'scfile' : None,
'chatter' : 2,
'proj' : 'AIT',
'hpx_order' : 3,
'enumbins' : 16,
'algorithm' : 'ccube',
'binsz' : 0.1,
'coordsys' : 'CEL'}
def __init__(self,infile,outfile,config=None,opts=None,**kwargs):
super(BinTask,self).__init__()
self.configure(config,opts=opts,subsection='gtbin',**kwargs)
self._infile = os.path.abspath(infile)
self._outfile = os.path.abspath(outfile)
self.register_output_file(self._outfile)
if re.search('^(?!\@)(.+)(\.txt|\.lst)$',self._infile):
self._infile = '@'+self._infile
self._gtbin=GtApp('gtbin','evtbin')
def run_task(self):
config = copy.deepcopy(self.config)
outfile = os.path.basename(self._output_files[0])
if config['nypix'] is None:
config['nypix'] = config['nxpix']
self._gtbin.run(algorithm=config['algorithm'],
nxpix=config['nxpix'],
nypix=config['nypix'],
binsz=config['binsz'],
hpx_order=config['hpx_order'],
evfile=self._infile,
outfile=outfile,
scfile=config['scfile'],
xref=config['xref'],
yref=config['yref'],
axisrot=0,
proj=config['proj'],
ebinalg='LOG',
emin=config['emin'],
emax=config['emax'],
enumbins=config['enumbins'],
coordsys=config['coordsys'],
chatter=config['chatter'])
示例10: GtBinDef
def GtBinDef(self,filename):
if (self.clobber=="no" and os.path.isfile(self.BinDef)):
#print("File exists and clobber is False")
return(0)
bindef = GtApp('gtbindef', 'Likelihood')
bindef['bintype'] = 'T'
bindef['binfile'] = filename
bindef['outfile'] = self.BinDef
bindef.run()
示例11: GtBinnedMap
def GtBinnedMap(self):
"""Run the gtexpcube2 tool for binned analysis"""
expcube2 = GtApp("gtexpcube2", "Likelihood")
expcube2["infile"] = self.Cubename
expcube2["outfile"] = self.BinnedMapfile
expcube2["cmap"] = self.ccube
expcube2["irfs"] = self.irfs
expcube2["emin"] = self.Emin
expcube2["emax"] = self.Emax
expcube2.run()
示例12: gtpphase
def gtpphase(self, ephemeris, srcName, pulsarMode):
if pulsarMode:
gtpphase = GtApp('gtpphase')
gtpphase.run(
chatter='4',
evfile=self.srcName+'_gti.fits',
scfile=self.scfile,
psrdbfile=ephemeris,
psrname=srcName,
ephstyle='DB',
solareph='JPL DE200')
示例13: SrcProb
def SrcProb(self):
"""Run the gtsrcprob tool"""
srcprob = GtApp('gtsrcprob', 'Likelihood')
srcprob['evfile'] = self.eventfile
srcprob['scfile'] = self.ft2
srcprob['irfs'] = self.irfs
srcprob['srcmdl'] = self.xmlfile
srcprob['outfile'] = self.Probfile
srcprob['srclist'] = self.Configuration['srcprob']['srclist']
srcprob['clobber'] = self.clobber
srcprob.run()
示例14: GtExposure
def GtExposure(self):
exposure = GtApp('gtexposure', 'Likelihood')
exposure['infile'] = self.lcfile
exposure['scfile'] = self.ft2
exposure['target'] = self.srcname
if self.Configuration['event']['irfs'] != 'CALDB':
exposure['evtype']= self.Configuration['event']['evtype']
exposure['irfs'] = self.irfs
exposure['srcmdl'] = "none"
exposure['specin'] = -self.Configuration['AppLC']['index']
exposure['clobber'] = self.clobber
exposure.run()
示例15: gtsrcmaps
def gtsrcmaps(self, model):
gtsrcmaps = GtApp('gtsrcmaps')
gtsrcmaps.run(
scfile=self.scfile,
expcube=self.srcName+'_ltcube_'+self.phaseMin+'_'+self.phaseMax+'.fits',
cmap=self.srcName+'_ccube_'+self.phaseMin+'_'+self.phaseMax+'.fits',
srcmdl=model,
bexpmap=self.srcName+'_allsky_'+self.phaseMin+'_'+self.phaseMax+'.fits',
outfile=self.srcName+'_scrmap_'+self.phaseMin+'_'+self.phaseMax+'.fits',
irfs=self.irfs,
chatter='4',
emapbnds="no")