template_bank_generator_HM.TemplateBank.is_physical#

Back to Class page

Summary#

Checks if the given calphas are physical, i.e. that they are in the trimmed grid that remove_nonphysical_templates outputs

Signature#

def is_physical(self, calpha, delta_calpha, fudge, force_zero, override_physical_grid = None)
Input variables#

Name

Type

Default

Description

calpha

An array of template bank components, with shape either (n_components) or (n_trial_points, n_components).

delta_calpha

Resolution of calphas

fudge

A safety factor to inflate the range of used values of each parameter

force_zero

Flag indicating whether to force 0 to be a gridpoint

override_physical_grid

None

Pass a precomputed physical grid if available, speeds up background collection on multiple files

Output variables#

Return annotation

Docstring type

Description

None

Bool if a single set of calphas is passed, or array of bools of len(n_trial_points) if many are passed.

Docstring#

Checks if the given calphas are physical, i.e. that they are in
the trimmed grid that remove_nonphysical_templates outputs

Note that in order to return True the calphas must lie exactly on the
grid generated by (delta_calpha, fudge, force_zero), to within a small
tolerance ~ 1e-5 << delta_calpha.

:param calpha: An array of template bank components, with shape either
               (n_components) or (n_trial_points, n_components).
:param delta_calpha: Resolution of calphas
:param fudge: A safety factor to inflate the range of used values of
              each parameter
:param force_zero: Flag indicating whether to force 0 to be a gridpoint
:param override_physical_grid:
    Pass a precomputed physical grid if available, speeds up background
    collection on multiple files
:returns: Bool if a single set of calphas is passed, or array of bools
          of len(n_trial_points) if many are passed.