Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyFstat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Pep Covas Vidal
PyFstat
Commits
8f1783ee
Commit
8f1783ee
authored
8 years ago
by
Gregory Ashton
Browse files
Options
Downloads
Patches
Plain Diff
Adds semi-coherent functionality to grid search
If nsegs > 1, a semi-coherent search is performed.
parent
5eb8713e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pyfstat/grid_based_searches.py
+28
-12
28 additions, 12 deletions
pyfstat/grid_based_searches.py
with
28 additions
and
12 deletions
pyfstat/grid_based_searches.py
+
28
−
12
View file @
8f1783ee
...
@@ -10,7 +10,7 @@ import matplotlib
...
@@ -10,7 +10,7 @@ import matplotlib
import
matplotlib.pyplot
as
plt
import
matplotlib.pyplot
as
plt
import
helper_functions
import
helper_functions
from
core
import
BaseSearchClass
,
ComputeFstat
,
SemiCoherentGlitchSearch
from
core
import
BaseSearchClass
,
ComputeFstat
,
SemiCoherentGlitchSearch
,
SemiCoherentSearch
from
core
import
tqdm
,
args
,
earth_ephem
,
sun_ephem
from
core
import
tqdm
,
args
,
earth_ephem
,
sun_ephem
...
@@ -18,7 +18,7 @@ class GridSearch(BaseSearchClass):
...
@@ -18,7 +18,7 @@ class GridSearch(BaseSearchClass):
"""
Gridded search using ComputeFstat
"""
"""
Gridded search using ComputeFstat
"""
@helper_functions.initializer
@helper_functions.initializer
def
__init__
(
self
,
label
,
outdir
,
sftfilepath
,
F0s
=
[
0
],
F1s
=
[
0
],
F2s
=
[
0
],
def
__init__
(
self
,
label
,
outdir
,
sftfilepath
,
F0s
=
[
0
],
F1s
=
[
0
],
F2s
=
[
0
],
Alphas
=
[
0
],
Deltas
=
[
0
],
tref
=
None
,
minStartTime
=
None
,
Alphas
=
[
0
],
Deltas
=
[
0
],
tref
=
None
,
minStartTime
=
None
,
nsegs
=
1
,
maxStartTime
=
None
,
BSGL
=
False
,
minCoverFreq
=
None
,
maxStartTime
=
None
,
BSGL
=
False
,
minCoverFreq
=
None
,
maxCoverFreq
=
None
,
earth_ephem
=
None
,
sun_ephem
=
None
,
maxCoverFreq
=
None
,
earth_ephem
=
None
,
sun_ephem
=
None
,
detectors
=
None
):
detectors
=
None
):
...
@@ -50,6 +50,7 @@ class GridSearch(BaseSearchClass):
...
@@ -50,6 +50,7 @@ class GridSearch(BaseSearchClass):
def
inititate_search_object
(
self
):
def
inititate_search_object
(
self
):
logging
.
info
(
'
Setting up search object
'
)
logging
.
info
(
'
Setting up search object
'
)
if
self
.
nsegs
==
1
:
self
.
search
=
ComputeFstat
(
self
.
search
=
ComputeFstat
(
tref
=
self
.
tref
,
sftfilepath
=
self
.
sftfilepath
,
tref
=
self
.
tref
,
sftfilepath
=
self
.
sftfilepath
,
minCoverFreq
=
self
.
minCoverFreq
,
maxCoverFreq
=
self
.
maxCoverFreq
,
minCoverFreq
=
self
.
minCoverFreq
,
maxCoverFreq
=
self
.
maxCoverFreq
,
...
@@ -57,6 +58,19 @@ class GridSearch(BaseSearchClass):
...
@@ -57,6 +58,19 @@ class GridSearch(BaseSearchClass):
detectors
=
self
.
detectors
,
transient
=
False
,
detectors
=
self
.
detectors
,
transient
=
False
,
minStartTime
=
self
.
minStartTime
,
maxStartTime
=
self
.
maxStartTime
,
minStartTime
=
self
.
minStartTime
,
maxStartTime
=
self
.
maxStartTime
,
BSGL
=
self
.
BSGL
)
BSGL
=
self
.
BSGL
)
self
.
search
.
get_det_stat
=
self
.
search
.
run_computefstatistic_single_point
else
:
self
.
search
=
SemiCoherentSearch
(
label
=
self
.
label
,
outdir
=
self
.
outdir
,
tref
=
self
.
tref
,
nsegs
=
self
.
nsegs
,
sftfilepath
=
self
.
sftfilepath
,
BSGL
=
self
.
BSGL
,
minStartTime
=
self
.
minStartTime
,
maxStartTime
=
self
.
maxStartTime
,
minCoverFreq
=
self
.
minCoverFreq
,
maxCoverFreq
=
self
.
maxCoverFreq
,
detectors
=
self
.
detectors
,
earth_ephem
=
self
.
earth_ephem
,
sun_ephem
=
self
.
sun_ephem
)
def
cut_out_tstart_tend
(
*
vals
):
return
self
.
search
.
run_semi_coherent_computefstatistic_single_point
(
*
vals
[
2
:])
self
.
search
.
get_det_stat
=
cut_out_tstart_tend
def
get_array_from_tuple
(
self
,
x
):
def
get_array_from_tuple
(
self
,
x
):
if
len
(
x
)
==
1
:
if
len
(
x
)
==
1
:
...
@@ -107,7 +121,7 @@ class GridSearch(BaseSearchClass):
...
@@ -107,7 +121,7 @@ class GridSearch(BaseSearchClass):
data
=
[]
data
=
[]
for
vals
in
tqdm
(
self
.
input_data
):
for
vals
in
tqdm
(
self
.
input_data
):
FS
=
self
.
search
.
run_computefstatistic_single_poin
t
(
*
vals
)
FS
=
self
.
search
.
get_det_sta
t
(
*
vals
)
data
.
append
(
list
(
vals
)
+
[
FS
])
data
.
append
(
list
(
vals
)
+
[
FS
])
data
=
np
.
array
(
data
)
data
=
np
.
array
(
data
)
...
@@ -236,7 +250,8 @@ class GridSearch(BaseSearchClass):
...
@@ -236,7 +250,8 @@ class GridSearch(BaseSearchClass):
class
GridUniformPriorSearch
():
class
GridUniformPriorSearch
():
def
__init__
(
self
,
theta_prior
,
NF0
,
NF1
,
label
,
outdir
,
sftfilepath
,
def
__init__
(
self
,
theta_prior
,
NF0
,
NF1
,
label
,
outdir
,
sftfilepath
,
tref
,
minStartTime
,
maxStartTime
,
BSGL
=
False
,
detectors
=
None
):
tref
,
minStartTime
,
maxStartTime
,
minCoverFreq
=
None
,
maxCoverFreq
=
None
,
BSGL
=
False
,
detectors
=
None
,
nsegs
=
1
):
dF0
=
(
theta_prior
[
'
F0
'
][
'
upper
'
]
-
theta_prior
[
'
F0
'
][
'
lower
'
])
/
NF0
dF0
=
(
theta_prior
[
'
F0
'
][
'
upper
'
]
-
theta_prior
[
'
F0
'
][
'
lower
'
])
/
NF0
dF1
=
(
theta_prior
[
'
F1
'
][
'
upper
'
]
-
theta_prior
[
'
F1
'
][
'
lower
'
])
/
NF1
dF1
=
(
theta_prior
[
'
F1
'
][
'
upper
'
]
-
theta_prior
[
'
F1
'
][
'
lower
'
])
/
NF1
F0s
=
[
theta_prior
[
'
F0
'
][
'
lower
'
],
theta_prior
[
'
F0
'
][
'
upper
'
],
dF0
]
F0s
=
[
theta_prior
[
'
F0
'
][
'
lower
'
],
theta_prior
[
'
F0
'
][
'
upper
'
],
dF0
]
...
@@ -245,7 +260,8 @@ class GridUniformPriorSearch():
...
@@ -245,7 +260,8 @@ class GridUniformPriorSearch():
label
,
outdir
,
sftfilepath
,
F0s
=
F0s
,
F1s
=
F1s
,
tref
=
tref
,
label
,
outdir
,
sftfilepath
,
F0s
=
F0s
,
F1s
=
F1s
,
tref
=
tref
,
Alphas
=
[
theta_prior
[
'
Alpha
'
]],
Deltas
=
[
theta_prior
[
'
Delta
'
]],
Alphas
=
[
theta_prior
[
'
Alpha
'
]],
Deltas
=
[
theta_prior
[
'
Delta
'
]],
minStartTime
=
minStartTime
,
maxStartTime
=
maxStartTime
,
BSGL
=
BSGL
,
minStartTime
=
minStartTime
,
maxStartTime
=
maxStartTime
,
BSGL
=
BSGL
,
detectors
=
detectors
)
detectors
=
detectors
,
minCoverFreq
=
minCoverFreq
,
maxCoverFreq
=
maxCoverFreq
,
nsegs
=
nsegs
)
def
run
(
self
,
**
kwargs
):
def
run
(
self
,
**
kwargs
):
self
.
search
.
run
()
self
.
search
.
run
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment