automaticLightCurve.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:flaapluc 作者: jlenain 项目源码 文件源码
def exposure(self, gamma=None):
        """
        Compute exposure on source src, to add a flux column for the photometric light curve.

        Warning: the input file is modified in place, with an additional exposure column added to the file !
        """

        if self.daily:
            infile = self.workDir + '/' + str(self.src) + '_daily_lc.fits'
            srcmdl = self.workDir + '/' + str(self.src) + '_daily.xml'
        else:
            infile = self.workDir + '/' + str(self.src) + '_lc.fits'
            srcmdl = self.workDir + '/' + str(self.src) + '.xml'

        # If infile already contains an EXPOSURE column, we don't do anything
        hdu = fits.open(infile)
        if hdu[1].header.get('TTYPE5') == 'EXPOSURE':
            return True

        scfile = self.spacecraft
        irfs = 'P8R2_SOURCE_V6'
        rad = str(self.roi)

        options = 'infile=' + infile + ' scfile=' + scfile + ' irfs=' + irfs + ' rad=' + rad
        if self.fglName is not None:
            target = self.fglName.replace('3FGLJ', '3FGL J')
            logging.debug('exposure: target=%s', target)
            options += ' srcmdl=' + srcmdl + ' target="' + target + '"'
        else:
            options += ' srcmdl="none" specin=' + str(gamma)
        cmd = 'time -p ' + self.fermiDir + '/bin/gtexposure ' + options
        logging.info('Running gtexposure')
        os.system(cmd)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号