Beispiel #1
0
def test_gps_time_now(_):
    assert gpstime.gps_time_now() == 100.
Beispiel #2
0
    ### figure out bounds for the query
    start = int(gpstime - config.getfloat(flag, 'look_left'))
    end = gpstime + config.getfloat(flag, 'look_right')
    if end % 1:
        end = int(end) + 1
    else:
        end = int(end)
    dur = end - start

    ### set environment for this query
    dmt = config.has_option(flag, 'dmt')
    if dmt:
        os.environ['ONLINEDQ'] = config.get(flag, 'dmt')

    ### wait until data becomes available
    wait = end + config.getfloat(flag, 'wait') - lal_gpstime.gps_time_now()
    if wait > 0:
        if opts.verbose:
            print "        waiting %.3f sec" % (wait)
        time.sleep(wait)

    ### actually perform the query
    outfilename = flag2filename(flag, start, dur, output_dir)
    cmd = segDBcmd(segdb_url, flag, start, end, outfilename, dmt=dmt)
    if opts.verbose:
        print "        %s" % cmd
    proc = sp.Popen(cmd.split(), stdout=sp.PIPE, stderr=sp.PIPE)
    output = proc.communicate()

    ### check returncode for errors
    if proc.returncode:  ### something went wrong with the query!
	ldr_type = config.get("ligo_data_find", "type")

#========================

### pull out sciseg params
sciseg_channel = config.get("scisegs","channel")
sciseg_bitmask = config.getint("scisegs","bitmask")

print "\n\n\tWARNING: will need to provide functionality to read off multiple bit masks?\n"

#=================================================

### setting up initial time
report("", opts.verbose)
if opts.gps_start == None:
	t = ( int(gpstime.gps_time_now()) /stride)*stride
else:
	t = (opts.gps_start/stride)*stride ### round to integer number of strides

if stream:
	streamfile = "%s/segments/%s_current.seg"%(outputdir, ifo)
	report("writing streaming segment information into : %s"%streamfile, opts.verbose)
	streamfile_obj = open(streamfile, "a")


	print "\n\nWARNING: need to parse the existing streamfile to see if we need to pick up where we left off?\n"

	gpsstop = None

#=================================================
# LOOP until we "finish"
Beispiel #4
0
    ### figure out bounds for the query
    start = int(gpstime-config.getfloat(flag, 'look_left'))
    end = gpstime+config.getfloat(flag, 'look_right')
    if end%1:
        end = int(end) + 1
    else:
        end = int(end)
    dur = end-start

    ### set environment for this query
    dmt = config.has_option(flag, 'dmt')
    if dmt:
        os.environ['ONLINEDQ'] = config.get(flag, 'dmt')

    ### wait until data becomes available
    wait = end + config.getfloat(flag, 'wait') - lal_gpstime.gps_time_now()
    if wait > 0:
        if opts.verbose:
            print "        waiting %.3f sec"%(wait)
        time.sleep( wait )

    ### actually perform the query
    outfilename = flag2filename( flag, start, dur, output_dir)
    cmd = segDBcmd( segdb_url, flag, start, end, outfilename, dmt=dmt )
    if opts.verbose:
        print "        %s"%cmd
    proc = sp.Popen( cmd.split(), stdout=sp.PIPE, stderr=sp.PIPE )
    output = proc.communicate()

    ### check returncode for errors
    if proc.returncode: ### something went wrong with the query!