inspect
File inspection and metadata functions.
get_channels ¶
Get a list of all channels in a GWF file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str or path - like
|
Path to the GWF file |
required |
Returns:
| Name | Type | Description |
|---|---|---|
channels |
list[str]
|
List of all channel names |
Examples:
>>> channels = gwframe.get_channels('data.gwf')
>>> print(f"Found {len(channels)} channels")
>>> for channel in channels:
... print(channel)
Source code in gwframe/inspect.py
get_info ¶
get_info(filename: str | PathLike[str]) -> FrameFileInfo
Get metadata about a GWF file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str or path - like
|
Path to the GWF file |
required |
Returns:
| Name | Type | Description |
|---|---|---|
info |
FrameFileInfo
|
Structured metadata containing: - num_frames: number of frames in file - channels: list of all channel names - frames: list of FrameInfo objects with complete frame metadata |
Examples:
>>> info = gwframe.get_info('data.gwf')
>>> print(f"File contains {info.num_frames} frames")
>>> print(f"Frame 0: {info.frames[0].name} at GPS {info.frames[0].t0}")
>>> print(f"Channels: {', '.join(info.channels)}")