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
Richard O'Shaughnessy
research-projects-RIT
Commits
23899b5a
Commit
23899b5a
authored
Jan 12, 2019
by
Richard O'Shaughnessy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CIP: Modify to allow distance fitting
parent
23111a24
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
MonteCarloMarginalizeCode/Code/util_ConstructIntrinsicPosterior_GenericCoordinates.py
...de/util_ConstructIntrinsicPosterior_GenericCoordinates.py
+7
-1
No files found.
MonteCarloMarginalizeCode/Code/util_ConstructIntrinsicPosterior_GenericCoordinates.py
View file @
23899b5a
...
@@ -176,6 +176,7 @@ def add_field(a, descr):
...
@@ -176,6 +176,7 @@ def add_field(a, descr):
parser
=
argparse
.
ArgumentParser
()
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"--fname"
,
help
=
"filename of *.dat file [standard ILE output]"
)
parser
.
add_argument
(
"--fname"
,
help
=
"filename of *.dat file [standard ILE output]"
)
parser
.
add_argument
(
"--input-tides"
,
action
=
'store_true'
,
help
=
"Use input format with tidal fields included."
)
parser
.
add_argument
(
"--input-tides"
,
action
=
'store_true'
,
help
=
"Use input format with tidal fields included."
)
parser
.
add_argument
(
"--input-distance"
,
action
=
'store_true'
,
help
=
"Use input format with distance fields (but not tidal fields?) enabled."
)
parser
.
add_argument
(
"--fname-lalinference"
,
help
=
"filename of posterior_samples.dat file [standard LI output], to overlay on corner plots"
)
parser
.
add_argument
(
"--fname-lalinference"
,
help
=
"filename of posterior_samples.dat file [standard LI output], to overlay on corner plots"
)
parser
.
add_argument
(
"--fname-output-samples"
,
default
=
"output-ILE-samples"
,
help
=
"output posterior samples (default output-ILE-samples -> output-ILE)"
)
parser
.
add_argument
(
"--fname-output-samples"
,
default
=
"output-ILE-samples"
,
help
=
"output posterior samples (default output-ILE-samples -> output-ILE)"
)
parser
.
add_argument
(
"--fname-output-integral"
,
default
=
"integral_result"
,
help
=
"output filename for integral result. Postfixes appended"
)
parser
.
add_argument
(
"--fname-output-integral"
,
default
=
"integral_result"
,
help
=
"output filename for integral result. Postfixes appended"
)
...
@@ -924,6 +925,9 @@ col_lnL = 9
...
@@ -924,6 +925,9 @@ col_lnL = 9
if
opts
.
input_tides
:
if
opts
.
input_tides
:
print
" Tides input"
print
" Tides input"
col_lnL
+=
2
col_lnL
+=
2
if
opts
.
input_distance
:
print
" Distance input"
col_lnL
+=
1
dat_orig
=
dat
=
np
.
loadtxt
(
opts
.
fname
)
dat_orig
=
dat
=
np
.
loadtxt
(
opts
.
fname
)
dat_orig
=
dat
[
dat
[:,
col_lnL
].
argsort
()]
# sort http://stackoverflow.com/questions/2828059/sorting-arrays-in-numpy-by-column
dat_orig
=
dat
[
dat
[:,
col_lnL
].
argsort
()]
# sort http://stackoverflow.com/questions/2828059/sorting-arrays-in-numpy-by-column
print
" Original data size = "
,
len
(
dat
),
dat
.
shape
print
" Original data size = "
,
len
(
dat
),
dat
.
shape
...
@@ -994,6 +998,8 @@ for line in dat:
...
@@ -994,6 +998,8 @@ for line in dat:
if
opts
.
input_tides
:
if
opts
.
input_tides
:
P
.
lambda1
=
line
[
9
]
P
.
lambda1
=
line
[
9
]
P
.
lambda2
=
line
[
10
]
P
.
lambda2
=
line
[
10
]
if
opts
.
input_distance
:
P
.
dist
=
lal
.
PC_SI
*
1e6
*
line
[
9
]
# Incompatible with tides, note!
# INPUT GRID: Evaluate binary parameters on fitting coordinates
# INPUT GRID: Evaluate binary parameters on fitting coordinates
line_out
=
np
.
zeros
(
len
(
coord_names
)
+
2
)
line_out
=
np
.
zeros
(
len
(
coord_names
)
+
2
)
...
...
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