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

Adds README.md 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 setup.py 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](http://dan.iel.fm/emcee/current/)[^1]
* [corner](https://pypi.python.org/pypi/corner/)[^1]
* [dill](https://pypi.python.org/pypi/dill)[^1]
[^1]: Most easily installed using either `conda` or `pip`
......@@ -18,12 +18,20 @@ import corner
import dill as pickle
import lalpulsar
try:
from ephemParams import earth_ephem, sun_ephem
except (IOError, ImportError):
logging.warning('No ephemParams.py 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']
else:
logging.warning('No ~/.pyfstat.conf file found please provide the paths '
'when initialising searches')
earth_ephem = None
sun_ephem = None
......
Markdown is supported
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