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

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.t0} to {data.t0 + data.duration}")

# Read all channels
channels = gwframe.read('data.gwf', channel=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, t0=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, t0=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.t0}, 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(
    t0=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/

# 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.1.1.tar.gz (6.2 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.1.1-cp313-cp313-manylinux_2_34_x86_64.whl (18.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

gwframe-0.1.1-cp313-cp313-manylinux_2_34_aarch64.whl (18.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.13macOS 13.0+ x86-64

gwframe-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl (18.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

gwframe-0.1.1-cp312-cp312-manylinux_2_34_aarch64.whl (18.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.12macOS 13.0+ x86-64

gwframe-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl (18.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

gwframe-0.1.1-cp311-cp311-manylinux_2_34_aarch64.whl (18.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.11macOS 13.0+ x86-64

gwframe-0.1.1-cp310-cp310-manylinux_2_34_x86_64.whl (18.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

gwframe-0.1.1-cp310-cp310-manylinux_2_34_aarch64.whl (18.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.10macOS 15.0+ ARM64

gwframe-0.1.1-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.1.1.tar.gz.

File metadata

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

File hashes

Hashes for gwframe-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c3d1fe19befd8cec5979e9d0c45896e2bf5e0dbab24215e1bb315ba005605a23
MD5 d43c764d352c419c8b480482fb9c424c
BLAKE2b-256 ea7efe9bd02b4d7b116d4b7b9c72777dd35b016972b37566020e1d55848f5706

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f1915cb8ca9f3951f932b5def374a9fab3747dc0c50dd19a77a5f1dbf70d5a65
MD5 2859d2fe0cbcc2d303e29dfd95f2aad8
BLAKE2b-256 ef226ad05e79c2e4cdb281ab92210b20ef91cf6ada74543ba0916d795cda747a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.1-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 e1db51c471662be6fcddb73a85db18917dfc1d5a415ee11247e6e312dd909854
MD5 6c99bffe11f27896907a04e7eb1f27e7
BLAKE2b-256 dfb9b2c9efdfc2cee1a847ce6ac2339c672c608708acfbcc1243e662f807f6d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.1-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 757c02f74fba347036d03145fad0fea70a9dee7b00607afb95031cf2fa0f8ac1
MD5 7bc89794d3664a3b6eb00dac400ee50b
BLAKE2b-256 4442c440d43a1fbe56de37b9fb0360b2c1c4782d8fc9d6093bb3875087c26f38

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.1-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 6c8aea028a6940910d48b8e899a0d934c6145ea212eb1df41659a35eb7270a8e
MD5 072fcc783022fa3106a64806f50ff429
BLAKE2b-256 623060286dda4107ab36579c6c9a6d80058158f8353688a625ad029fd45528f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 098e595be7918c42432b9a5def4cf07b1bb1f9f6c953373be0cbb715ca115eb1
MD5 f889f932018bdf38d50aac197bbdb8e4
BLAKE2b-256 3659f5b4a2751dd1bdc032635ab1f541c881b8ab0d90d9cce853af25777a15d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.1-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 a9c8eaeb2d1719f23fff454b1ef88e1df675ace2ad66f137dea23290e9481d20
MD5 24a4fcd1f1c8b45e7fba9588a88f5fd8
BLAKE2b-256 a832a4bef3cdd3d2da3e66b83f2ba73aa5c745974c8617b46da26469c0341f6c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.1-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 0b14a1a1740933a5ecd2f5a5f2e56e7e05b43c3cddb60fedae56e7df3f77eace
MD5 09a0422b2b762a0a1ea897c51555488b
BLAKE2b-256 9dcd0354aa2f8dd1b9b0b6ae0851f1f32c961fa00eccca7204e2d6311871d317

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.1-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 4dfcfe3f36c3a02ba49dca4d7ab1d6b5e2e12cbf4d8af72035363c25d1b8173e
MD5 7b1c1f6c765b507098157ddc43db30a5
BLAKE2b-256 6f86ddc12b690b98b111a7b6aed6a32e65629f3abe8086c1184eb6a8375cb49f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7fdc77d47caf8e9c5b789f6613e37979c1f5a1fc21c523009822abf7cb83b208
MD5 20546e022fc3cccc9e59365cdf4d1d82
BLAKE2b-256 0e9d2af06602899a5f0bbdc4d859678666a3a6b8b920ded5b4a7407840c29590

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.1-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 200c53a74ebd585c223575e878c46979c6a5edfd9cbd0013e0246eb47476d991
MD5 c616a6c732760ea83b85813a4a563722
BLAKE2b-256 886e2d766e592bf9988041369ba9513ab5df246e51b0ddd3d88f69fd3ad84e27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.1-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1288507a64c1af253859cde461db3fa5f45a6d4d0adfeb151e28890f8b0a85f3
MD5 779f6c86661f950df7d66d3adfe55e87
BLAKE2b-256 b3b15d9e18612c5c6971c5ffb108ed18e38b223394df0f6acb138e1434228f38

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.1-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 653687ddda11d3296fcc304b0952faea4049eb9de3caa0e4c3281d0907d44a73
MD5 74c242a74706816cbd0589c5b29751ae
BLAKE2b-256 ea4698b0328b515e86a04c211d798b4e74915ccd86173a5b5c1d5df9fd3d8be5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 de13b17f3232f4e640bb870d449233a4ddb6fbf139fddf7680decb3876ddc7e4
MD5 3c5c42b907c3ba178b2445f648136bdd
BLAKE2b-256 9d528912abdd2de6123c37d70e323637b0163618289a1b7ffa7ccba24045060c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.1-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 a652d3e7fd85396f68517371227dc77655655da16dd89c0bbaf2c0dfe5513358
MD5 74613b2cf6ce7c12afd1af1411523b32
BLAKE2b-256 4450f3d27cae5c665ad7f0c205ba321c08848722d627e028140d985b8d86d80a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.1-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d2722b456df46dac74fd99d4e244033a27cad7564042756232c6046a6ac712f6
MD5 1a2fc741202e086d8f916e9910a5f661
BLAKE2b-256 0bf0b75ba6fd878d697d10568471d7d28d61a2802589e4601f58587ae211b93c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.1-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 357be13e673c13328fa9e35faa3cd31b3eff48b56b452044b1582eda812a01ae
MD5 bf68092f0d7f88e663f3be0efcd1e855
BLAKE2b-256 f8814fbfee94e64874cb76c16e828013f5364619cae9d7095c2924565f8c2175

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