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
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gregory Ashton
PyFstat
Commits
48d1f278
Commit
48d1f278
authored
7 years ago
by
Gregory Ashton
Browse files
Options
Downloads
Patches
Plain Diff
Add function to read in SFT files to array
parent
1ac37b70
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/helper_functions.py
+18
-0
18 additions, 0 deletions
pyfstat/helper_functions.py
with
18 additions
and
0 deletions
pyfstat/helper_functions.py
+
18
−
0
View file @
48d1f278
...
...
@@ -209,3 +209,21 @@ def convert_array_to_gsl_matrix(array):
gsl_matrix
=
lal
.
gsl_matrix
(
*
array
.
shape
)
gsl_matrix
.
data
=
array
return
gsl_matrix
def
get_sft_array
(
sftfilepattern
,
data_duration
,
F0
,
dF0
):
"""
Return the raw data from a set of sfts
"""
SFTCatalog
=
lalpulsar
.
SFTdataFind
(
sftfilepattern
,
lalpulsar
.
SFTConstraints
())
MultiSFTs
=
lalpulsar
.
LoadMultiSFTs
(
SFTCatalog
,
F0
-
dF0
,
F0
+
dF0
)
SFTs
=
MultiSFTs
.
data
[
0
]
data
=
[]
for
sft
in
SFTs
.
data
:
data
.
append
(
np
.
abs
(
sft
.
data
.
data
))
data
=
np
.
array
(
data
).
T
n
,
nsfts
=
data
.
shape
freqs
=
np
.
linspace
(
sft
.
f0
,
sft
.
f0
+
n
*
sft
.
deltaF
,
n
)
times
=
np
.
linspace
(
0
,
data_duration
,
nsfts
)
return
times
,
freqs
,
data
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