Skip to content
Snippets Groups Projects
Commit 62dffe7a authored by David Keitel's avatar David Keitel
Browse files

make_sfts.py: more ephemeris handling fixes

 -add missing self.set_ephemeris_files() call to GlitchWriter.__init__()
 -also write out to CLA in FrequencyModulatedArtifactWriter.run_makefakedata_v4()
 -use getattr for safety
parent 59f8d6f4
Branches
Tags
1 merge request!25ephemerides handling fixes
...@@ -350,10 +350,12 @@ transientTau = {:10.0f}\n""" ...@@ -350,10 +350,12 @@ transientTau = {:10.0f}\n"""
cl_mfd.append("--Tsft={}".format(self.Tsft)) cl_mfd.append("--Tsft={}".format(self.Tsft))
if self.h0 != 0: if self.h0 != 0:
cl_mfd.append('--injectionSources="{}"'.format(self.config_file_name)) cl_mfd.append('--injectionSources="{}"'.format(self.config_file_name))
if self.earth_ephem is not None: earth_ephem = getattr(self, "earth_ephem", None)
cl_mfd.append('--ephemEarth="{}"'.format(self.earth_ephem)) sun_ephem = getattr(self, "sun_ephem", None)
if self.sun_ephem is not None: if earth_ephem is not None:
cl_mfd.append('--ephemSun="{}"'.format(self.sun_ephem)) cl_mfd.append('--ephemEarth="{}"'.format(earth_ephem))
if sun_ephem is not None:
cl_mfd.append('--ephemSun="{}"'.format(sun_ephem))
cl_mfd = " ".join(cl_mfd) cl_mfd = " ".join(cl_mfd)
...@@ -439,6 +441,7 @@ class GlitchWriter(Writer): ...@@ -439,6 +441,7 @@ class GlitchWriter(Writer):
see `lalapps_Makefakedata_v5 --help` for help with the other paramaters see `lalapps_Makefakedata_v5 --help` for help with the other paramaters
""" """
self.set_ephemeris_files()
self.basic_setup() self.basic_setup()
self.calculate_fmin_Band() self.calculate_fmin_Band()
...@@ -758,6 +761,12 @@ class FrequencyModulatedArtifactWriter(Writer): ...@@ -758,6 +761,12 @@ class FrequencyModulatedArtifactWriter(Writer):
cl_mfd.append("--h0={}".format(h0)) cl_mfd.append("--h0={}".format(h0))
cl_mfd.append("--cosi={}".format(self.cosi)) cl_mfd.append("--cosi={}".format(self.cosi))
cl_mfd.append("--lineFeature=TRUE") cl_mfd.append("--lineFeature=TRUE")
earth_ephem = getattr(self, "earth_ephem", None)
sun_ephem = getattr(self, "sun_ephem", None)
if earth_ephem is not None:
cl_mfd.append('--ephemEarth="{}"'.format(earth_ephem))
if sun_ephem is not None:
cl_mfd.append('--ephemSun="{}"'.format(sun_ephem))
cl_mfd = " ".join(cl_mfd) cl_mfd = " ".join(cl_mfd)
helper_functions.run_commandline(cl_mfd, log_level=10) helper_functions.run_commandline(cl_mfd, log_level=10)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment