diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3cfa083381ff560f165f1a74d12445f5ce1c1f25 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# 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` + diff --git a/pyfstat.py b/pyfstat.py index 50e655d4985ec1ca2cbc5e2e71292ea6c55b7467..d1c7186c3ca207751eb14f5acca2291e31849d15 100755 --- a/pyfstat.py +++ b/pyfstat.py @@ -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