Commit 36911fa4 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Adds macros for NoiseOnly study and forgotten files

parent 300ad290
. /home/gregory.ashton/lalsuite-install/etc/
export PATH="/home/gregory.ashton/anaconda2/bin:$PATH"
export MPLCONFIGDIR=/home/gregory.ashton/.config/matplotlib
for ((n=0;n<90;n++))
/home/gregory.ashton/anaconda2/bin/python "$1" /local/user/gregory.ashton --no-template-counting --no-interactive
cp /local/user/gregory.ashton/NoiseOnlyMCResults_"$1".txt $(pwd)/CollectedOutput
...@@ -38,3 +38,7 @@ ax.set_xlabel('$\widetilde{2\mathcal{F}}$') ...@@ -38,3 +38,7 @@ ax.set_xlabel('$\widetilde{2\mathcal{F}}$')
ax.set_xlim(0, 60) ax.set_xlim(0, 60)
fig.tight_layout() fig.tight_layout()
fig.savefig('allsky_noise_twoF_histogram.png') fig.savefig('allsky_noise_twoF_histogram.png')
from latex_macro_generator import write_to_macro
write_to_macro('AllSkyMCNoiseOnlyMaximum', '{:1.1f}'.format(np.max(df.twoF)),
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import os
from tqdm import tqdm
from oct2py import octave
import glob
filenames = glob.glob("CollectedOutput/*.txt")'paper')
Tspan = 100 * 86400
def maxtwoFinNoise(twoF, Ntrials):
F = twoF/2.0
alpha = (1 + F)*np.exp(-F)
a = Ntrials/2.0*F*np.exp(-F)
b = (1 - alpha)**(Ntrials-1)
return a*b
df_list = []
for fn in filenames:
df = pd.read_csv(
fn, sep=' ', names=['dF0', 'dF1', 'twoF', 'runTime'])
df['CLUSTER_ID'] = fn.split('_')[1]
df = pd.concat(df_list)
print 'Number of samples = ', len(df)
fig, ax = plt.subplots()
ax.hist(df.twoF, bins=50, histtype='step', color='k', normed=True, linewidth=1)
twoFsmooth = np.linspace(0, df.twoF.max(), 100)
# ax.plot(twoFsmooth, maxtwoFinNoise(twoFsmooth, 2e3), '-r')
ax.set_xlim(0, 60)
from latex_macro_generator import write_to_macro
write_to_macro('DirectedMCNoiseOnlyMaximum', '{:1.1f}'.format(np.max(df.twoF)),
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