Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Katerina Chatziioannou
bayeswave
Commits
e7c9345f
Commit
e7c9345f
authored
Oct 19, 2020
by
Katerina Chatziioannou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up params files
parent
fad61739
Pipeline
#163711
passed with stages
in 2 minutes and 19 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
14 deletions
+23
-14
src/BayesWaveIO.c
src/BayesWaveIO.c
+22
-13
src/BayesWaveMCMC.c
src/BayesWaveMCMC.c
+1
-1
No files found.
src/BayesWaveIO.c
View file @
e7c9345f
...
...
@@ -1109,8 +1109,26 @@ void print_cbc_model(FILE *fptr, struct bayesCBC *bayescbc, int ic, double Tobs)
{
int
k
;
// Print all parameters (as used in sampler, not converted to usal formats)
for
(
k
=
0
;
k
<
bayescbc
->
NP
;
k
++
)
fprintf
(
fptr
,
"%f
\t
"
,
bayescbc
->
pallx
[
ic
][
k
]);
double
Mchirp
=
exp
(
bayescbc
->
pallx
[
ic
][
0
])
/
LAL_MSUN_SI
;
double
Mtot
=
exp
(
bayescbc
->
pallx
[
ic
][
1
])
/
LAL_MSUN_SI
;
double
eta
=
pow
((
Mchirp
/
Mtot
),
(
5
.
0
/
3
.
0
));
double
dm
=
sqrt
(
1
.
0
-
4
.
0
*
eta
);
double
m1
=
Mtot
*
(
1
.
0
+
dm
)
/
2
.
0
;
double
m2
=
Mtot
*
(
1
.
0
-
dm
)
/
2
.
0
;
double
chieff
=
(
m1
*
bayescbc
->
pallx
[
ic
][
2
]
+
m2
*
bayescbc
->
pallx
[
ic
][
3
])
/
Mtot
;
double
DL
=
exp
(
bayescbc
->
pallx
[
ic
][
6
])
/
(
1.0e6
*
LAL_PC_SI
);
// includes conversion to Mpc
double
z
=
z_DL
(
DL
);
double
tc
=
bayescbc
->
pallx
[
ic
][
5
]
-
(
Tobs
-
2
.
0
);
fprintf
(
fptr
,
"%f %f %f %f "
,
m1
/
(
1
.
0
+
z
),
m2
/
(
1
.
0
+
z
),
Mchirp
/
(
1
.
0
+
z
),
Mtot
/
(
1
.
0
+
z
));
//mass parameters in detector frame
fprintf
(
fptr
,
"%f %f %f "
,
bayescbc
->
pallx
[
ic
][
2
],
bayescbc
->
pallx
[
ic
][
3
],
chieff
);
//spin parameters: a1, a2, chieff
fprintf
(
fptr
,
"%f %f "
,
bayescbc
->
pallx
[
ic
][
4
],
bayescbc
->
pallx
[
ic
][
5
]);
//phase and time
fprintf
(
fptr
,
"%f %f "
,
DL
,
z
);
//distance, redshift
fprintf
(
fptr
,
"%f %f %f %f "
,
bayescbc
->
pallx
[
ic
][
bayescbc
->
NX
],
bayescbc
->
pallx
[
ic
][
bayescbc
->
NX
+
1
],
bayescbc
->
pallx
[
ic
][
bayescbc
->
NX
+
2
],
bayescbc
->
pallx
[
ic
][
bayescbc
->
NX
+
3
]);
//ra, sindec, psi, cosiota
fprintf
(
fptr
,
"%f %f %f %f "
,
m1
,
m2
,
Mchirp
,
Mtot
);
//mass parameters in source frame
fprintf
(
fptr
,
"
\n
"
);
// The below is for recreating the QuickCBC allchain file units
...
...
@@ -1118,16 +1136,7 @@ void print_cbc_model(FILE *fptr, struct bayesCBC *bayescbc, int ic, double Tobs)
if
(
bayescbc
->
verbose
==
1
)
{
double
Mchirp
=
exp
(
bayescbc
->
pallx
[
ic
][
0
])
/
LAL_MSUN_SI
;
double
Mtot
=
exp
(
bayescbc
->
pallx
[
ic
][
1
])
/
LAL_MSUN_SI
;
double
eta
=
pow
((
Mchirp
/
Mtot
),
(
5
.
0
/
3
.
0
));
double
dm
=
sqrt
(
1
.
0
-
4
.
0
*
eta
);
double
m1
=
Mtot
*
(
1
.
0
+
dm
)
/
2
.
0
;
double
m2
=
Mtot
*
(
1
.
0
-
dm
)
/
2
.
0
;
double
chieff
=
(
m1
*
bayescbc
->
pallx
[
ic
][
2
]
+
m2
*
bayescbc
->
pallx
[
ic
][
3
])
/
Mtot
;
double
DL
=
exp
(
bayescbc
->
pallx
[
ic
][
6
])
/
(
1.0e6
*
LAL_PC_SI
);
// includes conversion to Mpc
double
z
=
z_DL
(
DL
);
// TODO: Add suport below for converting & printing neutron star tidal parameters
// if (NX > 7) {
...
...
@@ -1148,7 +1157,7 @@ void print_cbc_model(FILE *fptr, struct bayesCBC *bayescbc, int ic, double Tobs)
// } else {
// Merger time is printed relative to trigger time, which is at Tobs-2.
double
tc
=
bayescbc
->
pallx
[
ic
][
5
]
-
(
Tobs
-
2
.
0
);
// [0] log(Mc) [1] log(Mt) [2] chi1 [3] chi2 [4] phi0 [5] tp [6] log(DL) [7] alpha [8] sindelta [9] psi [10] ciota
// counter, log likelihood, chirp mass (DF), total mass (DF), effective spin, geocenter orbital phase, geocenter arrival time, distance, RA , sine of DEC,
...
...
src/BayesWaveMCMC.c
View file @
e7c9345f
...
...
@@ -402,7 +402,7 @@ static void restart_sampler(struct Data *data, struct Chain *chain, struct Prior
//Parameters for reproducing CBC model
if
(
data
->
cbcFlag
)
{
sprintf
(
filename
,
"chains/
cbc_model.dat.%i"
,
ic
);
sprintf
(
filename
,
"chains/
%s_params.dat.%i"
,
modelname
,
ic
);
chain
->
cbcChainFile
[
ic
]
=
fopen
(
filename
,
"w"
);
}
...
...
Write
Preview
Markdown
is supported
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