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
David Keitel
PyFstat
Commits
691dae29
Commit
691dae29
authored
Feb 08, 2018
by
Gregory Ashton
Browse files
Minor code polishing
parent
9cdbd15a
Changes
1
Hide whitespace changes
Inline
Side-by-side
pyfstat/core.py
View file @
691dae29
...
...
@@ -632,13 +632,14 @@ class ComputeFstat(BaseSearchClass):
self
.
windowRange
.
dt0
=
self
.
Tsft
self
.
windowRange
.
dtau
=
self
.
Tsft
# special treatment of window_type = none ==> replace by rectangular window spanning all the data
# special treatment of window_type = none ==> replace by
# rectangular window spanning all the data
if
self
.
windowRange
.
type
==
lalpulsar
.
TRANSIENT_NONE
:
self
.
windowRange
.
t0
=
int
(
self
.
minStartTime
)
self
.
windowRange
.
t0Band
=
0
self
.
windowRange
.
tau
=
int
(
self
.
maxStartTime
-
self
.
minStartTime
)
self
.
windowRange
.
tauBand
=
0
else
:
# user-set bands and spacings
else
:
# user-set bands and spacings
if
self
.
t0Band
is
None
:
self
.
windowRange
.
t0Band
=
0
else
:
...
...
@@ -660,7 +661,9 @@ class ComputeFstat(BaseSearchClass):
if
self
.
dtau
:
self
.
windowRange
.
dtau
=
self
.
dtau
self
.
tCWFstatMapFeatures
,
self
.
gpu_context
=
tcw
.
init_transient_fstat_map_features
(
self
.
tCWFstatMapVersion
==
'pycuda'
,
self
.
cudaDeviceName
)
self
.
tCWFstatMapFeatures
,
self
.
gpu_context
=
(
tcw
.
init_transient_fstat_map_features
(
self
.
tCWFstatMapVersion
==
'pycuda'
,
self
.
cudaDeviceName
))
def
get_fullycoherent_twoF
(
self
,
tstart
,
tend
,
F0
,
F1
,
F2
,
Alpha
,
Delta
,
asini
=
None
,
period
=
None
,
ecc
=
None
,
tp
=
None
,
...
...
@@ -704,21 +707,29 @@ class ComputeFstat(BaseSearchClass):
# F-stat computation
self
.
windowRange
.
tau
=
int
(
2
*
self
.
Tsft
)
#logging.debug('Calling "%s" version of ComputeTransientFstatMap() with windowRange: (type=%d (%s), t0=%f, t0Band=%f, dt0=%f, tau=%f, tauBand=%f, dtau=%f)...' % (self.tCWFstatMapVersion, self.windowRange.type, self.transientWindowType, self.windowRange.t0, self.windowRange.t0Band, self.windowRange.dt0, self.windowRange.tau, self.windowRange.tauBand, self.windowRange.dtau))
self
.
FstatMap
=
tcw
.
call_compute_transient_fstat_map
(
self
.
tCWFstatMapVersion
,
self
.
tCWFstatMapFeatures
,
self
.
FstatResults
.
multiFatoms
[
0
],
self
.
windowRange
)
# logging.debug(
# 'Calling "%s" version of ComputeTransientFstatMap() with\
# windowRange: (type=%d (%s), t0=%f, t0Band=%f, dt0=%f, tau=%f,\
# tauBand=%f, dtau=%f)...' % (
# self.tCWFstatMapVersion, self.windowRange.type,
# self.transientWindowType, self.windowRange.t0,
# self.windowRange.t0Band, self.windowRange.dt0,
# self.windowRange.tau, self.windowRange.tauBand,
# self.windowRange.dtau))
self
.
FstatMap
=
tcw
.
call_compute_transient_fstat_map
(
self
.
tCWFstatMapVersion
,
self
.
tCWFstatMapFeatures
,
self
.
FstatResults
.
multiFatoms
[
0
],
self
.
windowRange
)
if
self
.
tCWFstatMapVersion
==
'lal'
:
F_mn
=
self
.
FstatMap
.
F_mn
.
data
else
:
F_mn
=
self
.
FstatMap
.
F_mn
#logging.debug('maxF: {}'.format(FstatMap.maxF))
#logging.debug('t0_ML: %ds=T0+%fd' % (FstatMap.t0_ML, (FstatMap.t0_ML-tstart)/(3600.*24.)))
#logging.debug('tau_ML: %ds=%fd' % (FstatMap.tau_ML, FstatMap.tau_ML/(3600.*24.)))
#logging.debug('F_mn: {}'.format(F_mn))
# logging.debug('maxF: {}'.format(self.FstatMap.maxF))
# logging.debug('t0_ML: %ds=T0+%fd' % (
# self.FstatMap.t0_ML, (self.FstatMap.t0_ML-tstart)/(3600.*24.)))
# logging.debug('tau_ML: %ds=%fd' % (
# self.FstatMap.tau_ML, self.FstatMap.tau_ML/(3600.*24.)))
# logging.debug('F_mn: {}'.format(F_mn))
twoF
=
2
*
np
.
max
(
F_mn
)
if
self
.
BSGL
is
False
:
...
...
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