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
Gregory Ashton
PyFstat
Commits
1e111130
Commit
1e111130
authored
Sep 21, 2016
by
Gregory Ashton
Browse files
Some cleaning of the run_compute_fstat method and fix test
parent
83fa8892
Changes
2
Hide whitespace changes
Inline
Side-by-side
pyfstat.py
View file @
1e111130
...
...
@@ -210,11 +210,17 @@ class ComputeFstat(object):
logging
.
info
(
'Initialising FstatResults'
)
self
.
FstatResults
=
lalpulsar
.
FstatResults
()
self
.
windowRange
=
lalpulsar
.
transientWindowRange_t
()
self
.
windowRange
.
type
=
lalpulsar
.
TRANSIENT_RECTANGULAR
self
.
windowRange
.
t0Band
=
0
self
.
windowRange
.
dt0
=
1
self
.
windowRange
.
tauBand
=
0
self
.
windowRange
.
dtau
=
1
def
run_computefstatistic_single_point
(
self
,
tstart
,
tend
,
F0
,
F1
,
F2
,
Alpha
,
Delta
):
""" Compute the F-stat fully-coherently at a single point """
numFreqBins
=
1
self
.
PulsarDopplerParams
.
fkdot
=
np
.
array
([
F0
,
F1
,
F2
,
0
,
0
,
0
,
0
])
self
.
PulsarDopplerParams
.
Alpha
=
Alpha
self
.
PulsarDopplerParams
.
Delta
=
Delta
...
...
@@ -222,21 +228,14 @@ class ComputeFstat(object):
lalpulsar
.
ComputeFstat
(
self
.
FstatResults
,
self
.
FstatInput
,
self
.
PulsarDopplerParams
,
numFreqBins
,
1
,
self
.
whatToCompute
)
windowRange
=
lalpulsar
.
transientWindowRange_t
()
windowRange
.
type
=
lalpulsar
.
TRANSIENT_RECTANGULAR
windowRange
.
t0
=
int
(
tstart
)
# TYPE UINT4
windowRange
.
t0Band
=
0
windowRange
.
dt0
=
1
windowRange
.
tau
=
int
(
tend
-
tstart
)
# TYPE UINT4
windowRange
.
tauBand
=
0
windowRange
.
dtau
=
1
useFReg
=
False
self
.
windowRange
.
t0
=
int
(
tstart
)
# TYPE UINT4
self
.
windowRange
.
tau
=
int
(
tend
-
tstart
)
# TYPE UINT4
FS
=
lalpulsar
.
ComputeTransientFstatMap
(
self
.
FstatResults
.
multiFatoms
[
0
],
windowRange
,
useFReg
)
self
.
FstatResults
.
multiFatoms
[
0
],
self
.
windowRange
,
False
)
return
2
*
FS
.
F_mn
.
data
[
0
][
0
]
...
...
tests/tests.py
View file @
1e111130
...
...
@@ -86,8 +86,7 @@ class TestComputeFstat(unittest.TestCase):
search
=
pyfstat
.
ComputeFstat
(
tref
=
Writer
.
tref
,
sftlabel
=
Writer
.
label
,
sftdir
=
Writer
.
outdir
)
FS
=
search
.
run_computefstatistic_single_point
(
Writer
.
tref
,
Writer
.
tstart
,
FS
=
search
.
run_computefstatistic_single_point
(
Writer
.
tstart
,
Writer
.
tend
,
Writer
.
F0
,
Writer
.
F1
,
...
...
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