コード例 #1
0
ファイル: fluxcal.py プロジェクト: pyrrho314/recipesystem
 def _detsources(self):
     """ Local function
     """ 
     if self.addBPM:
        self.addbpm()
        #print 'AFTER addbpm:',self.adout.info()
     self.log.info("\n DS DS DS DS using: SIGMA THRESHOLD FWHM:: "+\
              str(self.sigma)+','+\
              str(self.threshold)+','+str(self.fwhm)+'\n')
     dd = DetectSources   (self.adout, sigma=self.sigma,
                 threshold=self.threshold,fwhm=self.fwhm,
                 logfile=self.logfile)
     adout = dd.runDS()
     self.adout = adout
     return adout
コード例 #2
0
 def detectSources(self, rc):
     """ detectsources primitive
     """
     adOuts = []
     try:
         log.info( "Starting primitive detectSources")
         for ad in rc.get_inputs(style='AD'):
              ds   = DetectSources   (ad, logfile='', sigma=rc['sigma'], 
                                      threshold=rc['threshold'], fwhm=rc['fwhm'])
              adout = ds.runDS()
              adOuts.append(adout)
         rc.report_output(adOuts)
     except:
         raise FluxCalException("Problems with detectSources")
   
     yield rc
コード例 #3
0
    def fluxcal(self, rc):
        """
          Fluxcal drives:
            - DetectSources
            - AddReferenceCatalogs
            - CorrelateWithReferenceCatalogs
            - CalculateZeropoint
        """

        logfile = 'fluxcal.log'
        adOuts = []

        try:
            log.status('*STARTING*  Running fluxcal functions')
            for ad in rc.get_inputs(style='AD'):

                ds   = DetectSources   (ad, logfile=logfile, sigma=rc['sigma'], 
                                        threshold=rc['threshold'], fwhm=rc['fwhm'])
                adout = ds.runDS()

                cc   = AddReferenceCatalogs(adout, logfile=logfile, 
                                            catalogName=rc['catalogName'])
                adout = cc.getRefs()

                corr = CorrelateWithReferenceCatalogs (adout, logfile=logfile,
                                                       delta=rc['delta'])
                adout = corr.runCorr()

                czp  = CalculateZeropoint(adout, logfile=logfile, 
                                           zplogfile=rc['zplogfile'],
                                           extinction=rc['extinction'])
                adout = czp.runZP()

                adOuts.append(adout)

            rc.report_output(adOuts)

            log.status('Fluxcal completed successfully')
        except:
            raise FluxCalException("Problems with fluxcal")

        yield rc