Skip to main content

High-level Python library to work with gravitational-wave frame (GWF) files, based on framecpp

Project description

gwframe

High-level Python library to work with gravitational-wave frame (GWF) files, based on framecpp

ci license documentation pypi version


Resources

Installation

With pip:

pip install gwframe

Pre-built wheels are available for:

Platform Architecture Minimum Version
Linux x86_64, aarch64 glibc 2.34 (e.g., Debian 12, Ubuntu 21.10, Fedora 35, RHEL 9)
macOS x86_64 macOS 13 (Ventura)
macOS ARM64 macOS 15 (Sequoia)

With conda:

conda install -c conda-forge gwframe

Features

  • Multi-frame writing - Write multiple frames to a single file
  • Multi-channel support - Read all channels or specific lists with a single call
  • Self-contained wheels - No external dependencies required for pip installation

Quickstart

Reading frames

import gwframe

# Read single channel
data = gwframe.read('data.gwf', 'L1:GWOSC-16KHZ_R1_STRAIN')
print(f"Read {len(data.array)} samples at {data.sample_rate} Hz")
print(f"Time range: {data.start} to {data.start + data.duration}")

# Read all channels
channels = gwframe.read('data.gwf', channels=None)
for name, timeseries in channels.items():
    print(f"{name}: {len(timeseries.array)} samples")

# Time-based slicing (automatically stitches multiple frames)
data = gwframe.read('multi_frame.gwf', 'L1:STRAIN',
                    start=1234567890.0, end=1234567900.0)

Writing single frames

import gwframe
import numpy as np

data = np.random.randn(16384)
gwframe.write('output.gwf', data, start=1234567890.0,
              sample_rate=16384, name='L1:TEST')

Writing multiple frames

import gwframe
import numpy as np

# Write multiple frames to a single file
with gwframe.FrameWriter('multi_frame.gwf') as writer:
    for i in range(20):
        data = np.random.randn(16384)
        writer.write(data, start=1234567890.0 + i,
                     sample_rate=16384, name='L1:TEST')

Inspecting frames

import gwframe

# Get frame information
info = gwframe.get_info('data.gwf')
print(f"Number of frames: {info.num_frames}")
for frame in info.frames:
    print(f"Frame {frame.index}: {frame.name} at GPS {frame.start}, duration {frame.duration}s")

# List all channels
channels = gwframe.get_channels('data.gwf')
num_channels = len(channels)
for channel in channels:
    print(channel)

Advanced: Full control with Frame objects

import gwframe
import numpy as np

# Create frame with multiple channels and metadata
frame = gwframe.Frame(
    start=1234567890.0,
    duration=1.0,
    name='L1',
    run=1
)

# Add channels
strain = np.random.randn(16384)
frame.add_channel('L1:STRAIN', strain,
                  sample_rate=16384,
                  unit='strain',
                  channel_type='proc')

aux = np.random.randn(1024).astype(np.float32)
frame.add_channel('L1:AUX', aux,
                  sample_rate=1024,
                  unit='counts',
                  channel_type='adc')

# Add metadata
frame.add_history('gwframe', 'Created with gwframe')

# Write with custom compression
frame.write('output.gwf', compression=gwframe.Compression.GZIP)

CLI Tools

gwframe includes a command-line interface for common frame manipulation tasks:

# Rename channels
gwframe rename input.gwf -o output.gwf -m "L1:OLD=>L1:NEW"

# Combine channels from multiple files
gwframe combine file1.gwf file2.gwf -o output/

# Keep only specific channels
gwframe select input.gwf -o output.gwf -c L1:STRAIN

# Remove unwanted channels
gwframe drop input.gwf -o output.gwf -c L1:UNWANTED

# Change frame duration
gwframe resize input.gwf -o output/ -d 4.0

# Replace NaN or sentinel values
gwframe impute input.gwf -o output.gwf --fill-value 0.0

# Update channel data from another file
gwframe replace base.gwf --update new.gwf -o output/ -c L1:STRAIN

# Change compression settings
gwframe recompress input.gwf -o output.gwf -c GZIP -l 9

All commands support batch processing with directories and glob patterns. See the CLI documentation for detailed usage and examples.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gwframe-0.2.2.tar.gz (6.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gwframe-0.2.2-cp313-cp313-manylinux_2_34_x86_64.whl (18.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

gwframe-0.2.2-cp313-cp313-manylinux_2_34_aarch64.whl (18.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

gwframe-0.2.2-cp313-cp313-macosx_15_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

gwframe-0.2.2-cp313-cp313-macosx_13_0_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gwframe-0.2.2-cp312-cp312-manylinux_2_34_x86_64.whl (18.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

gwframe-0.2.2-cp312-cp312-manylinux_2_34_aarch64.whl (18.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

gwframe-0.2.2-cp312-cp312-macosx_15_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

gwframe-0.2.2-cp312-cp312-macosx_13_0_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gwframe-0.2.2-cp311-cp311-manylinux_2_34_x86_64.whl (18.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

gwframe-0.2.2-cp311-cp311-manylinux_2_34_aarch64.whl (18.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

gwframe-0.2.2-cp311-cp311-macosx_15_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

gwframe-0.2.2-cp311-cp311-macosx_13_0_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

gwframe-0.2.2-cp310-cp310-manylinux_2_34_x86_64.whl (18.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

gwframe-0.2.2-cp310-cp310-manylinux_2_34_aarch64.whl (18.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

gwframe-0.2.2-cp310-cp310-macosx_15_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

gwframe-0.2.2-cp310-cp310-macosx_13_0_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

File details

Details for the file gwframe-0.2.2.tar.gz.

File metadata

  • Download URL: gwframe-0.2.2.tar.gz
  • Upload date:
  • Size: 6.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for gwframe-0.2.2.tar.gz
Algorithm Hash digest
SHA256 7c537c24bd31e0b9b6aa25d4b2f3d2a5e951fcd372c8880f4cb663e045122348
MD5 8c17dc7328a03a6d0b1642ba5ffc8c60
BLAKE2b-256 82582979702114f27a0574d48f7fff93024b4bc12bbe95e196d14a8727297d32

See more details on using hashes here.

File details

Details for the file gwframe-0.2.2-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for gwframe-0.2.2-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 90e3f81b2f2fa1d4867d29bf9f8f52546f6eb4f6de08146e450adff85333c052
MD5 0cd6cd4d70179870af03550cb3959012
BLAKE2b-256 0cf181922b5efa00af65b8fe28353e539c4a78660ab3166bb306dbb458d76c30

See more details on using hashes here.

File details

Details for the file gwframe-0.2.2-cp313-cp313-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for gwframe-0.2.2-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 c106911009353a41c64aaf87f2ce9dfac7346d4510071d7c0a6fa27aa731bec7
MD5 b80adce95c5ceb89de88372478412a2f
BLAKE2b-256 88958d046416402ef0700a020fad26dac1ebf36b84514538d8ffb2676aa44436

See more details on using hashes here.

File details

Details for the file gwframe-0.2.2-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gwframe-0.2.2-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 71e42fd6f268e9f8088f44301ebc8fc784893df81147923121c21cb9a4b884eb
MD5 4a8752102fc4deeaec2ddfa53c194071
BLAKE2b-256 14d71db5e19c82c643926ce12f9b3fe9a0bf8256746285d050707f91a5d16e12

See more details on using hashes here.

File details

Details for the file gwframe-0.2.2-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gwframe-0.2.2-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 a57def4a431a90efdb1cb41549c2a6b4b5a2bb0eea6b53681930245cc66fd293
MD5 fbb16eece6b28c264c57f8f9cdd4f04f
BLAKE2b-256 813d7f325bf26db87c1ad99ff8e2c6d6886ee6b21e7d8f9b6873339f33cf6231

See more details on using hashes here.

File details

Details for the file gwframe-0.2.2-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for gwframe-0.2.2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 21754fe865e2b47ebb4ab5fd49c7c2c2a5afee4cf08a5c39ed0e2719989d6f69
MD5 6b364889e4848e61ce0e94c7e1a32245
BLAKE2b-256 90493b8f6315a4ea12a4362d09261ce83a6769b9605d235950532d11f6e0b190

See more details on using hashes here.

File details

Details for the file gwframe-0.2.2-cp312-cp312-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for gwframe-0.2.2-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 fcef4c42b46124a375f0405281f8450ce258568d3b6eab876446587babe899bb
MD5 eff163f092fb3b01f2fd71a9e6d54eca
BLAKE2b-256 3cc1134a60ddb6b70251cfa1e287e6d62eb1ffd4b3eea6a5b67c6b4f2a363885

See more details on using hashes here.

File details

Details for the file gwframe-0.2.2-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gwframe-0.2.2-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 f74086dfa3b607cd5f20a78d67c56c4ec8f69220216a9bfa2d04e2e02617372c
MD5 6805a554bf3da14f2d792cceeabb5633
BLAKE2b-256 01cd7cce2571c2c666d99dd02845d69be141dedd8f91ee007bb140e2cf057f41

See more details on using hashes here.

File details

Details for the file gwframe-0.2.2-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gwframe-0.2.2-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 fddba10e61455c9cadc81177927757ac5bd9774c32d022c04624a89f481480e9
MD5 2b9b23035731f1973e12ab0f980a7505
BLAKE2b-256 12e0cf63cc0f579ccbf97374c2f8d874d73c8d5e0c888f9ef11c2932891839eb

See more details on using hashes here.

File details

Details for the file gwframe-0.2.2-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for gwframe-0.2.2-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0731f108e34be79321328fc1999c1cbfe9cc83d7cba0308a0c421289dcf49e30
MD5 9751ea0b44d3e991eee836807aebfcc1
BLAKE2b-256 93eb6be59ddd4bba2a43c0ca96dd7600911b3d882372ee9f58557cb79d04d322

See more details on using hashes here.

File details

Details for the file gwframe-0.2.2-cp311-cp311-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for gwframe-0.2.2-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 0193056c402a1af1de81acdfc7180958a1f08a1cbfc182331a222aaad31b317e
MD5 1ab49f33532c6b379080d6b9d60b3d78
BLAKE2b-256 4a206f3e98d156bc3faa1b08f9a02e3521f6d7a845fb3c253c68f96ded73c341

See more details on using hashes here.

File details

Details for the file gwframe-0.2.2-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gwframe-0.2.2-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7769a5ab7e29f16caca078fe52fb6b24b2f2f5f34c189dc983a2de88164697e0
MD5 9a7d03496a0b917846fe588d7e7a376f
BLAKE2b-256 3e1bdd05d327333a626f176ec2f6af674f75bb870288bd3be3f23ec5eee1d643

See more details on using hashes here.

File details

Details for the file gwframe-0.2.2-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gwframe-0.2.2-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 14dad3854dba05089fc3962d5e28b1723870f49fd3833eeee72518e69d1fd276
MD5 6c9e0a16eba100110eb1b97075de7c39
BLAKE2b-256 56d9bc61c3daf3d56848c0650518a342ec74255e0a113d07715d8300eb791685

See more details on using hashes here.

File details

Details for the file gwframe-0.2.2-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for gwframe-0.2.2-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4257d98546dbbfa914c63d7ea6ab24358adc5b5b69a553cb30c21c4e09b34f27
MD5 38aa1080ea1547753ed827d8ff325e7c
BLAKE2b-256 2a1de92e4e02829d7c05277252b13d910b12b5b0959209817c7beeeaf6f2b367

See more details on using hashes here.

File details

Details for the file gwframe-0.2.2-cp310-cp310-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for gwframe-0.2.2-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 7ae1e69a8c315f72a547e5a06b97b47965205db2cd615e7929f6f9ec8e66c348
MD5 84c2004faf6a9d3d7ce3e9a75062ebad
BLAKE2b-256 66afab02def6db954a89483e78aa044e267d8e632642c1a21cc965829a26676d

See more details on using hashes here.

File details

Details for the file gwframe-0.2.2-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gwframe-0.2.2-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 88f4079f9d834a80ea9dd5154e8753b7614b2ba418dc19563bd953c93d7787b4
MD5 500a7a4c4d5d1a7389365d3b66d2ea0c
BLAKE2b-256 bd48eb5c22b8a4cb64a8bd0709ed2c1a4e4326a61ab990afdf4daf6dfea9b985

See more details on using hashes here.

File details

Details for the file gwframe-0.2.2-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gwframe-0.2.2-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 3087cf3dd0bb3b421511ecd5bb92b0c330fccd01e2c2c2798b89bf337160aecd
MD5 1cc9fec74d7c651df57fcf87955a10cb
BLAKE2b-256 721b9f525e9ba6c4efb266b7976601399e76ad157b5cd6f2d2cbcd5af3fc6a82

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page