pygwtf.generator
================

.. py:module:: pygwtf.generator


Attributes
----------

.. autoapisummary::

   pygwtf.generator.THREADS_PER_BLOCK


Classes
-------

.. autoapisummary::

   pygwtf.generator.AnalyticTimeFrequencyWaveform


Module Contents
---------------

.. py:data:: THREADS_PER_BLOCK
   :value: 128


.. py:class:: AnalyticTimeFrequencyWaveform(model_class: Type[pygwtf.models.base.AnalyticModel], config: dict, prescription: str = 'fresnel', backend: str | pygwtf.backend.Backend = 'cpu', tdi_type: int | None = None, channels: numpy.ndarray | None = None, psds: numpy.ndarray | None = None, spacecraft_orbits: numpy.ndarray | None = None, spacecraft_ltts: numpy.ndarray | None = None)

   Analytic time-frequency waveform generator.

   Constructs generative kernels of the chosen prescription (only Fresnel currently supported)
   for both waveform generation and inner-product evaluation in the time-frequency domain,
   driven by a physical model. CPU or GPU operation is specified by the chosen backend.

   Parameters
   ----------
   model_class:
       The model class to instantiate (e.g. ``TaylorT2Ecc``).  Initialised
       inside this constructor with the chosen backend.
   config : dict
       Kernel configuration, with kwargs specific to the prescription used.
   prescription : str, optional
       The prescription to use for the kernel construction. Only ``'fresnel'`` is
       currently supported.
   backend : str or Backend, optional
       Compute backend — ``'cpu'`` (default) or ``'gpu'``.
   tdi_type : {None, 2}, optional
       TDI generation order.  ``None`` produces TT polarisations.
       ``2`` produces second-generation TDI.
   channels : array_like, optional
       Pre-computed data array of shape ``(nT, nF, n_channels)
       ``. Required for statistic evaluation if not supplied at call time.
   psds : array_like, optional
       Pre-computed PSD array of shape ``(nT, nF, n_channels)
       ``. Required for statistic evaluation if not supplied at call time.
   spacecraft_orbits : array_like, optional
       Pre-computed spacecraft orbits array of shape ``(nT, 3,
       3)``. Required for TDI generation if not supplied at initialisation, in which case analytic orbits will be used.
   spacecraft_ltts: array_like, optional
       Pre-computed spacecraft light travel times array of shape ``(nT, 3)``.
       Required for TDI generation if not supplied at initialisation, in which case will be calculated analytically from positions
       (Need in metre units not seconds)


   .. py:attribute:: backend


   .. py:attribute:: model


   .. py:attribute:: config


   .. py:attribute:: t_tranche


   .. py:attribute:: f_tranche


   .. py:attribute:: tdi_type
      :value: None



   .. py:attribute:: spacecraft_orbits
      :value: None



   .. py:attribute:: spacecraft_ltts
      :value: None



   .. py:attribute:: channels
      :value: None



   .. py:attribute:: psds
      :value: None



   .. py:method:: waveform_kernel(n_sources, *args)

      Call waveform kernel for the selected backend.

      NOTE: There are no explicit returns from this function as the kernels are filling in the pre-allocated output arrays. 

      Parameters
      ----------
      n_sources : int
          Number of sources to process, used to determine GPU grid size if applicable.
      *args : tuple
          Arguments to pass to the kernel, excluding n_sources which is passed separately for GPU grid sizing.
          See the kernel construction functions for details on the expected arguments.



   .. py:method:: statistic_kernel(n_sources, *args)

      Active statistic kernel for the selected backend.
         Only returns the per-segment d_h and h_h values.

      NOTE: There are no explicit returns from this function as the kernels are filling in the pre-allocated output arrays.

      Parameters
      ----------
      n_sources : int
          Number of sources to process, used to determine GPU grid size if applicable.
      *args : tuple
          Arguments to pass to the kernel, excluding n_sources which is passed separately for GPU grid sizing.
          See the kernel construction functions for details on the expected arguments.    



   .. py:method:: semi_coherent_statistic_kernel(n_sources, *args)

      Active direct semi-coherent statistic kernel for the selected backend.
         Returns the final semi-coherent statistic value per source, after summing over segments internally in the kernel.
         NOTE: Only really used for the SoBBH search 

      Parameters
      ----------
      n_sources : int
          Number of sources to process, used to determine GPU grid size if applicable.
      *args : tuple
          Arguments to pass to the kernel, excluding n_sources which is passed separately for GPU grid sizing
          See the kernel construction functions for details on the expected arguments.



