Пример #1
0
    def oLIBTrigger(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        event creation sanity check for oLIB
        we check for the existence of :

            %(gpstime).2f-(.*).json

        while ignoring log messsages and tagnames
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )
            logger.debug( "retrieving event details" )
        event = gdb.event( graceid ).json() ### we need the gpstime, so we query

        template = "%.2f-(.*).json"%event['gpstime'] ### NOTE: may be fragile
        template = template.replace('.00', '.0') ### This is required because of the peculiarities of how oLIB 
                                                 ### names things when the event lands on an integer second
        self.warning, action_required = esUtils.check4file( graceid, gdb, template, tagnames=None, verbose=verbose, regex=True, logTag=logger.name if verbose else None )
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : "+self.warning
            else:
                message = "no action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return action_required
Пример #2
0
    def cWBTrigger(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        query GraceDB to check for proper event creation
        we check for the existence of:

            trigger_%(gpstime).4f.txt

        while ignoring log messages and tagnames
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )
            logger.debug( "retrieving event details" )
        event = gdb.event( graceid ).json() ### we need the gpstime, so we query

        filename = "trigger_%.4f.txt"%event['gpstime'] ### NOTE: this may be fragile
        self.warning, action_required = esUtils.check4file( graceid, gdb, filename, tagnames=None, verbose=verbose, logTag=logger.name if verbose else None )
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : "+self.warning
            else:
                message = "no action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return action_required
Пример #3
0
    def emBright(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that emBright posted a result

        WARNING: currently only check for a file and do not check for log message or tags
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )

        jsonname = "Source_Classification_%s.json"%(graceid) ### NOTE: this may be fragile
        self.warning, action_required = esUtils.check4file( 
                                            graceid,
                                            gdb,
                                            jsonname,
                                            regex=False,
                                            tagnames=None,
                                            verbose=verbose,
                                            logTag=logger.name if verbose else None,
                                        )
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : "+self.warning
            else:
                message = "no action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return action_required
Пример #4
0
    def bayeswavePEBayesFactors(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that BayesWave PE posted Bayes Factors
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )

        if not esUtils.check4log( graceid, gdb, "BWB Bayes Factors", verbose=verbose, logTag=logger.name if verbose else None ):
            self.warning = "found Bayeswave BayesFactors message"
            if verbose or annotate:
                message = "no action required : "+self.warning
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message )
            return False ### action_required = False

        self.warning = "could not find Bayeswave BayesFactors message"
        if verbose or annotate:
            message = "action required : "+self.warning
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )
        return True ### action_required = True
Пример #5
0
    def cbcCoinc(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        check for coinc.xml file via direct string comparison while ignoring log comments and tagnames
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))

        filename = "coinc.xml"
        self.warning, action_required = esUtils.check4file(
            graceid,
            gdb,
            filename,
            tagnames=None,
            verbose=verbose,
            logTag=logger.name if verbose else None)
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : " + self.warning
            else:
                message = "no action required : " + self.warning

            ### post message
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)

        return action_required
Пример #6
0
 def libPESkymap(self,
                 graceid,
                 gdb,
                 verbose=False,
                 annotate=False,
                 **kwargs):
     """
     a check that LIB PE posted a skymap
     looks for the existence of a skymap and the correct tagnames
     """
     if verbose:
         logger = esUtils.genTaskLogger(self.logDir,
                                        self.name,
                                        logTag=self.logTag)
         logger.info("%s : %s" % (graceid, self.description))
     fitsname = "LIB.fits.gz"
     self.warning, action_required = esUtils.check4file(
         graceid,
         gdb,
         fitsname,
         tagnames=self.tagnames,
         verbose=verbose,
         logTag=logger.name if verbose else None)
     if verbose or annotate:
         if action_required:
             message = "action required : " + self.warning
         else:
             message = "no action required : " + self.warning
         if verbose:
             logger.debug(message)
         if annotate:
             esUtils.writeGDBLog(gdb, graceid, message)
     return action_required
Пример #7
0
    def externalTriggers(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that the external triggers search was completed.
        looks for a log message only, ignoring tagnames and files
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )

        if not esUtils.check4log( graceid, gdb, "Coincidence search complete", verbose=verbose, logTag=logger.name if verbose else None ): ### check for log message
            self.warning = "found external triggers coinc search completion message"
            if verbose or annotate:
                message = "no action required : "+self.warning

                ### post message
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message )

            return False ### action_required = False

        else:
            self.warning = "could not find external triggers search completion message"
            if verbose or annotate:
                message = "action required : "+self.warning

                ### post message
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message )

            return True ### action_required = True
Пример #8
0
    def idqFinish(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that iDQ finished as expected
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )

        template = "Finished searching for iDQ information within \[(.*), (.*)\] at %s"%(self.ifo) ### use regex
        if not esUtils.check4log( graceid, gdb, template, verbose=verbose, regex=True, logTag=logger.name if verbose else None ):
            self.warning = "found iDQ completion message at %s"%(self.ifo)
            if verbose or annotate:
                message = "no action required : "+self.warning

                ### post message
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message )

            return False ### action_required = False

        self.warning = "could not find iDQ completion message at %s"%(self.ifo)
        if verbose or annotate:
            message = "action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return True ### action_required = True
Пример #9
0
    def bayestarStart(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that bayestar started as expected
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )
        if not esUtils.check4log( graceid, gdb, "INFO:BAYESTAR:starting sky localization", verbose=verbose, logTag=logger.name if verbose else None ):
            self.warning = "found BAYESTAR starting message"
            if verbose or annotate:
                message = "no action required : "+self.warning
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message )
            return False ### action_required = False

        self.warning = "could not find a BAYESTAR starting message"
        if verbose or annotate:
            message = "action required : "+self.warning
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )
        return True ### action_required = True
Пример #10
0
    def segDB2grcDBFlag(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that segDB2grcDB uploaded the expected individual flags by requiring xml.gz files to exist (with expected nomenclature)
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )

        flagname = self.flag.split(":")
        flagname = "%s-%s-(.*)-(.*).xml.gz"%(flagname[0], "_".join(_.replace("-","_") for _ in flagname[1:]))
        self.warning, action_required = esUtils.check4file( 
                                            graceid,
                                            gdb,
                                            flagname,
                                            regex=True,
                                            tagnames=None,
                                            verbose=verbose,
                                            logFragment=None,
                                            logRegex=False,
                                            logTag=logger.name if verbose else None,
                                        )
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : "+self.warning
            else:
                message = "no action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return action_required
Пример #11
0
    def idqROCPlot(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that iDQ reported preformance metrics as expected
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )
        figname = "%s_%s(.*)_ROC-(.*)-(.*).png"%(self.ifo, self.classifier) ### NOTE: this may be fragile
        fragment = "iDQ local ROC figure for %s at %s"%(self.classifier, self.ifo) ### NOTE: this may be fragile
        self.warning, action_required = esUtils.check4file( 
                                            graceid,
                                            gdb,
                                            figname,
                                            regex=True,
                                            tagnames=None,
                                            verbose=verbose,
                                            logFragment=fragment,
                                            logRegex=False,
                                            logTag=logger.name if verbose else None,
                                        )
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : "+self.warning
            else:
                message = "no action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return action_required
Пример #12
0
    def lldqReport(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that a link to the lldq-report page was posted.
        looks for a log comment while ignoring tagnames and files
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )
        if not esUtils.check4log( graceid, gdb, "Automatic Data-quality report posted",  verbose=verbose, logTag=logger.name if verbose else None ):
            self.warning = "found lldq-report post"
            if verbose or annotate:
                message = "no action required : "+self.warning
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message )
            return False ### action_required = False

        self.warning = "could not find a lldq-report post"
        if verbose or annotate:
            message = "action required : "+self.warning
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )
        return True ### action_required = True
Пример #13
0
    def segDB2grcDBStart(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that segDB2grcDB started
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )

        if not esUtils.check4log( graceid, gdb, "began searching for segments in : ", verbose=verbose, logTag=logger.name if verbose else None ): ### check for log
            self.warning = "found segDB2grcDB starting message"
            if verbose or annotate:
                message = "no action required : "+self.warning

                ### post message
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message )

            return False ### action_required = False

        self.warning = "could not find segDB2grcDB starting message"
        if verbose or annotate:
            message = "action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return True ### action_required = True
Пример #14
0
    def idqTables(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that iDQ reported the xml tables as expected
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )
        filename = "%s_idq_%s(.*)-(.*)-(.*).xml.gz"%(self.ifo, self.classifier) ### NOTE: this may be fragile
        fragment = "iDQ glitch tables %s:"%(self.ifo) ### NOTE: this is bad... but it's what we have at the moment within iDQ
        self.warning, action_required = esUtils.check4file( 
                                            graceid,
                                            gdb,
                                            filename,
                                            regex=True,
                                            tagnames=None,
                                            verbose=verbose,
                                            logFragment=fragment,
                                            logRegex=False,
                                            logTag=logger.name if verbose else None,
                                        )
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : "+self.warning
            else:
                message = "no action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return action_required
Пример #15
0
    def lalinfFinish(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that LALInference finished
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )
        if not esUtils.check4log( graceid, gdb, "LALInference online estimation finished", verbose=verbose, logTag=logger.name if verbose else None ):
            self.warning = "found LALInference completion message"
            if verbose or annotate:
                message = "no action required : "+self.warning
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message )
            return False ### action_required = False

        self.warning = "could not find LALInference completion message"
        if verbose or annotate:
            message = "action required : "+self.warning
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )
        return True ### action_required = True
Пример #16
0
    def bayestarNoVirgoSkymap(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that bayestar produced a skymap which excludes virgo
        Only checks for a skymap iff Virgo is present in the instrument list. Otherwise, ignores this event (return False)
        looks for the existence of a skymap and the correct tagnames
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )

        ### FIXME: the following might be fragile...
        if 'V1' not in gdb.event(graceid).json()['instruments'].split(','):
            if verbose or annotate:
                message = 'no action required : V1 not in list of instruments and therefore existence of bayestar_no_virgo.fits.gz is irrelevant'
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message )
            return False ### not the trigger set I was expecting 

        fitsname = "bayestar_no_virgo.fits.gz"
        self.warning, action_required = esUtils.check4file( graceid, gdb, fitsname, tagnames=self.tagnames, verbose=verbose, logTag=logger.name if verbose else None )
        if verbose or annotate:
            if action_required:
                message = "action required : "+self.warning
            else:
                message = "no action required : "+self.warning
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )
        return action_required
Пример #17
0
    def segDB2grcDBAny(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that segDB2grcDB uploaded the query for any active segments
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )

        jsonname = "allActive-(.*)-(.*).json"
        self.warning, action_required = esUtils.check4file( 
                                            graceid,
                                            gdb,
                                            jsonname,
                                            regex=True,
                                            tagnames=None,
                                            verbose=verbose,
                                            logFragment=None,
                                            logRegex=False,
                                            logTag=logger.name if verbose else None,
                                        )
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : "+self.warning
            else:
                message = "no action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return action_required
Пример #18
0
    def omegaScanData(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that OmegaScans uploaded data
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )

        jsonname = "%s.json"%self.chanset
        self.warning, action_required = esUtils.check4file( 
                                            graceid,
                                            gdb,
                                            jsonname,
                                            regex=False,
                                            tagnames=None,
                                            verbose=verbose,
                                            logFragment=None,
                                            logRegex=False,
                                            logTag=logger.name if verbose else None,
                                        )
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : "+self.warning
            else:
                message = "no action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return action_required
Пример #19
0
    def skyviewer(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that plotting jobs ran and tagged figures properly
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )
            logger.debug( "retrieving files")

        jsonname = "%s.json"%self.fitsname[:-8] if self.fitsname.endswith('.fits.gz') else "%s.json"%self.fitsname[:-5]
        self.warning, action_required = esUtils.check4file( graceid, gdb, jsonname, tagnames=self.tagnames, verbose=verbose, logTag=logger.name if verbose else None )

        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : "+self.warning
            else:
                message = "no action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return action_required
Пример #20
0
    def omegaScanStart(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that OmegaScans were started
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )
    
        fragment = "automatic OmegaScans begun for: %s"%(", ".join(self.chansets))
        if not esUtils.check4log( graceid, gdb, fragment, tagnames=None, regex=False, verbose=verbose, logTag=logger.name if verbose else None ):
            self.warning = "found OmegaScan start message for %s"%(", ".join(self.chansets))
            if verbose or annotate:
                message = "no action required : "+self.warning
       
                ### post message
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message )

            return False ### action_required = False

        self.warning = "could not find OmegaScan start message for %s"%(", ".join(self.chansets))
        if verbose or annotate:
            message = "action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return True ### action_required = True
Пример #21
0
    def plotSkymap(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that plotting jobs ran and tagged figures properly
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )

        figname = "%s.png"%(self.fitsname.split('.')[0]) ### NOTE: this may be fragile
        self.warning, action_required = esUtils.check4file(
                                            graceid, 
                                            gdb, 
                                            figname, 
                                            tagnames=self.tagnames, 
                                            verbose=verbose, 
                                            logTag=logger.name if verbose else None,
                                         ) ### looK for the figure

        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : "+self.warning
            else:
                message = "no action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return action_required
Пример #22
0
    def cWBPEEstimate(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that cWB PE posted posterior samples
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )

        if not esUtils.check4log( graceid, gdb, "cWB parameter estimation", verbose=verbose, logTag=logger.name if verbose else None ):
            self.warning = "found cWB estimates of parameters"
            if verbose or annotate:
                message = "no action required : "+self.warning
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message )
            return False ### action_required = False

        self.warning = "could not find cWB estimates of parameters"
        if verbose or annotate:
            message = "action required : "+self.warning
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )
        return True ### action_required = True
Пример #23
0
 def libPEPostSamp(self,
                   graceid,
                   gdb,
                   verbose=False,
                   annotate=False,
                   **kwargs):
     """
     a check that LIB PE posted posterior samples
     NOTE: this is likely associated with the same log message as libPEFinishCheck 
           and it is not clear that we should seprate them as we have...
     """
     if verbose:
         logger = esUtils.genTaskLogger(self.logDir,
                                        self.name,
                                        logTag=self.logTag)
         logger.info("%s : %s" % (graceid, self.description))
     filename = "posterior_samples.dat"
     self.warning, action_required = esUtils.check4file(
         graceid,
         gdb,
         filename,
         verbose=verbose,
         logTag=logger.name if verbose else None)
     if verbose or annotate:
         if action_required:
             message = "action required : " + self.warning
         else:
             message = "no action required : " + self.warning
         if verbose:
             logger.debug(message)
         if annotate:
             esUtils.writeGDBLog(gdb, graceid, message)
     return action_required
Пример #24
0
    def multFITSFinish(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that multFITS finish as expected
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )

        if not esUtils.check4log( graceid, gdb, "finished skymap comparison for .*%s.*"%(".*".join(self.fitsnames)), regex=True, verbose=verbose, logTag=logger.name if verbose else None ):
            self.warning = "found multFITS finish message for %s"%(", ".join(self.fitsnames))
            if verbose or annotate:
                message = "no action required : "+self.warning
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message )
            return False ### action_required = False

        self.warning = "could not find multFITS finish message for %s"%(", ".join(self.fitsnames))
        if verbose or annotate:
            message = "action required : "+self.warning
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )
        return True ### action_required = True
Пример #25
0
    def idqRank(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that iDQ reported the gltich-FAP as expected
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )
        jsonname = "%s_%s_maxRANK_%s-(.*)-(.*).json"%(self.ifo, self.classifier, graceid) ### NOTE: this may be fragile
        fragment = "maximum glitch-RANK for %s at %s within \[(.*), (.*)\] is (.*)"%(self.classifier, self.ifo) ### NOTE: this may be fragile
        self.warning, action_required = esUtils.check4file( 
                                            graceid,
                                            gdb,
                                            jsonname,
                                            regex=True,
                                            tagnames=None,
                                            verbose=verbose,
                                            logFragment=fragment,
                                            logRegex=True,
                                            logTag=logger.name if verbose else None,
                                        )
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : "+self.warning
            else:
                message = "no action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return action_required
Пример #26
0
    def skyviewer(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that plotting jobs ran and tagged figures properly
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))
            logger.debug("retrieving files")

        jsonname = "%s.json" % self.fitsname[:-8] if self.fitsname.endswith(
            '.fits.gz') else "%s.json" % self.fitsname[:-5]
        self.warning, action_required = esUtils.check4file(
            graceid,
            gdb,
            jsonname,
            tagnames=self.tagnames,
            verbose=verbose,
            logTag=logger.name if verbose else None)

        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : " + self.warning
            else:
                message = "no action required : " + self.warning

            ### post message
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)

        return action_required
Пример #27
0
    def idqRankFrame(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        check that iDQ uploads rank timeseries files
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag ) 
            logger.info( "%s : %s"%(graceid, self.description) )
        framename = "%s_idq_%s_rank(.*)-(.*)-(.*).gwf"%(self.ifo, self.classifier) ### NOTE: this may be fragile
        fragment = "iDQ glitch-rank frame for %s at %s within \[(.*), (.*)\] :"%(self.classifier, self.ifo) ### NOTE: this may be fragile
        self.warning, action_required = esUtils.check4file( 
                                            graceid,
                                            gdb,
                                            framename,
                                            regex=True,
                                            tagnames=None,
                                            verbose=verbose,
                                            logFragment=fragment,
                                            logRegex=True,
                                            logTag=logger.name if verbose else None,
                                        )
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : "+self.warning
            else:
                message = "no action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return action_required
Пример #28
0
    def libPEStart(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that LIB PE started
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )
        if not esUtils.check4log( graceid, gdb, "LIB Parameter estimation started.", verbose=verbose, logTag=logger.name if verbose else None ):
            self.warning = "found LIB PE starting message"
            if verbose or annotate:
                message = "no action required : "+self.warning
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message )
            return False ### action_required = False

        self.warning = "could not find LIB PE starting message"
        if verbose or annotate:
            message = "action required : "+self.warning
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )
        return True ### action_required = True
Пример #29
0
    def idqActiveChanPlot(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        check that iDQ uploaded a plot of possible active channels
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )
        figname = "%s_%s(.*)_chanstrip-(.*)-(.*).png"%(self.ifo, self.classifier) ### NOTE: this may be fragile
        fragment = "iDQ channel strip chart for %s at %s"%(self.classifier, self.ifo) ### NOTE: this may be fragile
        self.warning, action_required = esUtils.check4file( 
                                            graceid,
                                            gdb,
                                            figname,
                                            regex=True,
                                            tagnames=None,
                                            verbose=verbose,
                                            logFragment=fragment,
                                            logRegex=False,
                                            logTag=logger.name if logger else None,
                                        )
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : "+self.warning
            else:
                message = "no action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return action_required
Пример #30
0
    def snglFITSStart(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that snglFITS started as expected
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )

        if not esUtils.check4log( graceid, gdb, "started skymap summary for .*%s.*"%self.fitsname, regex=True, verbose=verbose, logTag=logger.name if verbose else None ):
            self.warning = "found snglFITS start message for %s"%self.fitsname
            if verbose or annotate:
                message = "no action required : "+self.warning
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message )
            return False ### action_required = False

        self.warning = "could not find snglFITS start message for %s"%self.fitsname
        if verbose or annotate:
            message = "action required : "+self.warning
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )
        return True ### action_required = True
Пример #31
0
    def unblindInjections(self,
                          graceid,
                          gdb,
                          verbose=False,
                          annotate=False,
                          **kwargs):
        """
        a check that the unblind injections search was completed.
        looks for a log message only while ignoring tagnames and files
        """
        ### NOTE: we do not delegate to esUtils.check4log here because we need to look for mutliple logs...
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))
            logger.debug("retrieving log messages")
        logs = gdb.logs(graceid).json()['log']

        if verbose:
            logger.debug("parsing log")

        if esUtils.check4log(graceid,
                             gdb,
                             "No unblind injections in window",
                             verbose=verbose,
                             logTag=logger.name
                             if verbose else None):  ### check for log message
            self.warning = "process reported that no unblind injections were found"
            if verbose or annotate:
                message = "no action required : " + self.warning

                ### post message
                if verbose:
                    logger.debug(message)
                if annotate:
                    esUtils.writeGDBLog(gdb, graceid, message)

            return False  ### action_required = False

        if verbose:
            logger.warn(
                "we do not currently know how to parse out statements when there *is* an unblind injection...raising an alarm anyway"
            )

        self.warning = "could not find a statement about unblind injections"
        if verbose or annotate:
            message = "action required : " + self.warning

            ### post message
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)

        return True  ### action_required = True
Пример #32
0
    def localRate(self, graceid, gdb, verbose=None, annotate=False, **kwargs):
        """
        check the local rate of triggers submitted to GraceDB
        checks only around the event's gpstime : [gpstime-self.mWin, gpstime+self.pWin)
        Queries GraceDb to find neighboring events
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )

        ### get this event
        if verbose:
            logger.debug( "retrieving information about this event" )
        gdb_entry = gdb.event( graceid ).json()

        ### get event time
        event_time = float(gdb_entry['gpstime'])
        if verbose:
            logger.debug( "gpstime : %.6f"%(event_time) )
            logger.debug( "retrieving neighbors within [%.6f-%.6f, %.6f+%6f]"%(event_time, self.mWin, event_time, self.pWin) )

        ### count the number of neighbors
        count = 0
        for entry in gdb.events( "%d .. %d"%(np.floor(event_time-self.mWin), np.ceil(event_time+self.pWin)) ): ### query for neighbors in (t-mWin, t+pWin)
            if not entry.has_key('search'): 
                entry['search'] = None
            ###         not the 'current' event          belongs to the right group        associated with the right pipeline           from the correct search
            count += (entry['graceid'] != graceid) and (entry['group'] == self.group) and (entry['pipeline'] == self.pipeline) and (entry['search'] == self.search) ### add to count
            
        if count > (self.pWin+self.mWin)*self.maxRate: ### too many neighbors
            self.warning = "found %d events within (-%.3f, +%.3f) of %s"%(count, self.mWin, self.pWin, graceid)
            if verbose or annotate:
                message = "action required : "+self.warning

                ### post message
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message=message )  

            return True ### action_required = True

        else: ### an acceptable number of neighbors
            self.warning = "found %d events within (-%.3f, +%.3f) of %s"%(count, self.mWin, self.pWin, graceid)
            if verbose or annotate:
                message = "no action required : "+self.warning

                ### post message
                if verbose:
                    logger.debug( message )
                if annotate:
                    message = "event_supervisor : "+message
                    esUtils.writeGDBLog( gdb, graceid, message )

            return False ### action_required = False
Пример #33
0
    def createRate(self, graceid, gdb, verbose=None, annotate=False, **kwargs):
        """
        check the local rate of triggers submitted to GraceDB
        checks only around the event's creation time : [t-self.mWin, t+self.pWin)
        Queries GraceDb for neighbors
        """
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )
            logger.debug( "retrieving information about this event" )
        gdb_entry = gdb.event( graceid ).json()

        ### get event time
        event_time = float(tconvert( gdb_entry['created'][:-4] )) ### we strip the time-zone to help tconvert format this 
        winstart = tconvert( np.floor(event_time-self.mWin ), form="%Y-%m-%d %H:%M:%S" )
        winstop  = tconvert( np.ceil( event_time+self.pWin ), form="%Y-%m-%d %H:%M:%S" )

        if verbose:
            logger.debug( "%s -> %.3f"%(gdb_entry['created'], event_time) )
            logger.debug( "retrieving neighbors within [%s, %s]"%(winstart, winstop) )

        ### count the number of neighbors
        count = 0
        for entry in gdb.events( "created: %s .. %s"%(winstart, winstop) ): ### query for neighbors in (t-mWin, t+pWin)
            if not entry.has_key('search'):
                entry['search'] = None
            ###         not the 'current' event          belongs to the right group        associated with the right pipeline           from the correct search
            count += (entry['graceid'] != graceid) and (entry['group'] == self.group) and (entry['pipeline'] == self.pipeline) and (entry['search'] == self.search) ### add to count

        if count > (self.pWin+self.mWin)*self.maxRate: ### too many neighbors
            self.warning = self.warning = "found %d events within (-%.3f, +%.3f) of %s"%(count, self.mWin, self.pWin, graceid)
            if verbose or annotate:
                message = "action required : found %d events within (-%.3f, +%.3f) of %s creation"%(count, self.mWin, self.pWin, graceid)

                ### post messsage
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message=message )

            return True ### action_required = True

        else: ### an acceptable number of neighbors
            self.warning = "found %d events within (-%.3f, +%.3f) of %s"%(count, self.mWin, self.pWin, graceid)
            if verbose or annotate:
                message = "no action required : found %d events within (-%.3f, +%.3f) of %s creation"%(count, self.mWin, self.pWin, graceid)

                ### post message
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message )

            return False ### action_required = False
Пример #34
0
    def oLIBTrigger(self,
                    graceid,
                    gdb,
                    verbose=False,
                    annotate=False,
                    **kwargs):
        """
        event creation sanity check for oLIB
        we check for the existence of :

            %(gpstime).2f-(.*).json

        while ignoring log messsages and tagnames
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))
            logger.debug("retrieving event details")
        event = gdb.event(graceid).json()  ### we need the gpstime, so we query

        template = "%.2f-(.*).json" % event[
            'gpstime']  ### NOTE: may be fragile
        template = template.replace(
            '.00', '.0'
        )  ### This is required because of the peculiarities of how oLIB
        ### names things when the event lands on an integer second
        self.warning, action_required = esUtils.check4file(
            graceid,
            gdb,
            template,
            tagnames=None,
            verbose=verbose,
            regex=True,
            logTag=logger.name if verbose else None)
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : " + self.warning
            else:
                message = "no action required : " + self.warning

            ### post message
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)

        return action_required
Пример #35
0
    def omegaScanFinish(self,
                        graceid,
                        gdb,
                        verbose=False,
                        annotate=False,
                        **kwargs):
        """
        a check that OmegaScans finished
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))

        fragment = "automatic OmegaScans finished for: %s" % (", ".join(
            self.chansets))
        if not esUtils.check4log(graceid,
                                 gdb,
                                 fragment,
                                 tagnames=None,
                                 regex=False,
                                 verbose=verbose,
                                 logTag=logger.name if verbose else None):
            self.warning = "found OmegaScan start message for %s" % (", ".join(
                self.chansets))
            if verbose or annotate:
                message = "no action required : " + self.warning

                ### post message
                if verbose:
                    logger.debug(message)
                if annotate:
                    esUtils.writeGDBLog(gdb, graceid, message)

            return False  ### action_required = False

        self.warning = "could not find OmegaScan finished message for %s" % (
            ", ".join(self.chansets))
        if verbose or annotate:
            message = "action required : " + self.warning

            ### post message
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)

        return True  ### action_required = True
Пример #36
0
    def externalTriggers(self,
                         graceid,
                         gdb,
                         verbose=False,
                         annotate=False,
                         **kwargs):
        """
        a check that the external triggers search was completed.
        looks for a log message only, ignoring tagnames and files
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))

        if not esUtils.check4log(graceid,
                                 gdb,
                                 "Coincidence search complete",
                                 verbose=verbose,
                                 logTag=logger.name if verbose else
                                 None):  ### check for log message
            self.warning = "found external triggers coinc search completion message"
            if verbose or annotate:
                message = "no action required : " + self.warning

                ### post message
                if verbose:
                    logger.debug(message)
                if annotate:
                    esUtils.writeGDBLog(gdb, graceid, message)

            return False  ### action_required = False

        else:
            self.warning = "could not find external triggers search completion message"
            if verbose or annotate:
                message = "action required : " + self.warning

                ### post message
                if verbose:
                    logger.debug(message)
                if annotate:
                    esUtils.writeGDBLog(gdb, graceid, message)

            return True  ### action_required = True
Пример #37
0
    def cbcPSD(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        check for existence of psd.xml.gz file while ignoring log comments and tagnames.
        if psd.xml.gz exists, we ensure that a string representation is longer than self.psdStrLenThr via

            len(gdb.files(graceid, filename).read()) < self.psdStrLenThr)

        this hopefully ensures the PSD is not "empty" or mal-formatted, although it is a pretty loose constraint.        
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))

        filename = "psd.xml.gz"
        self.warning, action_required = esUtils.check4file(
            graceid,
            gdb,
            filename,
            tagnames=None,
            verbose=verbose,
            logTag=logger.name if verbose else None)

        #     found the file                      check it's length
        if (not action_required) and (
                len(gdb.files(graceid, filename).read()) < self.psdStrLenThr
        ):  ### found file, but need to check whether it's empty
            self.warning += ". However, the file's size seems suspiciously small."
            action_required = True

        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : " + self.warning
            else:
                message = "no action required : " + self.warning

            ### post message
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)

        return action_required
Пример #38
0
    def cWBTrigger(self,
                   graceid,
                   gdb,
                   verbose=False,
                   annotate=False,
                   **kwargs):
        """
        query GraceDB to check for proper event creation
        we check for the existence of:

            trigger_%(gpstime).4f.txt

        while ignoring log messages and tagnames
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))
            logger.debug("retrieving event details")
        event = gdb.event(graceid).json()  ### we need the gpstime, so we query

        filename = "trigger_%.4f.txt" % event[
            'gpstime']  ### NOTE: this may be fragile
        self.warning, action_required = esUtils.check4file(
            graceid,
            gdb,
            filename,
            tagnames=None,
            verbose=verbose,
            logTag=logger.name if verbose else None)
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : " + self.warning
            else:
                message = "no action required : " + self.warning

            ### post message
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)

        return action_required
Пример #39
0
    def snglFITShtml(self,
                     graceid,
                     gdb,
                     verbose=False,
                     annotate=False,
                     **kwargs):
        """
        a check that snglFITS posted an html as expected
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))

        htmlname = "%s-skymapSummary.html" % (self.fitsname.split('.fits')[0]
                                              )  ### NOTE: this may be fragile
        fragment = "skymap summary for .*%s.*can be found.*here.*" % (
            self.fitsname)  ### NOTE: this may be fragile

        self.warning, action_required = esUtils.check4file(
            graceid,
            gdb,
            htmlname,
            regex=False,
            tagnames=None,
            verbose=verbose,
            logFragment=fragment,
            logRegex=True,
            logTag=logger.name if verbose else None,
        )
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : " + self.warning
            else:
                message = "no action required : " + self.warning

            ### post message
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)

        return action_required
Пример #40
0
    def bayestarNoVirgoSkymap(self,
                              graceid,
                              gdb,
                              verbose=False,
                              annotate=False,
                              **kwargs):
        """
        a check that bayestar produced a skymap which excludes virgo
        Only checks for a skymap iff Virgo is present in the instrument list. Otherwise, ignores this event (return False)
        looks for the existence of a skymap and the correct tagnames
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))

        ### FIXME: the following might be fragile...
        if 'V1' not in gdb.event(graceid).json()['instruments'].split(','):
            if verbose or annotate:
                message = 'no action required : V1 not in list of instruments and therefore existence of bayestar_no_virgo.fits.gz is irrelevant'
                if verbose:
                    logger.debug(message)
                if annotate:
                    esUtils.writeGDBLog(gdb, graceid, message)
            return False  ### not the trigger set I was expecting

        fitsname = "bayestar_no_virgo.fits.gz"
        self.warning, action_required = esUtils.check4file(
            graceid,
            gdb,
            fitsname,
            tagnames=self.tagnames,
            verbose=verbose,
            logTag=logger.name if verbose else None)
        if verbose or annotate:
            if action_required:
                message = "action required : " + self.warning
            else:
                message = "no action required : " + self.warning
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)
        return action_required
Пример #41
0
    def multFITShtml(self,
                     graceid,
                     gdb,
                     verbose=False,
                     annotate=False,
                     **kwargs):
        """
        a check that multFITS posted an htmlas expected
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))

        htmlname = "%s-skymapComparison.html" % (
            graceid)  ### NOTE: this may be fragile
        fragment = "comparison of skymaps can be found <a href=\"(.*)\">here</a>"

        self.warning, action_required = esUtils.check4file(
            graceid,
            gdb,
            htmlname,
            regex=False,
            tagnames=None,
            verbose=verbose,
            logFragment=fragment,
            logRegex=True,
            logTag=logger.name if verbose else None,
        )
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : " + self.warning
            else:
                message = "no action required : " + self.warning

            ### post message
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)

        return action_required
Пример #42
0
    def segDB2grcDBStart(self,
                         graceid,
                         gdb,
                         verbose=False,
                         annotate=False,
                         **kwargs):
        """
        a check that segDB2grcDB started
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))

        if not esUtils.check4log(
                graceid,
                gdb,
                "began searching for segments in : ",
                verbose=verbose,
                logTag=logger.name if verbose else None):  ### check for log
            self.warning = "found segDB2grcDB starting message"
            if verbose or annotate:
                message = "no action required : " + self.warning

                ### post message
                if verbose:
                    logger.debug(message)
                if annotate:
                    esUtils.writeGDBLog(gdb, graceid, message)

            return False  ### action_required = False

        self.warning = "could not find segDB2grcDB starting message"
        if verbose or annotate:
            message = "action required : " + self.warning

            ### post message
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)

        return True  ### action_required = True
Пример #43
0
 def bayeswavePESkymap(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
     """
     a check that BayesWave PE posted a skymap
     """
     if verbose:
         logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
         logger.info( "%s : %s"%(graceid, self.description) )
     fitsname = "BayesWave.fits.gz"
     self.warning, action_required = esUtils.check4file( graceid, gdb, fitsname, tagnames=self.tagnames, verbose=verbose, logTag=logger.name if verbose else None )
     if verbose or annotate:
         if action_required:
             message = "action required : "+self.warning
         else:
             message = "no action required : "+self.warning
         if verbose:
             logger.debug( message )
         if annotate:
             esUtils.writeGDBLog( gdb, graceid, message )
     return action_required
Пример #44
0
    def segDB2grcDBFlag(self,
                        graceid,
                        gdb,
                        verbose=False,
                        annotate=False,
                        **kwargs):
        """
        a check that segDB2grcDB uploaded the expected individual flags by requiring xml.gz files to exist (with expected nomenclature)
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))

        flagname = self.flag.split(":")
        flagname = "%s-%s-(.*)-(.*).xml.gz" % (flagname[0], "_".join(
            _.replace("-", "_") for _ in flagname[1:]))
        self.warning, action_required = esUtils.check4file(
            graceid,
            gdb,
            flagname,
            regex=True,
            tagnames=None,
            verbose=verbose,
            logFragment=None,
            logRegex=False,
            logTag=logger.name if verbose else None,
        )
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : " + self.warning
            else:
                message = "no action required : " + self.warning

            ### post message
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)

        return action_required
Пример #45
0
    def unblindInjections(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that the unblind injections search was completed.
        looks for a log message only while ignoring tagnames and files
        """
        ### NOTE: we do not delegate to esUtils.check4log here because we need to look for mutliple logs...
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag )
            logger.info( "%s : %s"%(graceid, self.description) )
            logger.debug( "retrieving log messages" )
        logs = gdb.logs( graceid ).json()['log']

        if verbose:
            logger.debug( "parsing log" )

        if esUtils.check4log( graceid, gdb, "No unblind injections in window", verbose=verbose, logTag=logger.name if verbose else None ): ### check for log message
            self.warning = "process reported that no unblind injections were found"
            if verbose or annotate:
                message = "no action required : "+self.warning

                ### post message
                if verbose:
                    logger.debug( message )
                if annotate:
                    esUtils.writeGDBLog( gdb, graceid, message )

            return False ### action_required = False

        if verbose:
            logger.warn( "we do not currently know how to parse out statements when there *is* an unblind injection...raising an alarm anyway" )

        self.warning = "could not find a statement about unblind injections"
        if verbose or annotate:
            message = "action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return True ### action_required = True
Пример #46
0
 def bayestarSkymap(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
     """
     a check that bayestar produced a skymap
     looks for the existence of a skymap and the correct tagnames
     """
     if verbose:
         logger = esUtils.genTaskLogger( self.logDir, self.name, logTag=self.logTag ) 
         logger.info( "%s : %s"%(graceid, self.description) )
     fitsname = "bayestar.fits.gz"
     self.warning, action_required = esUtils.check4file( graceid, gdb, fitsname, tagnames=self.tagnames, verbose=verbose, logTag=logger.name if verbose else None )
     if verbose or annotate:
         if action_required:
             message = "action required : "+self.warning
         else:
             message = "no action required : "+self.warning
         if verbose:
             logger.debug( message )
         if annotate:
             esUtils.writeGDBLog( gdb, graceid, message )
     return action_required
Пример #47
0
    def multFITSFinish(self,
                       graceid,
                       gdb,
                       verbose=False,
                       annotate=False,
                       **kwargs):
        """
        a check that multFITS finish as expected
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))

        if not esUtils.check4log(graceid,
                                 gdb,
                                 "finished skymap comparison for .*%s.*" %
                                 (".*".join(self.fitsnames)),
                                 regex=True,
                                 verbose=verbose,
                                 logTag=logger.name if verbose else None):
            self.warning = "found multFITS finish message for %s" % (", ".join(
                self.fitsnames))
            if verbose or annotate:
                message = "no action required : " + self.warning
                if verbose:
                    logger.debug(message)
                if annotate:
                    esUtils.writeGDBLog(gdb, graceid, message)
            return False  ### action_required = False

        self.warning = "could not find multFITS finish message for %s" % (
            ", ".join(self.fitsnames))
        if verbose or annotate:
            message = "action required : " + self.warning
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)
        return True  ### action_required = True
Пример #48
0
    def approvalProcessorFAR(self, graceid, gdb, verbose=False, annotate=False, **kwargs):
        """
        a check that approvalProcessor analyzed the FAR as expected
        """
        ### note, we do not delegate to esUtils.check4log because there are multiple possible messages
        if verbose:
            logger = esUtils.genTaskLogger( self.logDir, self.name, logTag='iQ', graceid=graceid )
            logger.info( "%s : %s"%(graceid, self.description) )
            logger.debug( "retrieving log messages" )
        logs = gdb.logs( graceid ).json()['log']

        if verbose:
            logger.debug( "parsing log" )
        for log in logs: 
            comment = log['comment']
            if ("Candidate event has low enough FAR" in comment) \
              or ("Candidate event rejected due to large FAR" in comment) \
              or ("Ignoring new event because we found a hardware injection" in comment):
                self.warning = "found ApprovalProcessor FAR check message"
                if verbose or annotate:
                    message = "no action required : "+self.warning

                    ### post message
                    if verbose:
                        logger.debug( message )
                    if annotate:
                        esUtils.writeGDBLog( gdb, graceid, message )

                return False ### action_required = False

        self.warning = "could not find ApprovalProcessor FAR check message"
        if verbose or annotate:
            message = "action required : "+self.warning

            ### post message
            if verbose:
                logger.debug( message )
            if annotate:
                esUtils.writeGDBLog( gdb, graceid, message )

        return True ### action_required = True
Пример #49
0
    def omegaScanData(self,
                      graceid,
                      gdb,
                      verbose=False,
                      annotate=False,
                      **kwargs):
        """
        a check that OmegaScans uploaded data
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))

        jsonname = "%s.json" % self.chanset
        self.warning, action_required = esUtils.check4file(
            graceid,
            gdb,
            jsonname,
            regex=False,
            tagnames=None,
            verbose=verbose,
            logFragment=None,
            logRegex=False,
            logTag=logger.name if verbose else None,
        )
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : " + self.warning
            else:
                message = "no action required : " + self.warning

            ### post message
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)

        return action_required
Пример #50
0
    def segDB2grcDBAny(self,
                       graceid,
                       gdb,
                       verbose=False,
                       annotate=False,
                       **kwargs):
        """
        a check that segDB2grcDB uploaded the query for any active segments
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))

        jsonname = "allActive-(.*)-(.*).json"
        self.warning, action_required = esUtils.check4file(
            graceid,
            gdb,
            jsonname,
            regex=True,
            tagnames=None,
            verbose=verbose,
            logFragment=None,
            logRegex=False,
            logTag=logger.name if verbose else None,
        )
        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : " + self.warning
            else:
                message = "no action required : " + self.warning

            ### post message
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)

        return action_required
Пример #51
0
    def plotSkymap(self,
                   graceid,
                   gdb,
                   verbose=False,
                   annotate=False,
                   **kwargs):
        """
        a check that plotting jobs ran and tagged figures properly
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))

        figname = "%s.png" % (self.fitsname.split('.')[0]
                              )  ### NOTE: this may be fragile
        self.warning, action_required = esUtils.check4file(
            graceid,
            gdb,
            figname,
            tagnames=self.tagnames,
            verbose=verbose,
            logTag=logger.name if verbose else None,
        )  ### looK for the figure

        if verbose or annotate:
            ### format message
            if action_required:
                message = "action required : " + self.warning
            else:
                message = "no action required : " + self.warning

            ### post message
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)

        return action_required
Пример #52
0
    def snglFITSStart(self,
                      graceid,
                      gdb,
                      verbose=False,
                      annotate=False,
                      **kwargs):
        """
        a check that snglFITS started as expected
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))

        if not esUtils.check4log(
                graceid,
                gdb,
                "started skymap summary for .*%s.*" % self.fitsname,
                regex=True,
                verbose=verbose,
                logTag=logger.name if verbose else None):
            self.warning = "found snglFITS start message for %s" % self.fitsname
            if verbose or annotate:
                message = "no action required : " + self.warning
                if verbose:
                    logger.debug(message)
                if annotate:
                    esUtils.writeGDBLog(gdb, graceid, message)
            return False  ### action_required = False

        self.warning = "could not find snglFITS start message for %s" % self.fitsname
        if verbose or annotate:
            message = "action required : " + self.warning
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)
        return True  ### action_required = True
Пример #53
0
    def libPEFinish(self,
                    graceid,
                    gdb,
                    verbose=False,
                    annotate=False,
                    **kwargs):
        """
        a check that LIB PE finished
        """
        if verbose:
            logger = esUtils.genTaskLogger(self.logDir,
                                           self.name,
                                           logTag=self.logTag)
            logger.info("%s : %s" % (graceid, self.description))

        if not esUtils.check4log(graceid,
                                 gdb,
                                 "LIB Parameter estimation finished.",
                                 verbose=verbose,
                                 logTag=logger.name if verbose else None):
            self.warning = "found LIB PE completion message"
            if verbose or annotate:
                message = "no action required : " + self.warning
                if verbose:
                    logger.debug(message)
                if annotate:
                    esUtils.writeGDBLog(gdb, graceid, message)
            return False  ### action_required = False

        self.warning = "could not find LIB PE completion message"
        if verbose or annotate:
            message = "action required : " + self.warning
            if verbose:
                logger.debug(message)
            if annotate:
                esUtils.writeGDBLog(gdb, graceid, message)
        return True  ### action_required = True