Interop / Conversion Guide#
This page is the dedicated interop guide for gwexpy.
Here, interop means conversion and bridging centered on to_*() / from_*() APIs.
This page covers:
object conversion via
to_*()/from_*()bridges to external libraries and external data models
object-level file-bridge helpers
asymmetric conversion APIs
conversions that apply only to some classes
This page does not cover:
Class.read(..., format=...)obj.write(..., format=...)the choice of local file formats themselves
For local file formats and direct .read() / .write() / fetch() paths, see the File I/O Supported Formats Guide.
Direct I/O Names#
These are the canonical direct-I/O format names used by gwexpy.
Legacy aliases remain supported during the transition, but new examples should prefer the canonical spellings below.
Canonical name |
Legacy aliases |
Typical direct-I/O entry points |
External package / schema |
|---|---|---|---|
|
|
|
ObsPy |
|
|
|
|
|
|
|
ndscope HDF5 schema |
|
|
|
DiagGUI / DTT XML |
Jump Links#
How to Read This Page#
If you want to convert a live object to a storage format or container, start with A.
If you want to convert to analysis objects such as pandas, xarray, astropy, or dask, start with B.
If you want to hand data to PyTorch, TensorFlow, JAX, or CuPy, start with C.
If you want to connect to ROOT, ObsPy, LAL, PyCBC, or other domain-specific libraries, start with D.
If you want to move Field objects into xarray, NetCDF4, or Zarr workflows via
to_*()/from_*(), treat that as interop, not as direct I/O.
S. Foundation Layer#
This layer names the libraries that provide the numerical and gravitational-wave context for the rest of the page. It is not a ranking by usage statistics.
Library |
Role in the GWexpy ecosystem |
Interop note |
|---|---|---|
Base time-series and frequency-series ecosystem |
GWexpy extends its object model rather than treating it as an optional conversion target. |
|
Array representation and numerical routines |
Foundation for many public APIs; no dedicated round-trip row is implied. |
|
Units, time, and astronomy-oriented object conventions |
The explicit |
|
Gravitational-wave time and frequency series conventions |
The explicit LAL conversion APIs are listed in D. |
Status Labels#
Public: implemented and reachable fromreference/api/interopImplemented: implemented, but the page still needs concrete navigation or reference polishImplemented, some paths still in progress: the main route works, but some conversion paths are still incompleteIn progress: the implementation or the public presentation is not finished yetPlanned: explicitly in scope, but not implemented yet
Optional Dependency Policy#
Interop bridges import optional runtime backends lazily. If a runtime backend is
missing, the bridge raises ImportError with installation guidance instead of
importing the backend at import gwexpy time.
Some import-only adapters consume objects or dictionaries that were produced by
external packages, but do not import those producer packages themselves. For
example, from_pyoma_results(), from_mtspec(), from_mtspec_array(),
from_uff_dataset55(), from_uff_dataset58(), the from_sdynpy_*(),
from_metpy_dataarray(), from_wrf_variable(), and from_harmonica_grid()
helpers accept caller-supplied pyOMA, multitaper, mtspec, pyuff, SDynPy-style,
MetPy-enhanced, wrf-python, or Harmonica objects. Install those packages when
you need to create the source objects, not because the adapter imports them
directly.
Policy |
Dependencies |
Install guidance |
|---|---|---|
Declared GWexpy extras |
|
Install the matching extra from PyPI as described in the Installation Guide, for example |
Bare package installs |
|
Install the named backend directly when the bridge imports it or when you need it to create accepted source objects. |
gwexpy[all] installs the declared GWexpy extras as a convenience bundle. It
does not install every public interop backend; entries in the bare package row
still require direct backend installs when the bridge imports the backend or
when you need to create accepted source objects.
The xarray-backed interop bridges list the netcdf4 extra because GWexpy does
not currently publish a standalone xarray extra. If you only need in-memory
xarray conversion and want to avoid installing netCDF4, install xarray
directly.
A. Storage Formats and Container Conversion#
This section is for conversions where the target is a file format, container, or storage representation. Use it when the question is “what storage representation do I bridge to?”
Purpose: identify object-level bridges whose target is a storage representation
Input: a
gwexpyobject plus a destination container or storage backendOutput: a converted object, container, or storage-facing representation via
to_*()/from_*()
Target |
API / Entry |
Status |
Notes |
Details |
|---|---|---|---|---|
|
Public |
object-level conversion |
||
HDF5 FrequencySeries |
|
Public |
FrequencySeries HDF5 helpers |
|
JSON |
|
Public |
JSON string conversion |
|
Python dict |
|
Public |
dict conversion |
— |
|
Public |
object-level bridge |
||
|
Public |
array/store bridge |
||
|
Public |
object-level bridge |
B. Analysis Library and Object Conversion#
This section is for conversions where the target is a Python object model rather than a storage format. Use it when the question is “which analysis-library object do I bridge to?”
Purpose: pick the correct bridge into analysis-oriented Python objects
Input: a
gwexpyobject or an external analysis object such as pandas, xarray, or astropyOutput: an analysis-library object or a reconstructed
gwexpyobject
Target |
API / Entry |
Status |
Notes |
Details |
|---|---|---|---|---|
NumPy |
no dedicated |
Implemented as infrastructure |
widely used as the internal array basis |
— |
|
Public |
Series / DataFrame |
||
pandas FrequencySeries |
|
Public |
FrequencySeries ⇔ pandas.Series |
|
|
Public |
Series / DataFrame / dict / FrequencySeries |
||
|
Public |
DataArray / Dataset |
||
xarray Field |
|
Public |
ScalarField / VectorField |
|
xarray FrequencySeries |
|
Public |
FrequencySeries ⇔ xarray.DataArray |
|
|
Public |
|
||
|
Public |
dask array bridge |
C. Scientific Computing, Signal Processing, Machine Learning, and Array Backends#
This section is for accelerated computing and ML-oriented bridges. Check whether only the array payload moves, or whether metadata can also be reconstructed.
Purpose: decide whether an ML or accelerated-array bridge matches your workflow
Input: a
gwexpyobject and an ML / GPU / array backend targetOutput: tensors or accelerated arrays, and in some cases a route back into
gwexpy
Target |
API / Entry |
Status |
Notes |
Details |
|---|---|---|---|---|
|
Public |
tensor conversion |
||
PyTorch Dataset |
|
Public |
windowed dataset for training |
|
|
Public |
tensor conversion |
||
|
Public |
JAX array conversion |
||
|
Public |
GPU array conversion |
||
|
Public |
audio-feature export; it sits between analysis objects and ML workflows, and is grouped here primarily for the latter |
||
|
Public |
room-acoustics simulation and array-processing workflows |
D. Physics and Domain-Specific Libraries#
This section is for domain-specific libraries and specialized objects. Read the status carefully: some targets are full round-trips, some are mainly import paths, and some are still being organized publicly. The material-science and life-science entries are not lower-value domains: they provide routes for future method transfer and for research such as material thermal-noise studies.
Purpose: find bridges into domain-specific tools without confusing them with direct file I/O
Input: a
gwexpyobject or a domain-library object such as ObsPy, ROOT, LAL, or PyCBCOutput: a target-library object, imported data, or a partial round-trip depending on status
Target |
API / Entry |
Status |
Notes |
Details |
|---|---|---|---|---|
|
Implemented, some paths still in progress |
|
||
|
Public |
seismic bridge |
||
|
Public |
GW time / frequency series |
||
|
Public |
GW time / frequency series |
||
|
Public |
budget import |
||
|
Public |
optics / response |
||
|
Public |
FRD / response. Requires the |
||
|
Public |
geophysics |
||
|
Public |
magnetotellurics |
||
MTpy |
dedicated |
In progress |
MTH5-adjacent organization is incomplete |
— |
|
Public |
EEG / biosignal |
||
|
Public |
electrophysiology |
||
Elephant |
dedicated |
In progress |
organization with |
— |
|
Public |
quantity bridge |
||
|
Public |
audio object bridge |
||
|
Public |
astronomy spectra |
||
|
Public |
spectral analysis |
||
PySpice |
|
Public |
mainly import |
|
|
Public |
RF network analysis |
||
|
Public |
mainly import |
||
multitaper |
|
Public |
mainly import |
|
mtspec |
|
Public |
mainly import |
|
pySDy |
|
Public |
mainly import |
|
SDynPy |
|
Public |
mainly import |
|
Meep |
|
Public |
mainly import |
|
openEMS |
|
Public |
mainly import |
|
emg3d |
|
Public |
EM field import/export |
|
meshio |
|
Public |
mainly import |
|
MetPy |
|
Public |
mainly import |
|
WRF |
|
Public |
mainly import |
|
Harmonica |
|
Public |
mainly import |
|
Exudyn |
|
Public |
mainly import |
|
OpenSees |
|
Public |
mainly import |
Next to Read#
File I/O Supported Formats Guide if your real question is about
Class.read(..., format=...)orobj.write(...)GPS Time Utility Functions if conversion workflows depend on GPS or timezone handling
Interop tutorial for worked examples before dropping into the API reference