to_lal_type_str#

gwpy.utils.lal.to_lal_type_str(pytype: type | DTypeLike | str | int) str[source]#

Convert the input python type to a LAL type string.

Raises:
ValueError

If the input doesn’t map to a LAL type string.

Examples

To convert a python type:

>>> from gwpy.utils.lal import to_lal_type_str
>>> to_lal_type_str(float)
'REAL8'

To convert a numpy.dtype:

>>> import numpy
>>> to_lal_type_str(numpy.dtype('uint32'))
'UINT4'

To convert a LAL type code:

>>> to_lal_type_str(11)
'REAL8'