pygwtf.fresnel.search_kernels#
Functions#
|
Sum the per-segment statistics to get the semi-coherent statistic (upsilon). |
|
GPU wrapper for the semi-coherent statistic sum. Each thread computes the semi-coherent statistic for a single source. |
|
CPU wrapper for the semi-coherent statistic sum. Each source is processed sequentially. |
|
Constructor method used to generate a kernel function for computing the semi-coherent detection statistic directly per source. |
Module Contents#
- pygwtf.fresnel.search_kernels.semi_coherent_statistic_sum(src_num, statistics, N_seg, segment_end_inds, segment_start_inds)#
Sum the per-segment statistics to get the semi-coherent statistic (upsilon). NOTE: Unused right now, used to post-process the per-segment statistics computed by the original kernel, but for now we compute the semi-coherent statistic directly in the kernel.
- Args:
src_num (int): Index of the source for which to compute the statistic. statistics (array): Array of shape (n_sources, n_time_bins, 2) containing the per-segment statistics (d|h and h|h). N_seg (int): Number of segments that were summed over to get each per-segment statistic. segment_end_inds (array): Array of shape (n_sources,) containing the end indices of the segments for each source. segment_start_inds (array): Array of shape (n_sources,) containing the start indices of the segments for each source.
- Returns:
statistic: Array of shape (n_sources,) containing the semi-coherent statistic for each source.
- pygwtf.fresnel.search_kernels.semi_coherent_statistic_sum_gpu_wrap(statistics, N_seg, segment_end_inds, segment_start_inds, search_statistic)#
GPU wrapper for the semi-coherent statistic sum. Each thread computes the semi-coherent statistic for a single source. NOTE: This is currently unused, as we compute the semi-coherent statistic directly in the kernel.
Parameters:#
- statistics: array (n_sources, n_time_bins, 2)
Array containing the per-segment statistics (d|h and h|h) for each source and time-segment.
- N_seg: int
Number of segments that were summed over to get each per-segment statistic.
- segment_end_inds: array (n_sources,)
Array containing the end indices of the segments for each source.
- segment_start_inds: array (n_sources,)
Array containing the start indices of the segments for each source.
- search_statistic: array (n_sources,) (filled in within the kernel)
Array to be filled in with the semi-coherent statistic for each source.
- pygwtf.fresnel.search_kernels.semi_coherent_statistic_sum_cpu_wrap(statistics, N_seg, segment_end_inds, segment_start_inds, search_statistic)#
CPU wrapper for the semi-coherent statistic sum. Each source is processed sequentially. NOTE: This is currently unused, as we compute the semi-coherent statistic directly in the kernel.
Parameters:#
- statistics: array (n_sources, n_time_bins, 2)
Array containing the per-segment statistics (d|h and h|h) for each source and time-segment.
- N_seg: int
Number of segments that were summed over to get each per-segment statistic.
- segment_end_inds: array (n_sources,)
Array containing the end indices of the segments for each source.
- segment_start_inds: array (n_sources,)
Array containing the start indices of the segments for each source.
- search_statistic: array (n_sources,) (filled in within the function)
Array to be filled in with the semi-coherent statistic for each source.
- pygwtf.fresnel.search_kernels.analytic_kernel_constructor_semi_coherent(config: dict, _get_amplitude: Callable, _get_phi_f_fdot: Callable, _get_channels: Callable)#
Constructor method used to generate a kernel function for computing the semi-coherent detection statistic directly per source.
Unlike analytic_kernel_constructor, this constructor builds kernels that evaluate the semi-coherent detection statistic in a single pass, without first storing a full (n_sources, nT, 2) array of per-time-bin inner products. The time-segments for each source are divided into Nseg sub-segments, and the semi-coherent statistic is accumulated as sum_seg(|d_h_seg|^2 / h_h_seg.real).
NOTE: TDI-2 only – the semi-coherent search kernel does not support waveform-polarization output mode.
Parameters:#
- config: dict
Configuration dictionary containing the following keys: - dT: float, the duration of each time segment. - nF: int, the number of frequency bins. - dF: float, the width of each frequency bin. - kernel_width: int, the number of frequency bins on either side of the central frequency to include in the kernel computation. - nparams: int, the number of parameters describing each source. This is used to allocate local arrays in the GPU kernel.
Following are waveform specific functions, and can be substituted for any waveform written in the same format. _get_amplitude: Callable
Function that takes in time, frequency, frequency derivative, and source parameters, and returns the amplitude of h_22 at that time.
- _get_phi_f_fdot: Callable
Function that takes in time and source parameters, and returns the phase, frequency, and frequency derivative of h_22 at that time.
Generalised “Response function/Channel construction” method. Frequency domain response function can in principle be substituted for any response function in the frequency domain (within time-segment). _get_channels: Callable
Function that takes in frequency-domain (within each time-segment) waveforms, in the format h_lm and transforms to TDI channels using the detector response.
- kernel_cpu: Callable
A CPU kernel function that can be called to compute the per-source semi-coherent statistic.
- kernel_gpu: Callable
A GPU kernel function that can be called to compute the per-source semi-coherent statistic.
Returns:#
- kernel_cpu: Callable
A CPU kernel function that can be called to compute the per-source semi-coherent statistic.
- kernel_gpu: Callable
A GPU kernel function that can be called to compute the per-source semi-coherent statistic.