Skip to content
Snippets Groups Projects
Commit aa3ad0b9 authored by Grant David Meadors's avatar Grant David Meadors
Browse files

Added a nice python plotter to display the ratio of before and after SNR...

Added a nice python plotter to display the ratio of before and after SNR calculated by Ian Harry from iHope CBC data
parent 15b77aa9
Branches
No related tags found
No related merge requests found
#!/usr/bin/python
import os, re, sys
import matplotlib as matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
# Generate scatterplots of the AMPS and LDAS SNR
# Using the data set of recovered iHope S6 hardware
# Injections generated by Ian Harry
# Description of methods:
# https://www.lsc-group.phys.uwm.edu/ligovirgo/cbcnote/S6Plan/130422155409DQandVetoesHWInjs_in_AMPS_data
# Location of files on the CIT cluster:
# /home/spxiwh/S6/AMPS-STRAIN/hardware_inj_test/dump_snr/[H,L]1-HWINJS_WITH_SNR.dat
# 02013-05-15 (JD 2456428)
# Grant David Meadors
# g m e a d o r s @ u m i c h . e d u
def scatterplotter(observatory):
print 'Plotting SNR scatterplot for this observatory:'
print observatory
# Assume that the file is in the local directory:
# Since this is S6 data, the detector will be number 1,
# Either H1 or L1
SNRfile = observatory + '1-HWINJS_WITH_SNR.dat'
LDAS, AMPS = np.loadtxt(SNRfile, delimiter = ' ', usecols=(0, 1), unpack=True)
plt.figure()
p1 = plt.scatter(LDAS, AMPS)
plt.grid(True)
plt.xlabel('SNR before feedforward (LDAS)')
plt.ylabel('SNR after feedforward (AMPS)')
plt.title('iHope SNR after vs before feedforward')
plt.savefig('AMPSplotSNR.png')
plt.savefig('AMPSplotSNR.pdf')
plt.close()
plt.figure()
p2 = plt.scatter(LDAS, (AMPS-LDAS)/LDAS)
plt.grid(True)
plt.xlabel('SNR before feedforward (LDAS)')
plt.ylabel('SNR ratio: (AMPS-LDAS)/LDAS')
plt.title('iHope SNR (after-before)/before feedforward')
plt.savefig('AMPSratioSNR.png')
plt.savefig('AMPSratioSNR.pdf')
plt.close()
scatterplotter(sys.argv[1])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment