gwexpy.interop.gwinc_

gwexpy.interop.gwinc

Interoperability with pygwinc (gravitational wave interferometer noise budget).

Provides conversion from a gwinc Budget trace hierarchy to GWexpy FrequencySeries (total noise) or FrequencySeriesDict (all sub-traces).

Notes

The simpler gwexpy.noise.gwinc_.from_pygwinc helper (strain/DARM only) is preserved unchanged. This module adds the richer trace-expansion API.

Functions

from_gwinc_budget(cls, budget_or_model, *[, ...])

Create FrequencySeries or FrequencySeriesDict from a gwinc Budget.

gwexpy.interop.gwinc_.from_gwinc_budget(cls: type, budget_or_model: Any, *, frequencies: ndarray | None = None, quantity: Literal['asd', 'psd'] = 'asd', trace_name: str | None = None, fmin: float = 10.0, fmax: float = 4000.0, df: float = 1.0) Any[source]

Create FrequencySeries or FrequencySeriesDict from a gwinc Budget.

Parameters:
  • cls (type) – FrequencySeries or FrequencySeriesDict class to instantiate.

  • budget_or_model (gwinc.Budget or str) – Pre-loaded Budget object, or a model name string (e.g., "aLIGO", "Aplus") which is passed to gwinc.load_budget.

  • frequencies (array-like, optional) – Frequency array in Hz. If None, generated from fmin/fmax/df.

  • quantity ({"asd", "psd"}, default "asd") – Whether to return amplitude or power spectral density.

  • trace_name (str, optional) –

    Name of a specific sub-trace to extract (e.g., "Quantum"). If None:

    • FrequencySeries cls → total noise only.

    • FrequencySeriesDict cls → total + all sub-traces.

  • fmin (float, default 10.0) – Minimum frequency [Hz] when frequencies is not provided.

  • fmax (float, default 4000.0) – Maximum frequency [Hz] when frequencies is not provided.

  • df (float, default 1.0) – Frequency step [Hz] when frequencies is not provided.

Returns:

  • FrequencySeries – When trace_name is given, or cls is FrequencySeries.

  • FrequencySeriesDict – When trace_name is None and cls is FrequencySeriesDict. Keys: "Total", plus sub-trace names.

Raises:
  • ValueError – If trace_name does not exist in the budget trace hierarchy, or if quantity is not "asd" or "psd".

  • ImportError – If pygwinc is not installed.

Examples

>>> from gwexpy.frequencyseries import FrequencySeries, FrequencySeriesDict
>>> asd = FrequencySeries.from_gwinc_budget("aLIGO")
>>> noise_budget = FrequencySeriesDict.from_gwinc_budget("aLIGO")
>>> quantum = FrequencySeries.from_gwinc_budget("aLIGO", trace_name="Quantum")