Convert scientific Python objects#
Use to_*() and from_*() when converting an object already in memory.
Use file I/O when reading or writing a local file.
The conversion catalogue records the
supported classes, directions, optional dependencies, and metadata boundaries.
Start with an array#
from gwexpy.timeseries import TimeSeries
signal = TimeSeries([0.0, 1.0, 0.0, -1.0], sample_rate=4, t0=0, unit="V")
values = signal.value
The array contains values; keep signal.sample_rate, signal.t0, and signal.unit
when exporting to a representation that cannot preserve them. The
Scientific Python tutorial shows the complete
array-to-container workflow without requiring GWpy knowledge.
Use a library-specific bridge#
Follow the interoperability tutorial for worked
pandas, xarray, and external-library conversions. Install the dependencies listed
for the selected bridge and check which metadata survives the round trip.
For migrating legacy ROOT macros (TGraphErrors, TF1) to pure Python without CERN ROOT dependencies, follow the ROOT to Python Migration tutorial.
For control-system plots, use a measured or modelled complex transfer response with the correct input/output units. An ASD or PSD describes noise amplitude or power; converting its container does not turn it into a system response.
Detailed capabilities#
The former catalogue sections remain available through these links.