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.1.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.1-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.1-cp313-cp313-manylinux_2_34_aarch64.whl (18.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.13macOS 13.0+ x86-64

gwframe-0.2.1-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.1-cp312-cp312-manylinux_2_34_aarch64.whl (18.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.12macOS 13.0+ x86-64

gwframe-0.2.1-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.1-cp311-cp311-manylinux_2_34_aarch64.whl (18.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.11macOS 13.0+ x86-64

gwframe-0.2.1-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.1-cp310-cp310-manylinux_2_34_aarch64.whl (18.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.10macOS 15.0+ ARM64

gwframe-0.2.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.2.1.tar.gz.

File metadata

  • Download URL: gwframe-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 2d63a928a746ce5510590e5bf58aef019972d11e04516886ce13fb350a002d58
MD5 e8ad24a657179fe5be69c7eae28bc339
BLAKE2b-256 5f39d1ef54980a2e060cb4fc58d4fb85ca52fb4c9fd777e272452480a544e550

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.2.1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8c29eb9a2fe5d8062d52cf17bf4d14328a0865c844745dd64eace1e2b7fcb568
MD5 6f339b17f862f0e3ccc9b236be576f89
BLAKE2b-256 226614b9107c19461f1a5fbac39fba388cdccf691491709dcece4121089f5663

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.2.1-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 47304f24b42a4ca5c8e09644df237aaf02e7b1e7b4a9ece08083d2dc0d5bb93a
MD5 3aa611cb69ddb966edc6a5a8c1342db1
BLAKE2b-256 05707642a9c42841702ba6bc5f122b417cba03d55888acc05ea5925796ef0b96

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.2.1-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1a02f9a377fc2ebc034f5f5be0f4ae76a3d9386331d93ab43a07faddbbfebc69
MD5 b16a083ba039b62baf8525027be1194a
BLAKE2b-256 d4cb14fb46d9fbb80e28a4f3bd3fa62712e4f00dcf6398f4b93e138c9569a03c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.2.1-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 e92504c0d95abfed9e09e602aa8b5a9bd4b5d3d5efec12bf8e88c09de8a7953c
MD5 8fbaeca1c0a956763e9cdfbf4c63473c
BLAKE2b-256 9b98bf45b583a519bf9b741e219498f90c566b682a2e1ba85f0a2f64ca9af27a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.2.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 af552a136805c03bab67f502ff7adc6a2cad73a22bfe7f1e3987f529398e7192
MD5 4621ef428fa21eb10922ab12ed93634a
BLAKE2b-256 8ac9e83e812155dae8bb4e311a6182206181ea60c6b4be24e99ec230403e9121

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.2.1-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 d5597cac0b1a009f1232c2b1425edf8f8929de14386c0d2d3eab4c6eb2d22c68
MD5 b0bd6e74c421722f4576fabb8788d36d
BLAKE2b-256 3dae1962607ae10736037a73ed71397922601aa6e8678cbe4eab070c0fe26d7e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.2.1-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a7a6f513e5128f59e7fc908c68dc955daf24a54a73af074b256afde83b7dace6
MD5 7da899beadaaa6f816f09d8166bc0bea
BLAKE2b-256 8368fefd922ea189ef21960e29416f18b09d0ef6c73afe428a689b976646811f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.2.1-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 1add6c4c834733f6876d57dd210998dd9966d4c9bb621bc7cfc7097096107f18
MD5 3e71c7d9a7b16a6be4dbfeddc21b965d
BLAKE2b-256 05a17373bb10c77beb49fb2654f8a4c37180f5f368b3c204c06e4fa6118927db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.2.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2fc8950c79aa4c06b51d9217e2a7ce05e1de565f7d5899c981ed0d18ecedcbd6
MD5 28c77402b53a912b4dd59997d38f0afa
BLAKE2b-256 89f61d396e1bd0461ae03ebd4616f746e149dc41a684a242734fbc64f01db302

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.2.1-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 9f1b5b75b04af4a0e00272612f8e4ce2a2044c7688d4114c503c986ceaf451b4
MD5 7f0bfd32baa7c1e244055c3952edade0
BLAKE2b-256 724d335624872d14696ab2a0210b1713a2bf8489d07282070064494d5ebe5d0b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.2.1-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 f731ee45e910c86a62296f0a0ecf97df2f51abc2e3ef99c96c2c53f5b24df2ac
MD5 78b80ed8018284feda874efd4c44d0a0
BLAKE2b-256 c58c83af6d93285df05ba755b02b1f105702b00796e7485f101d74fc4c4b05e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.2.1-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 06743b8436f73b2f467e9d23fa862b88c8198204bdd54012940c932f0d9d9759
MD5 a3744dcc64d413b273c5146949519063
BLAKE2b-256 320183266e2ec050bb5c421fb9f80a7c8e5491352f0d43e1a1532d1978bacc69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.2.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 472afeb723ca3944433ad61f6292630e8de9fea1c0baedbbf313281f54c272fb
MD5 afa75e24cb75b82e516807cf03437fb5
BLAKE2b-256 c4b01a29b23ade52c1ab5323bf9d813698643d8de44a3c85dbb95cc001ec6dd8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.2.1-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 0ecbe0006c5d555490d54e686a16a55fd0fdd75cd85c3832be9ef742f7987282
MD5 cb7fbf8fd870aa9e2c3c7b8b95dc5166
BLAKE2b-256 383fba3c79b3292ce6bb77384fe9e3d28fc1796691eaa85d3de95bb904eccbb3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.2.1-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 9e55425ce116147dded392ac10a9c736760c45ed762ae097a38f56a99f2ec84f
MD5 f1de722a77897ed8a48164f526348714
BLAKE2b-256 813346db99f47716ed7548fdde26c2116c1665dfb6ead215324be26a2b66527e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.2.1-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 fffa1ccd1733ce494312ff5a7d60012e61cefe1cfb89b01dc200d494ec67a8d6
MD5 0ae33e342a0df2ed4db441bd6be8d9e7
BLAKE2b-256 dc8a5ee397a5c6d70c87119255829ac34936c16f484662c19493effb18f77e7b

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