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
48d1f278
Commit
48d1f278
authored
Aug 01, 2017
by
Gregory Ashton
Browse files
Add function to read in SFT files to array
parent
1ac37b70
Changes
1
Hide whitespace changes
Inline
Side-by-side
pyfstat/helper_functions.py
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
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