Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Gregory Ashton
PyFstat
Commits
9f616cfc
Commit
9f616cfc
authored
Jan 10, 2018
by
David Keitel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transients: fix window=none case and allow custom dt0, dtau
parent
26768adf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
18 deletions
+38
-18
pyfstat/core.py
pyfstat/core.py
+33
-18
pyfstat/grid_based_searches.py
pyfstat/grid_based_searches.py
+5
-0
No files found.
pyfstat/core.py
View file @
9f616cfc
...
...
@@ -332,6 +332,7 @@ class ComputeFstat(BaseSearchClass):
def
__init__
(
self
,
tref
,
sftfilepattern
=
None
,
minStartTime
=
None
,
maxStartTime
=
None
,
binary
=
False
,
BSGL
=
False
,
transientWindowType
=
None
,
t0Band
=
None
,
tauBand
=
None
,
dt0
=
None
,
dtau
=
None
,
detectors
=
None
,
minCoverFreq
=
None
,
maxCoverFreq
=
None
,
injectSources
=
None
,
injectSqrtSX
=
None
,
assumeSqrtSX
=
None
,
SSBprec
=
None
):
...
...
@@ -360,6 +361,9 @@ class ComputeFstat(BaseSearchClass):
and tau in (2*Tsft,2*Tsft+tauBand).
if =0, only compute CW Fstat with t0=minStartTime,
tau=maxStartTime-minStartTime.
dt0, dtau: int
grid resolutions in transient start-time and duration,
both default to Tsft
detectors : str
Two character reference to the data to use, specify None for no
contraint. If multiple-separate by comma.
...
...
@@ -616,27 +620,38 @@ class ComputeFstat(BaseSearchClass):
.
format
(
self
.
transientWindowType
,
', '
.
join
(
transientWindowTypes
)))
# default spacing
self
.
Tsft
=
int
(
1.0
/
SFTCatalog
.
data
[
0
].
header
.
deltaF
)
if
self
.
t0Band
is
None
:
self
.
windowRange
.
dt0
=
self
.
Tsft
self
.
windowRange
.
dtau
=
self
.
Tsft
# 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
.
dt0
=
1
else
:
if
not
isinstance
(
self
.
t0Band
,
int
):
logging
.
warn
(
'Casting non-integer t0Band={} to int...'
.
format
(
self
.
t0Band
))
self
.
t0Band
=
int
(
self
.
t0Band
)
self
.
windowRange
.
t0Band
=
self
.
t0Band
self
.
windowRange
.
dt0
=
self
.
Tsft
if
self
.
tauBand
is
None
:
self
.
windowRange
.
tau
=
int
(
self
.
maxStartTime
-
self
.
minStartTime
)
self
.
windowRange
.
tauBand
=
0
self
.
windowRange
.
dtau
=
1
else
:
if
not
isinstance
(
self
.
tauBand
,
int
):
logging
.
warn
(
'Casting non-integer tauBand={} to int...'
.
format
(
self
.
tauBand
))
self
.
tauBand
=
int
(
self
.
tauBand
)
self
.
windowRange
.
tauBand
=
self
.
tauBand
self
.
windowRange
.
dtau
=
self
.
Tsft
else
:
# user-set bands and spacings
if
self
.
t0Band
is
None
:
self
.
windowRange
.
t0Band
=
0
else
:
if
not
isinstance
(
self
.
t0Band
,
int
):
logging
.
warn
(
'Casting non-integer t0Band={} to int...'
.
format
(
self
.
t0Band
))
self
.
t0Band
=
int
(
self
.
t0Band
)
self
.
windowRange
.
t0Band
=
self
.
t0Band
if
self
.
dt0
:
self
.
windowRange
.
dt0
=
self
.
dt0
if
self
.
tauBand
is
None
:
self
.
windowRange
.
tauBand
=
0
else
:
if
not
isinstance
(
self
.
tauBand
,
int
):
logging
.
warn
(
'Casting non-integer tauBand={} to int...'
.
format
(
self
.
tauBand
))
self
.
tauBand
=
int
(
self
.
tauBand
)
self
.
windowRange
.
tauBand
=
self
.
tauBand
if
self
.
dtau
:
self
.
windowRange
.
dtau
=
self
.
dtau
def
get_fullycoherent_twoF
(
self
,
tstart
,
tend
,
F0
,
F1
,
F2
,
Alpha
,
Delta
,
asini
=
None
,
period
=
None
,
ecc
=
None
,
tp
=
None
,
...
...
pyfstat/grid_based_searches.py
View file @
9f616cfc
...
...
@@ -353,6 +353,7 @@ class TransientGridSearch(GridSearch):
detectors
=
None
,
SSBprec
=
None
,
injectSources
=
None
,
input_arrays
=
False
,
assumeSqrtSX
=
None
,
transientWindowType
=
None
,
t0Band
=
None
,
tauBand
=
None
,
dt0
=
None
,
dtau
=
None
,
outputTransientFstatMap
=
False
):
"""
Parameters
...
...
@@ -380,6 +381,9 @@ class TransientGridSearch(GridSearch):
and tau in (2*Tsft,2*Tsft+tauBand).
if =0, only compute CW Fstat with t0=minStartTime,
tau=maxStartTime-minStartTime.
dt0, dtau: int
grid resolutions in transient start-time and duration,
both default to Tsft
outputTransientFstatMap: bool
if true, write output files for (t0,tau) Fstat maps
(one file for each doppler grid point!)
...
...
@@ -404,6 +408,7 @@ class TransientGridSearch(GridSearch):
detectors
=
self
.
detectors
,
transientWindowType
=
self
.
transientWindowType
,
t0Band
=
self
.
t0Band
,
tauBand
=
self
.
tauBand
,
dt0
=
self
.
dt0
,
dtau
=
self
.
dtau
,
minStartTime
=
self
.
minStartTime
,
maxStartTime
=
self
.
maxStartTime
,
BSGL
=
self
.
BSGL
,
SSBprec
=
self
.
SSBprec
,
injectSources
=
self
.
injectSources
,
...
...
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