Commit 0ed8a0d7 authored by Aaron Viets's avatar Aaron Viets

gstlal_compute_strain: cannot handle f_s_default = 0, so make it 0.01

parent b76bbf0f
Pipeline #80036 passed with stages
in 37 minutes and 20 seconds
......@@ -523,6 +523,10 @@ else:
print("Warning: Could not find expected fs in filters file or config file. Setting to zero.")
fs_squared_default = 0
# fs_squared_default cannot be exactly zero, as it is later the deniminator of a division
if fs_squared_default == 0:
fs_squared_default = 0.01
fs_default = numpy.sqrt(complex(fs_squared_default))
if "srcQ" in filters:
......
......@@ -80,7 +80,14 @@ filename_suffix = options.filename_suffix
ASDs = []
ratios = []
for i in range(0, len(frame_cache_list)):
ASDs.append(TimeSeries.read(frame_cache_list[i], '%s:%s' % (ifo, channel_list[i]), start = start_time, end = end_time).asd(4, 2, method = 'lal_median'))
cache = open(frame_cache_list[i], 'r').readlines()
new_cache = []
for gwf_file in cache:
gwf_file = str(gwf_file).split("localhost", 1)[1].strip()
new_cache.append(gwf_file)
data = TimeSeries.read(new_cache, '%s:%s' % (ifo, channel_list[i]), start = start_time, end = end_time)
ASDs.append(data.asd(16, 8, method = 'lal_median'))
#ASDs.append(TimeSeries.read(frame_cache_list[i], '%s:%s' % (ifo, channel_list[i]), start = start_time, end = end_time).asd(4, 2, method = 'lal_median'))
if i > 0:
ratios.append(ASDs[i] / ASDs[0])
......
......@@ -202,7 +202,8 @@ for i in range(0, len(freq_list)):
# Make plots
plt.figure(figsize = (10, 10))
plt.subplot(211)
plt.plot(times, magnitudes[0], colors[0], linestyle = 'None', marker = '.', markersize = markersize, label = r'${\rm %0.1f \ Hz} \ [\mu = %0.4f, \sigma = %0.4f]$' % (freq_list[i][0], numpy.mean(magnitudes[0]), numpy.std(magnitudes[0])))
#plt.plot(times, magnitudes[0], colors[0], linestyle = 'None', marker = '.', markersize = markersize, label = r'${\rm %0.1f \ Hz} \ [\mu = %0.4f, \sigma = %0.4f]$' % (freq_list[i][0], numpy.mean(magnitudes[0]), numpy.std(magnitudes[0])))
plt.plot(times, magnitudes[0], colors[0], linestyle = 'None', marker = '.', markersize = markersize, label = r'${\rm %0.1f \ Hz}$' % (freq_list[i][0]))
#plt.title(options.plot_titles.split(';')[i])
plt.ylabel(r'${\rm Magnitude}$')
magnitude_range = options.magnitude_ranges.split(';')[i]
......@@ -211,7 +212,8 @@ for i in range(0, len(freq_list)):
leg = plt.legend(fancybox = True, markerscale = 8.0 / markersize, numpoints = 3)
leg.get_frame().set_alpha(0.8)
plt.subplot(212)
plt.plot(times, phases[0], colors[0], linestyle = 'None', marker = '.', markersize = markersize, label = r'${\rm %0.1f \ Hz} \ [\mu = %0.1f^{\circ}, \sigma = %0.1f^{\circ}]$' % (freq_list[i][0], numpy.mean(phases[0]), numpy.std(phases[0])))
plt.plot(times, phases[0], colors[0], linestyle = 'None', marker = '.', markersize = markersize, label = r'${\rm %0.1f \ Hz}$' % (freq_list[i][0]))
#plt.plot(times, phases[0], colors[0], linestyle = 'None', marker = '.', markersize = markersize, label = r'${\rm %0.1f \ Hz} \ [\mu = %0.1f^{\circ}, \sigma = %0.1f^{\circ}]$' % (freq_list[i][0], numpy.mean(phases[0]), numpy.std(phases[0])))
plt.ylabel(r'${\rm Phase \ [deg]}$')
plt.xlabel(r'${\rm Time \ in \ %s \ since \ %s \ UTC}$' % (t_unit, time.strftime("%b %d %Y %H:%M:%S".replace(':', '{:}').replace('-', '\mbox{-}').replace(' ', '\ '), time.gmtime(t_start + 315964782))))
phase_range = options.phase_ranges.split(';')[i]
......@@ -227,11 +229,13 @@ for i in range(0, len(freq_list)):
magnitudes[j].append(data[(filter_time + average_time) * k][1])
phases[j].append(data[(filter_time + average_time) * k][2])
plt.subplot(211)
plt.plot(times, magnitudes[j], colors[j], linestyle = 'None', marker = '.', markersize = markersize, label = r'${\rm %0.1f \ Hz} \ [\mu = %0.4f, \sigma = %0.4f]$' % (freq_list[i][j], numpy.mean(magnitudes[j]), numpy.std(magnitudes[j])))
plt.plot(times, magnitudes[j], colors[j], linestyle = 'None', marker = '.', markersize = markersize, label = r'${\rm %0.1f \ Hz}$' % (freq_list[i][j]))
#plt.plot(times, magnitudes[j], colors[j], linestyle = 'None', marker = '.', markersize = markersize, label = r'${\rm %0.1f \ Hz} \ [\mu = %0.4f, \sigma = %0.4f]$' % (freq_list[i][j], numpy.mean(magnitudes[j]), numpy.std(magnitudes[j])))
leg = plt.legend(fancybox = True, markerscale = 8.0 / markersize, numpoints = 3)
leg.get_frame().set_alpha(0.8)
plt.subplot(212)
plt.plot(times, phases[j], colors[j], linestyle = 'None', marker = '.', markersize = markersize, label = r'${\rm %0.1f \ Hz} \ [\mu = %0.1f^{\circ}, \sigma = %0.1f^{\circ}]$' % (freq_list[i][j], numpy.mean(phases[j]), numpy.std(phases[j])))
#plt.plot(times, phases[j], colors[j], linestyle = 'None', marker = '.', markersize = markersize, label = r'${\rm %0.1f \ Hz} \ [\mu = %0.1f^{\circ}, \sigma = %0.1f^{\circ}]$' % (freq_list[i][j], numpy.mean(phases[j]), numpy.std(phases[j])))
plt.plot(times, phases[j], colors[j], linestyle = 'None', marker = '.', markersize = markersize, label = r'${\rm %0.1f \ Hz}$' % (freq_list[i][j]))
leg = plt.legend(fancybox = True, markerscale = 8.0 / markersize, numpoints = 3)
leg.get_frame().set_alpha(0.8)
plt.savefig('%s_%d-%d.png' % (options.plot_titles.split(';')[i].replace(' ', '_'), int(t_start), int(dur)))
......
......@@ -165,6 +165,7 @@ channel_list.append("CAL-CS_TDEP_PCALX_LINE3_COMPARISON_OSC_FREQ")
channel_list.append("CAL-CS_TDEP_PCAL_LINE4_COMPARISON_OSC_FREQ")
channel_list.append("CAL-CS_TDEP_PCALY_LINE4_COMPARISON_OSC_FREQ")
channel_list.append("CAL-CS_TDEP_PCALX_LINE4_COMPARISON_OSC_FREQ")
channel_list.append("CAL-PCALX_PCALOSC1_OSC_FREQ")
channel_list.append("PEM-EY_MAINSMON_EBAY_1_DQ")
channel_list.append("PEM-EY_MAINSMON_EBAY_2_DQ")
channel_list.append("PEM-EY_MAINSMON_EBAY_3_DQ")
......
......@@ -294,7 +294,7 @@ if options.poles is not None:
for i in range(0, len(real_poles) / 2):
poles.append(float(real_poles[2 * i]) + 1j * float(real_poles[2 * i + 1]))
colors = ['blue', 'limegreen', 'y', 'c', 'm', 'b'] # Hopefully the user will not want to plot more than six datasets on one plot.
colors = ['blue', 'limegreen', 'maroon', 'orchid', 'red', 'b'] # Hopefully the user will not want to plot more than six datasets on one plot.
for i in range(0, len(labels)):
# Remove unwanted lines from file, and re-format wanted lines
f = open('%s_%s_over_%s_%d-%d.txt' % (ifo, labels[i].replace(' ', '_').replace('/', 'over'), options.denominator_channel_name, options.gps_start_time, data_duration),"r")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment