Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rayne Liu
RDStackingProject
Commits
f70282e9
Commit
f70282e9
authored
Oct 03, 2020
by
Rayne Liu
Browse files
Replace with new version
parent
e579a3a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
code/NR_Interpolate-0001_t_10M.py
View file @
f70282e9
...
...
@@ -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/r
ayne
.l
iu/git/rdstackingproject"
#"/
Users/R
ayne
L
iu/git/rdstackingproject"
rootpath
=
"/
Users/R
ayne
L
iu/git/rdstackingproject"
#"/
work/r
ayne
.l
iu/git/rdstackingproject"
nmax
=
1
tshift
=
10
vary_fund
=
True
#sampler parameters
npoints
=
6
00
nwalkers
=
30
0
npoints
=
1
00
nwalkers
=
5
0
ntemps
=
16
dim
=
nmax
+
1
ndim
=
4
*
dim
burnin
=
30
0
#How many points do you burn before doing the corner plot. You need to watch the convergence of the chain plot a bit.
burnin
=
5
0
#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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment