Commit 87426577 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Adds and change the way ephemeris files are specified

parent 18bb2b22
# PyFstat
This is a python package containing basic wrappers of the `lalpulsar` module
with capabilities to perform a variety of searches, primarily focussing on
semi-coherent glitch searches.
## Installation
The script can be installed system wide via
python install
or simply add this directroy to your python path
### Ephemeris installation
The scripts require a path to ephemeris files in order to use the
`lalpulsar.ComputeFstat` module. This can either be specified when initialsing
each search, or more simply by playing a file `~/pyfstat.conf` in your home
directory which looks like
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'
where this uses the default ephemeris files provided with `lalsuite`.
### Dependencies
* swig-enabled lalpulsar, a minimal configuration is given by
./configure --prefix=${HOME}/lalsuite-install --disable-all-lal --enable-lalpulsar --enable-lalapps --enable-swig
* [emcee]([^1]
* [corner]([^1]
* [dill]([^1]
[^1]: Most easily installed using either `conda` or `pip`
......@@ -18,12 +18,20 @@ import corner
import dill as pickle
import lalpulsar
from ephemParams import earth_ephem, sun_ephem
except (IOError, ImportError):
logging.warning('No file found, or it does not contain '
'earth_ephem and sun_ephem, please provide the paths when '
'initialising searches')
config_file = os.path.expanduser('~')+'/.pyfstat.conf'
if os.path.isfile(config_file):
d = {}
with open(config_file, 'r') as f:
for line in f:
k, v = line.split('=')
k = k.replace(' ', '')
v = v.replace(' ', '')
d[k] = v
earth_ephem = d['earth_ephem']
sun_ephem = d['sun_ephem']
logging.warning('No ~/.pyfstat.conf file found please provide the paths '
'when initialising searches')
earth_ephem = None
sun_ephem = None
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment