logger.info("Started searching for iDQ information within [%.3f, %.3f] at %s" %
            (gps_start, gps_end, ifo))
if not options.skip_gracedb_upload:
    gracedb.writeLog(
        gdb_id,
        message=
        "Started searching for iDQ information within [%.3f, %.3f] at %s" %
        (gps_start, gps_end, ifo),
        tagname=idq.tagnames)

#=================================================
# LOGIC for waiting for idq data
#=================================================
### figure out if we need to wait for time to pass
wait = gps_end - (idq.nowgps() + delay)
if wait > 0:
    logger.info("waiting %.2f seconds until we pass gps=%.3f" %
                (wait, gps_end))
    time.sleep(wait)

if options.realtime_log:
    ### now we need to parse the realtime log to figure out where the realtime job is
    logger.info("parsing %s to extract idq-realtime state" %
                options.realtime_log)

    realtime_log = open(options.realtime_log,
                        "r")  ### open realtime log for reading
    realtime_log.seek(0, 2)  ### go to end of file

    ### wait until realtime has passed gps_end+delay
    ### unset ligo-proxy just in case
    if os.environ.has_key("X509_USER_PROXY"):
        del os.environ['X509_USER_PROXY']

    ### get cert and key from ini file
    robot_cert = config.get('ldg_certificate', 'robot_certificate')
    robot_key = config.get('ldg_certificate', 'robot_key')

    ### set cert and key
    os.environ['X509_USER_CERT'] = robot_cert
    os.environ['X509_USER_KEY'] = robot_key

#=================================================
### current time and boundaries

t = int(idq.nowgps())
if not opts.gps_stop: ### stop time of this analysis
    print 'computing gpsstop from current time'
    gpsstop = (t - delay) / stride * stride  # require boundaries to be integer multiples of stride
else:
    gpsstop = opts.gps_stop / stride * stride
#print 'gpsstop = %d' % gpsstop

if not opts.gps_start:
    print 'computing gpsstart from gpsstop'
    gpsstart = gpsstop - stride
else:
    gpsstart = opts.gps_start / stride * stride # require boundaries to be integer mutliples of stride
#print 'gpsstart = %d' % gpsstart

#===================================================================================================
Beispiel #3
0
    ### unset ligo-proxy just in case
    if os.environ.has_key("X509_USER_PROXY"):
        del os.environ['X509_USER_PROXY']

    ### get cert and key from ini file
    robot_cert = config.get('ldg_certificate', 'robot_certificate')
    robot_key = config.get('ldg_certificate', 'robot_key')

    ### set cert and key
    os.environ['X509_USER_CERT'] = robot_cert
    os.environ['X509_USER_KEY'] = robot_key

#==================================================
### current time and boundaries

t = int(idq.nowgps())

gpsstop = opts.gpsstop
if not gpsstop:  ### stop time of this analysis
    logger.info('computing gpsstop from current time')
    gpsstop = t  ### We do not require boundaries to be integer multiples of stride

gpsstart = opts.gpsstart
if not gpsstart:
    logger.info('computing gpsstart from gpsstop')
    gpsstart = gpsstop - stride

#===================================================================================================
#
# LOOP
#
    ### set cert and key
    os.environ['X509_USER_CERT'] = robot_cert
    os.environ['X509_USER_KEY'] = robot_key

#=================================================
### data storage during training jobs

### create condorlogs directory if needed
condorlogs = config.get('train', 'condorlogs')
if not os.path.exists(condorlogs):
    os.makedirs(condorlogs)

#==================================================
### current time and boundaries

t = int(idq.nowgps())

gpsstop = opts.gpsstop
if not gpsstop: ### stop time of this analysis
    logger.info('computing gpsstop from current time')
    gpsstop = t ### We do not require boundaries to be integer multiples of stride

gpsstart = opts.gpsstart
if not gpsstart:
    logger.info('computing gpsstart from gpsstop')
    gpsstart = gpsstop - stride

#===================================================================================================
#
# LOOP
#
#
# EVALUATION
#
#===================================================================================================

for gps in sorted(opts.gps):
    print '----------------------------------------------------'
    print 'beginning analysis for %.6f' % gps

    t = int(gps - (gps % stride))

    gps_start = int(gps - padding)
    gps_padd = gps_start + twopadding

    ### make sure end time of analysis time is not ahead of now-delay
    wait = opts.gps + delay - int(idq.nowgps())
    if wait > 0:
        print 'waiting %.1f seconds before processing' % wait
        time.sleep(wait)

    #====================
    # science segments
    #====================
    if opts.use_science_segments:
        print 'querrying science segments'

        ### get DMT xml segments from disk
        ### logic about waiting and re-trying is built into retrieve_scisegs
        good, covered = idq.retrieve_scisegs(dmt_segments_location,
                                             dmtdq_name,
                                             gps_start,
    ### set cert and key
    os.environ['X509_USER_CERT'] = robot_cert
    os.environ['X509_USER_KEY'] = robot_key

#=================================================
### data storage during training jobs

### create condorlogs directory if needed
condorlogs = config.get('train', 'condorlogs')
if not os.path.exists(condorlogs):
    os.makedirs(condorlogs)

#==================================================
### current time and boundaries

t = int(idq.nowgps())

gpsstop = opts.gpsstop
if not gpsstop:  ### stop time of this analysis
    logger.info('computing gpsstop from current time')
    gpsstop = t  ### We do not require boundaries to be integer multiples of stride

gpsstart = opts.gpsstart
if not gpsstart:
    logger.info('computing gpsstart from gpsstop')
    gpsstart = gpsstop - stride

#===================================================================================================
#
# LOOP
#
Beispiel #7
0
    ### unset ligo-proxy just in case
    if os.environ.has_key("X509_USER_PROXY"):
        del os.environ['X509_USER_PROXY']

    ### get cert and key from ini file
    robot_cert = config.get('ldg_certificate', 'robot_certificate')
    robot_key = config.get('ldg_certificate', 'robot_key')

    ### set cert and key
    os.environ['X509_USER_CERT'] = robot_cert
    os.environ['X509_USER_KEY'] = robot_key

#==================================================
### current time and boundaries

t = int(idq.nowgps())

gpsstop = opts.gpsstop
if not gpsstop:  ### stop time of this analysis
    logger.info('computing gpsstop from current time')
    gpsstop = t  ### We do not require boundaries to be integer multiples of stride

gpsstart = opts.gpsstart
if not gpsstart:
    logger.info('computing gpsstart from gpsstop')
    gpsstart = gpsstop - stride

#===================================================================================================
#
# LOOP
#
#
# EVALUATION
#
#===================================================================================================

for gps in sorted(opts.gps):
    print '----------------------------------------------------'
    print 'beginning analysis for %.6f' % gps

    t = int(gps - (gps%stride))

    gps_start = int(gps-padding)
    gps_padd = gps_start + twopadding

    ### make sure end time of analysis time is not ahead of now-delay
    wait = opts.gps + delay - int(idq.nowgps())
    if wait > 0:
        print 'waiting %.1f seconds before processing' % wait
        time.sleep(wait)

    #====================
    # science segments
    #====================
    if opts.use_science_segments:
        print 'querrying science segments'

        ### get DMT xml segments from disk
        ### logic about waiting and re-trying is built into retrieve_scisegs
        good, covered = idq.retrieve_scisegs(dmt_segments_location, dmtdq_name, gps_start, twopadding, pad=0, sleep=delay, nretry=1, logger=logger)

        if event.livetime(covered) < twopadding:
# column headings for datfile output

samples_header = config.get('idq_realtime', 'dat_columns').split()

# ===================================================================================================
#
#                                             MAIN
#
# ===================================================================================================

print '----------------------------------------------------'
print 'beginning analysis for %.6f' % opts.gps

# make sure end time of analysis time is not ahead of now-delay

wait = opts.gps + delay - int(idq.nowgps())
if wait > 0:
    print 'waiting %.1f seconds before processing' % wait
    time.sleep(wait)

# =================================================
#
# finding KW.trg files
#
# =================================================

padding = max(float(myconf['padding']),
              float(config.get('build_auxmvc_vectors', 'time-window')))

kwdirname = '%s/%s/' % (config.get('general', 'gdsdir'), kwbasename)
kwfilenames = idq.get_all_files_in_range(kwdirname, opts.gps - padding,
    ### set cert and key
    os.environ['X509_USER_CERT'] = robot_cert
    os.environ['X509_USER_KEY'] = robot_key

#=================================================
### data storage during training jobs

### create condorlogs directory if needed
condorlogs = config.get('train', 'condorlogs')
if not os.path.exists(condorlogs):
    os.makedirs(condorlogs)

#==================================================
### current time and boundaries

t = int(idq.nowgps())

gpsstop = opts.gpsstop
if not gpsstop: ### stop time of this analysis
    logger.info('computing gpsstop from current time')
    gpsstop = t ### We do not require boundaries to be integer multiples of stride

gpsstart = opts.gpsstart
if not gpsstart:
    logger.info('computing gpsstart from gpsstop')
    gpsstart = gpsstop - stride

#===================================================================================================
#
# LOOP
#
plotting_gps_start = event_gps_time - plotting_time_before
plotting_gps_end = event_gps_time + plotting_time_after

performance_gps_start = event_gps_time - performance_time_before
performance_gps_end = event_gps_time + performance_time_after

logger.info("Started searching for iDQ information within [%.3f, %.3f] at %s"%(gps_start, gps_end, ifo))
if not options.skip_gracedb_upload:
    gracedb.writeLog(gdb_id, message="Started searching for iDQ information within [%.3f, %.3f] at %s"%(gps_start, gps_end, ifo))

#=================================================
# LOGIC for waiting for idq data 
#=================================================
### figure out if we need to wait for time to pass
wait = gps_end - (idq.nowgps()+delay)
if wait > 0:
    logger.info("waiting %.2f seconds until we pass gps=%.3f"%(wait, gps_end))
    time.sleep(wait)

if options.realtime_log:
    ### now we need to parse the realtime log to figure out where the realtime job is
    logger.info("parsing %s to extract idq-realtime state"%options.realtime_log)

    realtime_log = open(options.realtime_log, "r") ### open realtime log for reading
    realtime_log.seek(0, 2) ### go to end of file

    ### wait until realtime has passed gps_end+delay
    past, dead, timed_out = idq.block_until(gps_end, realtime_log, max_wait=max_wait, timeout=2*max_wait)

    if past:
Beispiel #12
0
    ### set cert and key
    os.environ['X509_USER_CERT'] = robot_cert
    os.environ['X509_USER_KEY'] = robot_key

#=================================================
### data storage during training jobs

### create condorlogs directory if needed
condorlogs = config.get('train', 'condorlogs')
if not os.path.exists(condorlogs):
    os.makedirs(condorlogs)

#==================================================
### current time and boundaries

t = int(idq.nowgps())

gpsstop = opts.gpsstop
if not gpsstop: ### stop time of this analysis
    logger.info('computing gpsstop from current time')
    gpsstop = t ### We do not require boundaries to be integer multiples of stride

gpsstart = opts.gpsstart
if not gpsstart:
    logger.info('computing gpsstart from gpsstop')
    gpsstart = gpsstop - stride

#===================================================================================================
#
# LOOP
#
    ### unset ligo-proxy just in case
    if os.environ.has_key("X509_USER_PROXY"):
        del os.environ['X509_USER_PROXY']

    ### get cert and key from ini file
    robot_cert = config.get('ldg_certificate', 'robot_certificate')
    robot_key = config.get('ldg_certificate', 'robot_key')

    ### set cert and key
    os.environ['X509_USER_CERT'] = robot_cert
    os.environ['X509_USER_KEY'] = robot_key

#==================================================
### current time and boundaries

t = int(idq.nowgps())

gpsstop = opts.gpsstop
if not gpsstop: ### stop time of this analysis
    logger.info('computing gpsstop from current time')
    gpsstop = t ### We do not require boundaries to be integer multiples of stride

gpsstart = opts.gpsstart
if not gpsstart:
    logger.info('computing gpsstart from gpsstop')
    gpsstart = gpsstop - stride

#===================================================================================================
#
# LOOP
#