Пример #1
0
        X.append(
            test_common.complex_test_src(pipeline,
                                         buffer_length=buffer_length,
                                         rate=rate_in,
                                         width=64,
                                         test_duration=test_duration,
                                         wave=5,
                                         freq=0,
                                         src_suffix=str(i)))
    kappas = calibration_parts.compute_exact_kappas_from_filters_file(
        pipeline, X, freqs, EPICS, rate_in)
    for i in range(4 + 2 * num_stages):
        pipeparts.mknxydumpsink(pipeline, kappas[i], "kappas_%d.txt" % i)

    #
    # done
    #

    return pipeline


#
# =============================================================================
#
#				     Main
#
# =============================================================================
#

test_common.build_and_run(exact_kappas_01, "exact_kappas_01")
    #

    return pipeline


#
# =============================================================================
#
#				     Main
#
# =============================================================================
#

test_common.build_and_run(
    pcal2darm,
    "pcal2darm",
    segment=segments.segment(
        (LIGOTimeGPS(0, 1000000000 * options.gps_start_time),
         LIGOTimeGPS(0, 1000000000 * options.gps_end_time))))

# Read data from files and plot it
colors = [
    'mediumblue', 'gold', 'c', 'b', 'm'
]  # Hopefully the user will not want to plot more than six datasets on one plot.
tau_colors = ['red', 'skyblue', 'purple']
channels = calcs_channels
channels.extend(gstlal_channels)
num_rows = 2 + (1 if any(kappa_channels) else 0)
num_columns = len(frequencies)

plot_labels = []
if options.latex_labels:
Пример #3
0
                                             compression_scheme=6,
                                             compression_level=3)
        mux = pipeparts.mkprogressreport(pipeline, mux, "end")
        pipeparts.mkframecppfilesink(pipeline,
                                     mux,
                                     frame_type=frame_type,
                                     path=output_path,
                                     instrument=ifo)

    #
    # done
    #

    return pipeline


#
# =============================================================================
#
#				     Main
#
# =============================================================================
#

test_common.build_and_run(
    frame_manipulator,
    "frame_manipulator",
    segment=segments.segment(
        (LIGOTimeGPS(0, 1000000000 * options.gps_start_time),
         LIGOTimeGPS(0, 1000000000 * options.gps_end_time))))
Пример #4
0
	# done
	#

	return pipeline

#
# =============================================================================
#
#				     Main
#
# =============================================================================
#


# Run pipeline
test_common.build_and_run(compute_RMS_timeseries, "compute_RMS_timeseries", segment = segments.segment((LIGOTimeGPS(0, 1000000000 * gps_start_time), LIGOTimeGPS(0, 1000000000 * gps_end_time))))

colors = ['blue', 'limegreen', "royalblue", "deepskyblue", "red", "yellow", "purple", "pink"]

# Read data from txt file.
rms_data = []
tdata = []
for i in range(0, len(labels)):
	data = numpy.loadtxt('%s_RMS_%s_%d-%d.txt' % (ifo, labels[i].replace(' ', '_'), gps_start_time, data_duration))
	if not any(tdata):
		t_start = data[0][0]
		dur = data[len(data) - 1][0] - t_start
		dur_in_seconds = dur
		t_unit = 'seconds'
		sec_per_t_unit = 1.0
		if dur > 60 * 60 * 100:
Пример #5
0
                                buffer_length=buffer_length,
                                rate=rate_in,
                                width=64,
                                channels=channels,
                                test_duration=test_duration,
                                wave=5,
                                freq=0)
    streams = calibration_parts.mkdeinterleave(pipeline, head, channels)
    head = calibration_parts.mkinterleave(pipeline, streams)
    solutions = pipeparts.mkgeneric(pipeline, head, "lal_matrixsolver")
    solutions = list(calibration_parts.mkdeinterleave(pipeline, solutions, 10))
    for i in range(10):
        pipeparts.mknxydumpsink(pipeline, solutions[i], "solutions_%d.txt" % i)

    #
    # done
    #

    return pipeline


#
# =============================================================================
#
#				     Main
#
# =============================================================================
#

test_common.build_and_run(lal_matrixsolver_01, "lal_matrixsolver_01")
Пример #6
0
                                                   f_max=500)
    rms_bp400to500 = calibration_parts.compute_rms(pipeline,
                                                   white_noise_bp400to500,
                                                   1024,
                                                   1.0,
                                                   f_min=100,
                                                   f_max=500)
    pipeparts.mknxydumpsink(pipeline, rms, "rms.txt")
    pipeparts.mknxydumpsink(pipeline, rms_over10, "rms_over10.txt")
    pipeparts.mknxydumpsink(pipeline, rms_bp100to150, "rms_bp100to150.txt")
    pipeparts.mknxydumpsink(pipeline, rms_bp250to300, "rms_bp250to300.txt")
    pipeparts.mknxydumpsink(pipeline, rms_bp450to500, "rms_bp450to500.txt")
    pipeparts.mknxydumpsink(pipeline, rms_bp400to500, "rms_bp400to500.txt")

    #
    # done
    #

    return pipeline


#
# =============================================================================
#
#				     Main
#
# =============================================================================
#

test_common.build_and_run(rms_01, "rms_01")
Пример #7
0
    return pipeline


#
# =============================================================================
#
#				     Main
#
# =============================================================================
#

# Run pipeline
test_common.build_and_run(
    plot_transfer_function,
    "plot_transfer_function",
    segment=segments.segment(
        (LIGOTimeGPS(0, 1000000000 * options.gps_start_time),
         LIGOTimeGPS(0, 1000000000 * options.gps_end_time))))

# Get any zeros and poles that we want to use to filter the transfer functions
zeros = []
real_zeros = [''] if options.zeros is None else options.zeros.split(';')
if len(real_zeros) < len(labels):
    # Then copy the last element until they are the same length
    for i in range(len(labels) - len(real_zeros)):
        real_zeros.append(real_zeros[-1])
for i in range(len(real_zeros)):
    real_zeros[i] = real_zeros[i].split(',')
    zeros.append([])
    for j in range(0, len(real_zeros[i]) // 2):
        zeros[i].append(
    # your calculations.  You will also need to demodulate the Pcal channel at f1.  And
    # you will have to do several more demodulations (10 total I think, since each of
    # the five lines is present in darm_err and in one injection channel).  Then, you
    # will need to do additions, multiplications, divisions, powers, etc.  I would
    # suggest looking in gstlal_compute_strain (the calibration pipeline) and
    # calibration_parts.py for examples of how to do these.  calibration_parts has lots
    # of functions that should be helpful.

    #
    # done
    #

    return pipeline


#
# =============================================================================
#
#				     Main
#
# =============================================================================
#

# This function calls the above pipeline function to build and run the pipeline.
test_common.build_and_run(
    gstlal_compute_kappas_without_D,
    "gstlal_compute_kappas_without_D",
    segment=segments.segment(
        (LIGOTimeGPS(0, 1000000000 * options.gps_start_time),
         LIGOTimeGPS(0, 1000000000 * options.gps_end_time))))
Пример #9
0
    return pipeline


#
# =============================================================================
#
#				     Main
#
# =============================================================================
#

# Run pipeline
test_common.build_and_run(
    demod_ratio,
    "demod_ratio",
    segment=segments.segment(
        (LIGOTimeGPS(0, 1000000000 * options.gps_start_time),
         LIGOTimeGPS(0, 1000000000 * options.gps_end_time))))

# Read data from files and plot it
colors = [
    'blueviolet', 'darkgreen', 'limegreen', 'khaki', 'b', 'r'
]  # Hopefully the user will not want to plot more than six datasets on one plot.
for i in range(0, len(freq_list)):
    data = numpy.loadtxt("%s_%s_over_%s_%0.1fHz.txt" %
                         (ifo, options.numerator_channel_name,
                          options.denominator_channel_name, freq_list[i][0]))
    t_start = data[0][0]
    dur = data[len(data) - 1][0] - t_start
    t_unit = 'seconds'
    sec_per_t_unit = 1.0
Пример #10
0
    #smooth = pipeparts.mkgeneric(pipeline, head, "lal_smoothkappas", array_size = rate * 128, avg_array_size = rate * 10, filter_latency = 1)
    #smooth = pipeparts.mkgeneric(pipeline, smooth, "splitcounter", name = "smooth")
    #head = pipeparts.mkgeneric(pipeline, head, "splitcounter", name = "unsmooth")
    #channelmux_input_dict = {}
    #channelmux_input_dict["unsmooth"] = calibration_parts.mkqueue(pipeline, head)
    #channelmux_input_dict["smooth"] = calibration_parts.mkqueue(pipeline, smooth)
    #mux = pipeparts.mkframecppchannelmux(pipeline, channelmux_input_dict, frame_duration = 64, frames_per_file = 1, compression_scheme = 6, compression_level = 3)
    head = calibration_parts.mkadder(
        pipeline, calibration_parts.list_srcs(pipeline, head, smooth))
    #mux = pipeparts.mkgeneric(pipeline, mux, "splitcounter", name = "sum")
    #head = calibration_parts.mkgate(pipeline, smooth, head, 0)
    pipeparts.mknxydumpsink(pipeline, head, "%s_out.txt" % name)
    #pipeparts.mkframecppfilesink(pipeline, mux, frame_type = "H1DCS", instrument = "H1")

    #
    # done
    #

    return pipeline


#
# =============================================================================
#
#				     Main
#
# =============================================================================
#

test_common.build_and_run(fill_silence_test_01, "fill_silence_test_01")
Пример #11
0
        pipeline,
        summed_streams,
        "lal_detectchange",
        average_samples=int(options.average_time * options.sample_rate),
        detection_threshold=options.detection_threshold,
        filename=options.filename)
    pipeparts.mkfakesink(pipeline, summed_streams)

    #
    # done
    #

    return pipeline


#
# =============================================================================
#
#				     Main
#
# =============================================================================
#

# Run pipeline
test_common.build_and_run(
    detect_change,
    "detect_change",
    segment=segments.segment(
        (LIGOTimeGPS(0, 1000000000 * options.gps_start_time),
         LIGOTimeGPS(0, 1000000000 * options.gps_end_time))))
#
# =============================================================================
#
#				     Main
#
# =============================================================================
#

line_seps = []
signal_rmss = []
for i in range(0, 1000):
    line_sep = random.random()
    line_seps.append(line_sep)
    test_common.build_and_run(line_separation_nonoise_test_01,
                              "line_separation_nonoise_test_01",
                              line_sep=line_sep)
    data = numpy.loadtxt("rms_signal_nonoise.txt")
    signal_rmss.append(data[-1][1])
plt.figure(figsize=(10, 10))
plt.plot(line_seps,
         signal_rmss,
         'g.',
         markersize=5,
         label='line with no noise')
leg = plt.legend(fancybox=True)
leg.get_frame().set_alpha(0.5)
plt.gca().set_xscale('linear')
plt.gca().set_yscale('log')
plt.title('Cross-contamination of Lines')
plt.ylabel('RMS of demodulated line')