From ca31578f9359c5edbe9266964e113783cb64a321 Mon Sep 17 00:00:00 2001
From: David Keitel <david.keitel@ligo.org>
Date: Tue, 5 Nov 2019 11:48:54 +0000
Subject: [PATCH] ComputeFstat: extra flag computeAtoms independent of
 transientWindowType

---
 pyfstat/core.py                | 6 +++++-
 pyfstat/grid_based_searches.py | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/pyfstat/core.py b/pyfstat/core.py
index d2fb2a1..3ed1e92 100755
--- a/pyfstat/core.py
+++ b/pyfstat/core.py
@@ -384,6 +384,7 @@ class ComputeFstat(BaseSearchClass):
         SSBprec=None,
         tCWFstatMapVersion="lal",
         cudaDeviceName=None,
+        computeAtoms=False,
     ):
         """
         Parameters
@@ -405,6 +406,7 @@ class ComputeFstat(BaseSearchClass):
             allow for the Fstat to be computed over a transient range.
             ('none' instead of None explicitly calls the transient-window
             function, but with the full range, for debugging)
+            (if not None, will also force atoms regardless of computeAtoms option)
         t0Band, tauBand: int
             if >0, search t0 in (minStartTime,minStartTime+t0Band)
                    and tau in (tauMin,2*Tsft+tauBand).
@@ -439,6 +441,8 @@ class ComputeFstat(BaseSearchClass):
             'pycuda' for gpu, and some others for devel/debug.
         cudaDeviceName: str
             GPU name to be matched against drv.Device output.
+        computeAtoms: bool
+            request atoms calculations regardless of transientWindowType
 
         """
 
@@ -550,7 +554,7 @@ class ComputeFstat(BaseSearchClass):
 
         logging.info("Initialising FstatInput")
         dFreq = 0
-        if self.transientWindowType:
+        if self.transientWindowType or self.computeAtoms:
             self.whatToCompute = lalpulsar.FSTATQ_ATOMS_PER_DET
         else:
             self.whatToCompute = lalpulsar.FSTATQ_2F
diff --git a/pyfstat/grid_based_searches.py b/pyfstat/grid_based_searches.py
index cf6a982..7251013 100644
--- a/pyfstat/grid_based_searches.py
+++ b/pyfstat/grid_based_searches.py
@@ -574,6 +574,7 @@ class TransientGridSearch(GridSearch):
             assumeSqrtSX=self.assumeSqrtSX,
             tCWFstatMapVersion=self.tCWFstatMapVersion,
             cudaDeviceName=self.cudaDeviceName,
+            computeAtoms=self.outputAtoms,
         )
         self.search.get_det_stat = self.search.get_fullycoherent_twoF
 
-- 
GitLab