template_bank_generator_HM.TemplateBank.closest_coeff#

Back to Class page

Summary#

Return the values of the coefficients in coeff_grid that most closely match some input coefficients. Similar to rounding to the grid spacing, but accounts for offset and the grid needn’t be uniform or rectangular, e.g. if nonphysical templates have been removed.

Signature#

def closest_coeff(coeffs, coeff_grid)
Input variables#

Name

Type

Default

Description

coeffs

n_wfs x n_dims array with the coefficients of a number of waveforms

coeff_grid

n_templates x n_dims array with the coefficients of the templates in the bank. Doesn’t need to be a regular grid

Output variables#

Return annotation

Docstring type

Description

None

Docstring#

Return the values of the coefficients in coeff_grid that most
closely match some input coefficients. Similar to rounding to the
grid spacing, but accounts for offset and the grid needn't be uniform
or rectangular, e.g. if nonphysical templates have been removed.
:param coeffs:
    n_wfs x n_dims array with the coefficients of a number of waveforms
:param coeff_grid:
    n_templates x n_dims array with the coefficients of the templates in
    the bank. Doesn't need to be a regular grid