get_backend#

gwpy.io.gwf.get_backend(
package: str = 'gwpy.io.gwf',
backends: list[str] = ['frameCPP', 'LALFrame'],
) str[source]#

Return the preferred GWF backend.

This can be configured via the GWPY_FRAME_LIBRARY environment variable, which can be set to the name of any of the interface modules defined under gwpy.io.gwf (or the module path given by package):

  • "frameCPP"

  • "FrameL"

  • "LALFrame"

Otherwise that list is manually searched in the order given above.

Parameters:
packagestr

The package under which to attempt to install a GWF backend module.

backendslist of str

The list of backends to try, defaults to the list of backends implemented in gwpy.io.gwf.backend.

Examples

If the environment variable GWPY_FRAME_LIBRARY is set:

>>> os.environ["GWPY_FRAME_LIBRARY"] = "FrameL"
>>> from gwpy.io.gwf import get_backend
>>> get_backend()
'FrameL'

Or, if you have LDAStools.frameCPP installed:

>>> from gwpy.io.gwf import get_backend
>>> get_backend()
'frameCPP'

Or, if you don’t have lalframe:

>>> get_backend()
'LALFrame'

Otherwise:

>>> get_backend()
ImportError: no GWF API available, please install a third-party GWF
library (frameCPP, FrameL, LALFrame) and try again