From 32764733cca48081873701a7f146021b3d807418 Mon Sep 17 00:00:00 2001 From: dsjohns2 <dsjohns2@illinois.edu> Date: Tue, 8 Aug 2017 21:49:45 -0500 Subject: [PATCH] Add phase plot to monitor script --- POWER/monitor_waveform.sh | 11 ++++++----- POWER/plot_monitor.py | 12 +++++++++++- POWER/power.py | 2 ++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/POWER/monitor_waveform.sh b/POWER/monitor_waveform.sh index 583ae41..880a32a 100755 --- a/POWER/monitor_waveform.sh +++ b/POWER/monitor_waveform.sh @@ -1,8 +1,9 @@ #!/bin/bash -folder=$1 +for folder in "$@" +do + run=${folder##*/} + ./power.py $folder + ./plot_monitor.py $run +done -run=${folder##*/} - -./power.py $folder -./plot_monitor.py $run diff --git a/POWER/plot_monitor.py b/POWER/plot_monitor.py index f6600eb..2172601 100755 --- a/POWER/plot_monitor.py +++ b/POWER/plot_monitor.py @@ -7,17 +7,27 @@ import sys run_name = sys.argv[1] -python_strain = np.loadtxt("./Extrapolated_Strain/"+run_name+"/"+run_name+"_strain_at_500.dat") +python_strain = np.loadtxt("./Extrapolated_Strain/"+run_name+"/"+run_name+"_radially_extrapolated_strain.dat") +python_phase = np.loadtxt("./Extrapolated_Strain/"+run_name+"/"+run_name+"_radially_extrapolated_phase.dat") py_t = python_strain[:, 0] py_hplus = python_strain[:, 1] +py_phase = python_phase[:, 1] run_name_without_resolution = run_name.split("_")[0] matplotlib.rcParams.update({'font.size': 12}) matplotlib.rcParams.update({'font.family': 'serif'}) + plt.title(run_name_without_resolution) plt.plot(py_t, py_hplus) plt.xlim((0,None)) plt.ylabel('${\mathfrak{R}} [h(t)]$') plt.xlabel('Time [M]') plt.show() + +plt.title(run_name_without_resolution) +plt.plot(py_t, py_phase) +plt.xlim((0,None)) +plt.ylabel('$\phi$') +plt.xlabel('Time [M]') +plt.show() diff --git a/POWER/power.py b/POWER/power.py index 6795cdf..313b7dc 100755 --- a/POWER/power.py +++ b/POWER/power.py @@ -392,3 +392,5 @@ for sim_path in paths: radially_extrapolated_h_cross = np.append(radially_extrapolated_h_cross, radially_extrapolated_amp[i] * math.sin(radially_extrapolated_phase[i])) np.savetxt("./Extrapolated_Strain/"+sim+"/"+sim+"_radially_extrapolated_strain.dat", np.column_stack((t, radially_extrapolated_h_plus, radially_extrapolated_h_cross))) + np.savetxt("./Extrapolated_Strain/"+sim+"/"+sim+"_radially_extrapolated_amplitude.dat", np.column_stack((t, radially_extrapolated_amp))) + np.savetxt("./Extrapolated_Strain/"+sim+"/"+sim+"_radially_extrapolated_phase.dat", np.column_stack((t, radially_extrapolated_phase))) -- GitLab