Interop / Conversion Guideο
Page Role: 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 |
At a Glanceο
Item |
Details |
|---|---|
Audience |
Users and contributors who need to move |
Prerequisites |
Basic familiarity with |
Use Cases |
Choose a |
Search Keywords |
interop, conversion, |
Search hints: interop, conversion, to_*, from_*, xarray, pandas, ROOT, Zarr, NetCDF4, PyTorch
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.
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 |
|
Until PyPI publication, use the source-install extra syntax from the Installation Guide, such as |
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. Machine Learning, Acceleration, 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 |
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.
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 |
room acoustics |
||
|
Public |
audio object bridge |
||
|
Public |
mainly export |
||
|
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 |
What to Prioritize Firstο
The following targets are especially important because they sit close to the direct-I/O boundary or because they are high-value public entry points:
ROOT:
io_formatskeeps only EventTable direct I/O; ROOT object conversion belongs herexarray / Field: the main route for ScalarField / VectorField bridges
Zarr: easy to confuse with direct I/O, so the boundary matters
NetCDF4: needs a clean line between direct I/O and xarray-backed workflows
ObsPy: common and easy-to-understand round-trip examples
pandas / polars / astropy: frequent analysis entry points
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