diff --git a/pyfstat/make_sfts.py b/pyfstat/make_sfts.py index fda5b60b8d4c8458922ab87d58e7281ac0e0fd4c..5088c2750c882403592e1b468ac60446d133a4cf 100644 --- a/pyfstat/make_sfts.py +++ b/pyfstat/make_sfts.py @@ -92,9 +92,9 @@ class Writer(BaseSearchClass): self.make_cff() self.run_makefakedata() - def get_single_config_line(self, i, Alpha, Delta, h0, cosi, psi, phi, F0, - F1, F2, tref, window, tstart, duration_days): - template = ( + def get_base_template(self, i, Alpha, Delta, h0, cosi, psi, phi, F0, + F1, F2, tref): + return ( """[TS{}] Alpha = {:1.18e} Delta = {:1.18e} @@ -105,13 +105,34 @@ phi0 = {:1.18e} Freq = {:1.18e} f1dot = {:1.18e} f2dot = {:1.18e} -refTime = {:10.6f} +refTime = {:10.6f}""") + + def get_single_config_line_cw(self, i, Alpha, Delta, h0, cosi, psi, phi, F0, + F1, F2, tref): + template = (self.get_base_template(i, Alpha, Delta, h0, cosi, psi, phi, F0, + F1, F2, tref) + """\n""") + return template.format(i, Alpha, Delta, h0, cosi, psi, phi, F0, F1, + F2, tref) + + def get_single_config_line_tcw(self, i, Alpha, Delta, h0, cosi, psi, phi, F0, + F1, F2, tref, window, tstart, duration_days): + template = (self.get_base_template(i, Alpha, Delta, h0, cosi, psi, phi, F0, + F1, F2, tref) + """ transientWindowType = {:s} transientStartTime = {:10.3f} transientTauDays = {:1.3f}\n""") return template.format(i, Alpha, Delta, h0, cosi, psi, phi, F0, F1, F2, tref, window, tstart, duration_days) + def get_single_config_line(self, i, Alpha, Delta, h0, cosi, psi, phi, F0, + F1, F2, tref, window, tstart, duration_days): + if window=='none': + return self.get_single_config_line_cw(i, Alpha, Delta, h0, cosi, psi, phi, F0, + F1, F2, tref) + else: + return self.get_single_config_line_tcw(i, Alpha, Delta, h0, cosi, psi, phi, F0, + F1, F2, tref, window, tstart, duration_days) + def make_cff(self): """ Generates a .cff file