開発版ドキュメント · 0.2.3 30c2f8ba · 入門例の検証対象 0.2.3 · 版情報 · 既知の制限

gwexpy.interop.lal_#

Interoperate with LALSuite time and frequency series.


Interoperability with LALSuite (LIGO Algorithmic Library).

Provides bidirectional conversion between LALSuite time/frequency series types and GWexpy TimeSeries / FrequencySeries.

メモ

GWpy already inherits from_lal / to_lal classmethods for TimeSeries and FrequencySeries via GWpy. This module provides an explicit interop layer that ensures GWexpy types are returned and adds to_lal for FrequencySeries.

Functions

from_lal_frequencyseries(cls, lalfs, *[, copy])

Create a GWexpy FrequencySeries from a LAL FrequencySeries struct.

from_lal_timeseries(cls, lalts, *[, copy])

Create a GWexpy TimeSeries from a LAL TimeSeries struct.

to_lal_frequencyseries(fs)

Convert a GWexpy FrequencySeries to a LAL FrequencySeries struct.

to_lal_timeseries(ts, *[, dtype])

Convert a GWexpy TimeSeries to a LAL TimeSeries struct.

gwexpy.interop.lal_.from_lal_timeseries(cls: type[T_ts], lalts: Any, *, copy: bool = True) T_ts#

Create a GWexpy TimeSeries from a LAL TimeSeries struct.

パラメータ:
  • cls (type) -- The TimeSeries class to instantiate.

  • lalts (lal.REAL4TimeSeries or lal.REAL8TimeSeries or lal.COMPLEX8TimeSeries or lal.COMPLEX16TimeSeries) -- LAL time series struct.

  • copy (bool, default True) -- Whether to copy the underlying data array.

戻り値:

GWexpy TimeSeries with epoch, sample rate and unit from the LAL struct.

戻り値の型:

TimeSeries

サンプル

>>> import lal
>>> from gwexpy.timeseries import TimeSeries
>>> lalts = lal.CreateREAL8TimeSeries("test", lal.LIGOTimeGPS(0), 0, 1/1024, lal.DimensionlessUnit, 1024)
>>> ts = TimeSeries.from_lal(lalts)
gwexpy.interop.lal_.to_lal_timeseries(ts: TimeSeries, *, dtype: str | None = None) Any#

Convert a GWexpy TimeSeries to a LAL TimeSeries struct.

パラメータ:
  • ts (TimeSeries) -- GWexpy TimeSeries to convert.

  • dtype (str, optional) -- LAL type string (e.g., "REAL8", "COMPLEX16"). If None, inferred from the array dtype.

戻り値:

LAL time series struct.

戻り値の型:

lal.REAL8TimeSeries or similar

サンプル

>>> from gwexpy.timeseries import TimeSeries
>>> import numpy as np
>>> ts = TimeSeries(np.zeros(1024), t0=0, dt=1/1024, name="test")
>>> lalts = ts.to_lal()
gwexpy.interop.lal_.from_lal_frequencyseries(cls: type[T_fs], lalfs: Any, *, copy: bool = True) T_fs#

Create a GWexpy FrequencySeries from a LAL FrequencySeries struct.

パラメータ:
  • cls (type) -- The FrequencySeries class to instantiate.

  • lalfs (lal.REAL8FrequencySeries or lal.COMPLEX16FrequencySeries) -- LAL frequency series struct.

  • copy (bool, default True) -- Whether to copy the underlying data array.

戻り値:

GWexpy FrequencySeries with f0, df, epoch and unit from the LAL struct.

戻り値の型:

FrequencySeries

gwexpy.interop.lal_.to_lal_frequencyseries(fs: FrequencySeries) Any#

Convert a GWexpy FrequencySeries to a LAL FrequencySeries struct.

パラメータ:

fs (FrequencySeries) -- GWexpy FrequencySeries to convert.

戻り値:

LAL frequency series struct.

戻り値の型:

lal.REAL8FrequencySeries or similar