From f70282e974b9da01fbb8e8343e86405f740f5db0 Mon Sep 17 00:00:00 2001
From: Rayne Liu <rl746@cornell.edu>
Date: Sat, 3 Oct 2020 02:35:20 +0000
Subject: [PATCH] Replace with new version

---
 code/NR_Interpolate-0001_t_10M.py | 34 ++++++-------------------------
 1 file changed, 6 insertions(+), 28 deletions(-)

diff --git a/code/NR_Interpolate-0001_t_10M.py b/code/NR_Interpolate-0001_t_10M.py
index 72af4e5..7d58176 100755
--- a/code/NR_Interpolate-0001_t_10M.py
+++ b/code/NR_Interpolate-0001_t_10M.py
@@ -33,18 +33,18 @@ import random
 #tshift: time shift after the strain peak
 #vary_fund: whether you vary the fundamental frequency. Works in the model_dv function.
 
-rootpath= "/work/rayne.liu/git/rdstackingproject"#"/Users/RayneLiu/git/rdstackingproject"
+rootpath= "/Users/RayneLiu/git/rdstackingproject"#"/work/rayne.liu/git/rdstackingproject"
 nmax=1
 tshift=10
 vary_fund = True
 
 #sampler parameters
-npoints = 600
-nwalkers = 300
+npoints = 100
+nwalkers = 50
 ntemps=16
 dim = nmax+1
 ndim = 4*dim
-burnin = 300  #How many points do you burn before doing the corner plot. You need to watch the convergence of the chain plot a bit.
+burnin = 50  #How many points do you burn before doing the corner plot. You need to watch the convergence of the chain plot a bit.
             #This is trivial but often forgotten: this cannot be more than npoints! I usually use half the points.
 numbins = 42 #corner plot parameter - how many bins you want
 datacolor = '#105670' #'#4fa3a7'
@@ -175,31 +175,9 @@ def log_prior(theta):
         if all([-0.06 <= alpha0 <= 0.06, -0.32 <= alpha1 <= -0.08, -0.19 <= beta0 <= 1.0, 0. <= beta1 <= 1.5, 0 <= xvar0 <= 1.1, 0 <= xvar1 <= 1.2, -np.pi <= yvar0 <= np.pi, -np.pi <= yvar1 <= np.pi]):        
             return 0.0
     elif tshift == 10:
-        if all([-0.04 <= alpha0 <= 0.04, -0.1 <= alpha1 <= 0.15, -0.4 <= beta0 <= 0.4, -1. <= beta1 <= 2, 0 <= xvar0 <= 1.1, 0 <= xvar1 <= 1.2, -np.pi <= yvar0 <= np.pi, -np.pi <= yvar1 <= np.pi]):        
-            return 0.0
-    """
-    if nmax == 0:
-        if all([0 <= tshift <= 5, vary_fund == True, -0.45 <= avars[0] <= 0.05, -0.95 <= bvars[0] <= 3.0, 0 <= xvars[0] <= 3.0, -np.pi <= yvars[0] <= np.pi]):        
-            return 0.0
-            
-        elif all([tshift == 19, vary_fund == True, -3.0 <= avars[0] <= 3.0, -2.0 <= bvars[0] <= 5.0, 0 <= xvars[0] <= 1.0, 0 <= yvars[0] <= 2*np.pi]):        
-            return 0.0
-        if all([0 <= tshift <= 5, vary_fund == False, -1.0 <= avars[0] <= 1.0, -1.0 <= bvars[0] <= 1.0, 0 <= xvars[0] <= 3.0, -np.pi <= yvars[0] <= np.pi]):        
-            return 0.0
-        if all([tshift == 19, vary_fund == False, -1.0 <= avars[0] <= 1.0, -1.0 <= bvars[0] <= 1.0, 0 <= xvars[0] <= 3.0, 0 <= yvars[0] <= 2*np.pi]):        
-            return 0.0
-        
-    elif nmax == 1:
-        if all([0 <= tshift <= 5, vary_fund == True, -3.0 <= avars[0] <= 3.0, -3.0 <= avars[1] <= 3.0, -2.0 <= bvars[0] <= 12.0, -4.0 <= bvars[1] <= 30.0, 0 <= xvars[0] <= 1.6, 0 <= xvars[1] <= 1.4, -np.pi <= yvars[0] <= np.pi, -np.pi <= yvars[1] <= np.pi]):        
-            return 0.0
-        elif all([tshift == 19, vary_fund == True, -10.0 <= avars[0] <= 10.0, -10.0 <= avars[1] <= 10.0, -20.0 <= bvars[0] <= 30.0, -25.0 <= bvars[1] <= 30.0, 0 <= xvars[0] <= 0.6, 0 <= xvars[1] <= 0.9, 0 <= yvars[0] <= 2*np.pi, -np.pi <= yvars[1] <= np.pi]):
+        if all([-0.04 <= alpha0 <= 0.04, -0.12 <= alpha1 <= 0.2, -0.3 <= beta0 <= 0.15, -0.5 <= beta1 <= 1.2, 0 <= xvar0 <= 1.2, 0 <= xvar1 <= 1.2, -np.pi <= yvar0 <= np.pi, -np.pi <= yvar1 <= np.pi]):        
             return 0.0
 
-        elif all([0 <= tshift <= 5, vary_fund == False, -10.0 <= avars[0] <= 10.0, -1.5 <= avars[1] <= 1.5, -9.0 <= bvars[0] <= 9.0, -6.0 <= bvars[1] <= 20.0, 0 <= xvars[0] <= 2.4, 0 <= xvars[1] <= 2.5, -np.pi <= yvars[0] <= np.pi, -np.pi <= yvars[1] <= np.pi]):
-            return 0.0
-        elif all([tshift == 19, vary_fund == False, -10.0 <= avars[0] <= 10.0, -8.0 <= avars[1] <= 8.0, -9.0 <= bvars[0] <= 9.0, -10.0 <= bvars[1] <= 12.0, 0 <= xvars[0] <= 0.6, 0 <= xvars[1] <= 0.7, 0 <= yvars[0] <= 2*np.pi, 0 <= yvars[1] <= 2* np.pi]):
-            return 0.0
-    """
     return -np.inf
 
 
@@ -298,4 +276,4 @@ for yi in range(naxes):
         ax.axvline(median[xi], color=mediancolor)
         ax.axhline(median[yi], color=mediancolor)
         ax.plot(median[xi], median[yi], color = mediancolor, marker = 's')
-figcorn.savefig(rootpath + '/plotsmc/0001_10M_interpolated_cornerplot.png', format='png', bbox_inches='tight', dpi=300)
+figcorn.savefig(rootpath + '/plotsmc/0001_10M_interpolated_cornerplot.png', format='png', bbox_inches='tight', dpi=300)
\ No newline at end of file
-- 
GitLab