Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
PORTER Edward
GWHMC
Commits
c32341cf
Commit
c32341cf
authored
Jul 21, 2021
by
Marc Arene
Browse files
adding input optional parameters M,K to `autocorrelation_length_estimate`
parent
b6a91b48
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
core/autocorrelation.py
core/autocorrelation.py
+4
-2
No files found.
core/autocorrelation.py
View file @
c32341cf
...
...
@@ -12,8 +12,10 @@ except ModuleNotFoundError:
try
:
import
emcee
with_emcee
=
True
print
(
'WARNING: could not find `lalinference.bayespputils` module, thus using `emcee` module to compute the autocorrelation.'
)
except
ModuleNotFoundError
:
with_homemade
=
True
print
(
'WARNING: could not find `lalinference.bayespputils` nor `emcee` modules, thus using homemade functions to compute the autocorrelation.'
)
# from lalinference.bayespputils import autocorrelation, autocorrelation_length_estimate
...
...
@@ -21,9 +23,9 @@ if with_lalinf:
def
autocorrelation
(
chain
):
return
lalinfbut
.
autocorrelation
(
chain
)
def
autocorrelation_length_estimate
(
chain
):
def
autocorrelation_length_estimate
(
chain
,
acf
=
None
,
M
=
5
,
K
=
2
):
try
:
L
=
lalinfbut
.
autocorrelation_length_estimate
(
chain
)
L
=
lalinfbut
.
autocorrelation_length_estimate
(
chain
,
acf
=
acf
,
M
=
M
,
K
=
K
)
except
lalinfbut
.
ACLError
as
e
:
cut
.
logger
.
warning
(
f
'Could not compute autocorrelation length on the chain for because of the following error:
\n
{
e
}
\n
Hence returning L=
{
len
(
chain
)
}
'
)
L
=
len
(
chain
)
...
...
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