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
30b42fab
Commit
30b42fab
authored
6 years ago
by
David Keitel
Browse files
Options
Downloads
Patches
Plain Diff
smarter ephemerides finding, including from $LALPULSAR_DATADIR
parent
30d6aaa1
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!18
ephemerides finding improvement
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pyfstat/helper_functions.py
+22
-4
22 additions, 4 deletions
pyfstat/helper_functions.py
with
22 additions
and
4 deletions
pyfstat/helper_functions.py
+
22
−
4
View file @
30b42fab
...
@@ -92,6 +92,8 @@ def set_up_command_line_arguments():
...
@@ -92,6 +92,8 @@ def set_up_command_line_arguments():
def
get_ephemeris_files
():
def
get_ephemeris_files
():
"""
Returns the earth_ephem and sun_ephem
"""
"""
Returns the earth_ephem and sun_ephem
"""
config_file
=
os
.
path
.
expanduser
(
'
~
'
)
+
'
/.pyfstat.conf
'
config_file
=
os
.
path
.
expanduser
(
'
~
'
)
+
'
/.pyfstat.conf
'
env_var
=
'
LALPULSAR_DATADIR
'
please
=
'
Please provide the ephemerides paths when initialising searches.
'
if
os
.
path
.
isfile
(
config_file
):
if
os
.
path
.
isfile
(
config_file
):
d
=
{}
d
=
{}
with
open
(
config_file
,
'
r
'
)
as
f
:
with
open
(
config_file
,
'
r
'
)
as
f
:
...
@@ -101,11 +103,27 @@ def get_ephemeris_files():
...
@@ -101,11 +103,27 @@ def get_ephemeris_files():
for
item
in
[
'
'
,
"'"
,
'"'
,
'
\n
'
]:
for
item
in
[
'
'
,
"'"
,
'"'
,
'
\n
'
]:
v
=
v
.
replace
(
item
,
''
)
v
=
v
.
replace
(
item
,
''
)
d
[
k
]
=
v
d
[
k
]
=
v
try
:
earth_ephem
=
d
[
'
earth_ephem
'
]
earth_ephem
=
d
[
'
earth_ephem
'
]
sun_ephem
=
d
[
'
sun_ephem
'
]
sun_ephem
=
d
[
'
sun_ephem
'
]
except
:
logging
.
warning
(
'
No [earth/sun]_ephem found in
'
+
config_file
+
'
.
'
+
please
)
earth_ephem
=
None
sun_ephem
=
None
elif
env_var
in
os
.
environ
.
keys
():
earth_ephem
=
os
.
path
.
join
(
os
.
environ
[
env_var
],
'
earth00-40-DE421.dat.gz
'
)
sun_ephem
=
os
.
path
.
join
(
os
.
environ
[
env_var
],
'
sun00-40-DE421.dat.gz
'
)
if
not
(
os
.
path
.
isfile
(
earth_ephem
)
and
os
.
path
.
isfile
(
sun_ephem
)
):
earth_ephem
=
os
.
path
.
join
(
os
.
environ
[
env_var
],
'
earth00-19-DE421.dat.gz
'
)
sun_ephem
=
os
.
path
.
join
(
os
.
environ
[
env_var
],
'
sun00-19-DE421.dat.gz
'
)
if
not
(
os
.
path
.
isfile
(
earth_ephem
)
and
os
.
path
.
isfile
(
sun_ephem
)
):
logging
.
warning
(
'
No [earth/sun]00-[19/40]-DE421 ephemerides
'
'
found in the
'
+
os
.
environ
[
env_var
]
+
'
directory.
'
+
please
)
earth_ephem
=
None
sun_ephem
=
None
else
:
else
:
logging
.
warning
(
'
No
~/.pyfstat.
conf
file
found please provide the
'
logging
.
warning
(
'
No
'
+
conf
ig_
file
+
'
file or $
'
+
env_var
+
'
environment
'
'
paths when initialising searches
'
)
'
variable found.
'
+
please
)
earth_ephem
=
None
earth_ephem
=
None
sun_ephem
=
None
sun_ephem
=
None
return
earth_ephem
,
sun_ephem
return
earth_ephem
,
sun_ephem
...
...
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