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
|
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) –
FrequencySeriesorFrequencySeriesDictclass to instantiate.budget_or_model (gwinc.Budget or str) – Pre-loaded
Budgetobject, or a model name string (e.g.,"aLIGO","Aplus") which is passed togwinc.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:FrequencySeriescls → total noise only.FrequencySeriesDictcls → 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_nameis given, orclsisFrequencySeries.FrequencySeriesDict – When
trace_nameis None andclsisFrequencySeriesDict. Keys:"Total", plus sub-trace names.
- Raises:
ValueError – If
trace_namedoes not exist in the budget trace hierarchy, or ifquantityis 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")