Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PyFstat
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
David Keitel
PyFstat
Commits
7c696c1b
Commit
7c696c1b
authored
Aug 07, 2018
by
Gregory Ashton
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'find-ephems' into 'master'
ephemerides finding improvement See merge request
GregAshton/PyFstat!18
parents
30d6aaa1
68b4cddc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
7 deletions
+28
-7
README.md
README.md
+6
-3
pyfstat/helper_functions.py
pyfstat/helper_functions.py
+22
-4
No files found.
README.md
View file @
7c696c1b
...
@@ -97,8 +97,11 @@ the module will be installed to whichever python executable you call it from.
...
@@ -97,8 +97,11 @@ the module will be installed to whichever python executable you call it from.
### Ephemeris installation
### Ephemeris installation
The scripts require a path to ephemeris files in order to use the
The scripts require paths to earth and sun ephemeris files in order to use the
`lalpulsar.ComputeFstat`
module. This can either be specified when initialising
`lalpulsar.ComputeFstat`
module. This should be automatically picked up from
the $LALPULSAR_DATADIR environment variable, defaulting to the
00-40-DE421 ephemerides or 00-19-DE421 as a backup.
Alternatively, these can either be manually specified when initialising
each search (as one of the arguments), or simply by placing a file
each search (as one of the arguments), or simply by placing a file
`~/.pyfstat.conf`
into your home directory which looks like
`~/.pyfstat.conf`
into your home directory which looks like
...
@@ -106,7 +109,7 @@ each search (as one of the arguments), or simply by placing a file
...
@@ -106,7 +109,7 @@ each search (as one of the arguments), or simply by placing a file
earth_ephem = '/home/<USER>/lalsuite-install/share/lalpulsar/earth00-19-DE421.dat.gz'
earth_ephem = '/home/<USER>/lalsuite-install/share/lalpulsar/earth00-19-DE421.dat.gz'
sun_ephem = '/home/<USER>/lalsuite-install/share/lalpulsar/sun00-19-DE421.dat.gz'
sun_ephem = '/home/<USER>/lalsuite-install/share/lalpulsar/sun00-19-DE421.dat.gz'
```
```
here, we use the default ephemeris files provided with
`lalsuite`
.
Paths set in this way will take precedence over the environment variable
.
### Contributors
### Contributors
...
...
pyfstat/helper_functions.py
View file @
7c696c1b
...
@@ -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
'
+
config_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
...
...
Write
Preview
Markdown
is supported
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