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
2a2e469a
Commit
2a2e469a
authored
5 years ago
by
David Keitel
Browse files
Options
Downloads
Patches
Plain Diff
black style fixes to preceding set of ephem-handling commits
parent
0e9d656b
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!25
ephemerides handling fixes
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pyfstat/helper_functions.py
+15
-7
15 additions, 7 deletions
pyfstat/helper_functions.py
pyfstat/make_sfts.py
+28
-12
28 additions, 12 deletions
pyfstat/make_sfts.py
with
43 additions
and
19 deletions
pyfstat/helper_functions.py
+
15
−
7
View file @
2a2e469a
...
@@ -147,11 +147,19 @@ def get_ephemeris_files():
...
@@ -147,11 +147,19 @@ def get_ephemeris_files():
sun_ephem
=
None
sun_ephem
=
None
elif
env_var
in
list
(
os
.
environ
.
keys
()):
elif
env_var
in
list
(
os
.
environ
.
keys
()):
ephem_version
=
"
DE405
"
ephem_version
=
"
DE405
"
earth_ephem
=
os
.
path
.
join
(
os
.
environ
[
env_var
],
"
earth00-40-{:s}.dat.gz
"
.
format
(
ephem_version
))
earth_ephem
=
os
.
path
.
join
(
sun_ephem
=
os
.
path
.
join
(
os
.
environ
[
env_var
],
"
sun00-40-{:s}.dat.gz
"
.
format
(
ephem_version
))
os
.
environ
[
env_var
],
"
earth00-40-{:s}.dat.gz
"
.
format
(
ephem_version
)
)
sun_ephem
=
os
.
path
.
join
(
os
.
environ
[
env_var
],
"
sun00-40-{:s}.dat.gz
"
.
format
(
ephem_version
)
)
if
not
(
os
.
path
.
isfile
(
earth_ephem
)
and
os
.
path
.
isfile
(
sun_ephem
)):
if
not
(
os
.
path
.
isfile
(
earth_ephem
)
and
os
.
path
.
isfile
(
sun_ephem
)):
earth_ephem
=
os
.
path
.
join
(
os
.
environ
[
env_var
],
"
earth00-19-{:s}.dat.gz
"
.
format
(
ephem_version
))
earth_ephem
=
os
.
path
.
join
(
sun_ephem
=
os
.
path
.
join
(
os
.
environ
[
env_var
],
"
sun00-19-{:s}.dat.gz
"
.
format
(
ephem_version
))
os
.
environ
[
env_var
],
"
earth00-19-{:s}.dat.gz
"
.
format
(
ephem_version
)
)
sun_ephem
=
os
.
path
.
join
(
os
.
environ
[
env_var
],
"
sun00-19-{:s}.dat.gz
"
.
format
(
ephem_version
)
)
if
not
(
os
.
path
.
isfile
(
earth_ephem
)
and
os
.
path
.
isfile
(
sun_ephem
)):
if
not
(
os
.
path
.
isfile
(
earth_ephem
)
and
os
.
path
.
isfile
(
sun_ephem
)):
logging
.
warning
(
logging
.
warning
(
"
Default [earth/sun]00-[19/40]-
"
+
ephem_version
+
"
ephemerides
"
"
Default [earth/sun]00-[19/40]-
"
+
ephem_version
+
"
ephemerides
"
...
...
This diff is collapsed.
Click to expand it.
pyfstat/make_sfts.py
+
28
−
12
View file @
2a2e469a
...
@@ -263,14 +263,18 @@ transientTau = {:10.0f}\n"""
...
@@ -263,14 +263,18 @@ transientTau = {:10.0f}\n"""
logging
.
info
(
"
Checking if cached data good to reuse...
"
)
logging
.
info
(
"
Checking if cached data good to reuse...
"
)
if
os
.
path
.
isfile
(
self
.
sftfilepath
)
is
False
:
if
os
.
path
.
isfile
(
self
.
sftfilepath
)
is
False
:
logging
.
info
(
"
No SFT file matching {} found. {}
"
.
format
(
self
.
sftfilepath
,
need_new
))
logging
.
info
(
"
No SFT file matching {} found. {}
"
.
format
(
self
.
sftfilepath
,
need_new
)
)
return
False
return
False
else
:
else
:
logging
.
info
(
"
OK: Matching SFT file found.
"
)
logging
.
info
(
"
OK: Matching SFT file found.
"
)
if
"
injectionSources
"
in
cl_mfd
:
if
"
injectionSources
"
in
cl_mfd
:
if
os
.
path
.
isfile
(
self
.
config_file_name
):
if
os
.
path
.
isfile
(
self
.
config_file_name
):
if
os
.
path
.
getmtime
(
self
.
sftfilepath
)
<
os
.
path
.
getmtime
(
self
.
config_file_name
):
if
os
.
path
.
getmtime
(
self
.
sftfilepath
)
<
os
.
path
.
getmtime
(
self
.
config_file_name
):
logging
.
info
(
logging
.
info
(
(
(
"
The config file {} has been modified since the SFT file {}
"
"
The config file {} has been modified since the SFT file {}
"
...
@@ -281,20 +285,30 @@ transientTau = {:10.0f}\n"""
...
@@ -281,20 +285,30 @@ transientTau = {:10.0f}\n"""
else
:
else
:
logging
.
info
(
logging
.
info
(
"
OK: The config file {} is older than the SFT file {}
"
.
format
(
"
OK: The config file {} is older than the SFT file {}
"
.
format
(
self
.
config_file_name
,
self
.
sftfilepath
)
self
.
config_file_name
,
self
.
sftfilepath
)
)
# NOTE: at this point we assume it's safe to re-use, since
# NOTE: at this point we assume it's safe to re-use, since
# check_if_cff_file_needs_rewritting()
# check_if_cff_file_needs_rewritting()
# should have already been called before
# should have already been called before
)
else
:
else
:
raise
RuntimeError
(
"
Commandline requires file
'
{}
'
but it is missing.
"
.
format
(
self
.
config_file_name
))
raise
RuntimeError
(
"
Commandline requires file
'
{}
'
but it is missing.
"
.
format
(
self
.
config_file_name
)
)
logging
.
info
(
"
Checking new commandline against existing SFT header...
"
)
logging
.
info
(
"
Checking new commandline against existing SFT header...
"
)
cl_dump
=
"
lalapps_SFTdumpheader {} | head -n 20
"
.
format
(
self
.
sftfilepath
)
cl_dump
=
"
lalapps_SFTdumpheader {} | head -n 20
"
.
format
(
self
.
sftfilepath
)
output
=
helper_functions
.
run_commandline
(
cl_dump
)
output
=
helper_functions
.
run_commandline
(
cl_dump
)
header_lines_lalapps
=
[
line
for
line
in
output
.
split
(
"
\n
"
)
if
"
lalapps
"
in
line
]
header_lines_lalapps
=
[
line
for
line
in
output
.
split
(
"
\n
"
)
if
"
lalapps
"
in
line
]
if
len
(
header_lines_lalapps
)
==
0
:
if
len
(
header_lines_lalapps
)
==
0
:
logging
.
info
(
"
Could not obtain comparison commandline from old SFT header.
"
+
need_new
)
logging
.
info
(
"
Could not obtain comparison commandline from old SFT header.
"
+
need_new
)
return
False
return
False
cl_old
=
header_lines_lalapps
[
0
]
cl_old
=
header_lines_lalapps
[
0
]
if
not
helper_functions
.
match_commandlines
(
cl_old
,
cl_mfd
):
if
not
helper_functions
.
match_commandlines
(
cl_old
,
cl_mfd
):
...
@@ -329,7 +343,9 @@ transientTau = {:10.0f}\n"""
...
@@ -329,7 +343,9 @@ transientTau = {:10.0f}\n"""
return
False
return
False
else
:
else
:
logging
.
info
(
logging
.
info
(
"
File contents unmatched, updating {}.
"
.
format
(
self
.
config_file_name
)
"
File contents unmatched, updating {}.
"
.
format
(
self
.
config_file_name
)
)
)
return
True
return
True
...
@@ -392,7 +408,7 @@ transientTau = {:10.0f}\n"""
...
@@ -392,7 +408,7 @@ transientTau = {:10.0f}\n"""
self
.
sqrtSX
,
self
.
sqrtSX
,
tempory_filename
=
"
{}.tmp
"
.
format
(
self
.
label
),
tempory_filename
=
"
{}.tmp
"
.
format
(
self
.
label
),
earth_ephem
=
self
.
earth_ephem
,
earth_ephem
=
self
.
earth_ephem
,
sun_ephem
=
self
.
sun_ephem
sun_ephem
=
self
.
sun_ephem
,
)
# detectors OR IFO?
)
# detectors OR IFO?
return
twoF_expected
return
twoF_expected
...
...
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