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

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.13macOS 13.0+ x86-64

gwframe-0.1.2-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.2-cp312-cp312-manylinux_2_34_aarch64.whl (18.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.12macOS 13.0+ x86-64

gwframe-0.1.2-cp311-cp311-manylinux_2_34_x86_64.whl (18.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.11macOS 15.0+ ARM64

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

Uploaded CPython 3.11macOS 13.0+ x86-64

gwframe-0.1.2-cp310-cp310-manylinux_2_34_x86_64.whl (18.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

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

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

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

Uploaded CPython 3.10macOS 15.0+ ARM64

gwframe-0.1.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.1.2.tar.gz.

File metadata

  • Download URL: gwframe-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 b713401fcf8bbc716a5d74d4a4ca8178694d9ca0d946316135b4e0b597143af3
MD5 507972f9075b85056e579c2fc2ea3570
BLAKE2b-256 452bcc44fb96dc4262047b1e5a8cc8b4f31fcf8e09ebf5f8120c868697c96331

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.2-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c8baedf1748ac0bac58c69bf390cf82e199c91ce004401588c0acff35598556f
MD5 a4623150ac185134d5a9320e8ef40092
BLAKE2b-256 c1aa50f123c987d1ad67167658c9cd0833ee257b878329efa37f663c07f33e4d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.2-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 da38fd4698460222cdde31cab047d3691f174d7939bd202745fa60c21570aed4
MD5 f44289a4b3f05fbd10b4be46ae34c454
BLAKE2b-256 035c71e996e4ea1a0d63295b537b28206fc3fdeec519b4ad6444c3ae23c44a55

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.2-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 cc942de6ca4a33fe48db5f0325474b5bcfb5d711a4da4d9a54a6804bdcbcbb65
MD5 783f8c940cd13436aba89edf29c5f1e3
BLAKE2b-256 a022feab2513ee0605de4513b0af60a9fbf49e74ed8c7bd1ef78a7d1957fba24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.2-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 6cc833d4ecc18169c45178860d8f5ac25d0a77aad3c34d616fba4f9c7df1c98e
MD5 0fa54e841b7599720dcddf44c18b99e6
BLAKE2b-256 7e71d959f71d42f9c274d3821866b691048e03e507d66107a5b46c0e504610d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 96fd67a8bf3d40191fb299142a79a3e76451f67241c7008c6f1d4a7e23fe0a61
MD5 d309b5439bd1832d8788c046348828ce
BLAKE2b-256 50b278a85aa771e5f4575b281ff8dca934a982ff5ba8e1f42ce0de450b168608

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.2-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 66271d4d595b6c43122c7226da753201c5dbdcd3cdca5899678bce9b51e265be
MD5 41f74744c34ab7715b77d730b6079c00
BLAKE2b-256 4b1b2c9da66d9ab127ea46b04f1dd0ad7318b847f2457e5d2255ddbc92520730

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.2-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1616d8a5605aa71fe0bdee4493fb98ff00e20ceb596e0003b71bc6879cd9cabd
MD5 659b9355bae581f18c539397db94a0b9
BLAKE2b-256 5b2ba305ba9f4a6acdb693b2cffa4cc78167cf1ca5b3f1b57fb081fe57544306

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.2-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 9b636f15a7fd71ebdf88654c40fdb752d4dd2c1429857cd4cdc0ee2afce62d84
MD5 4ac7a40374ec193d30b1db60c17fae06
BLAKE2b-256 21ea1ccd6210f55ab3fbb3fc83d289216ef1410b3ec2cc4191b5106d879267f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.2-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 37c27676d88b4539af354bc4bc1b42cadd3ac21351794364efd862d1ffa6d726
MD5 e851f5fd1c870b0a92a25852106d21ff
BLAKE2b-256 fb0c60bb5aafded767589c85ccc9a9f97ea5e766855acf6dffa11848f878656a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.2-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 6bf12cc8b914bed16b65fd0a5ac06cbe8446d94500056c10b6d4ac6a986489f1
MD5 e7d9e5633c893536b3d4be5484363dc0
BLAKE2b-256 8e1486bdb0b804acabc374d265ce4321df2aa917f36126dd264629541acfc2bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.2-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 9e515764a8b7625225ff55076e4aca2c6cf3fe9e33b9039ca78504ba7f81d67c
MD5 0a568f00aa6717d04060dc7f2f246984
BLAKE2b-256 71877dc1fe16309fa1dd4c95d22b8c25ed210fabf2e50b7e6c06893f21e72d93

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.2-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 21872b4558467ecd6262c35c0997035f7a1431120bc6a9984e270a27a9db0616
MD5 76f674de659d6f2c20fb97c1796e3fc2
BLAKE2b-256 89bbe591500a0099a3e580b1722546fd7633aff011ce0390e1d119f33e913650

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.2-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ea7ee8aa163022278d90132e40cce1fc33d0f9206221095424fcea917c48ec45
MD5 fda006da15aa9475a5a6ed292f76c06c
BLAKE2b-256 7b1fe937a09d3e5fbd9e3cd719db0cd0bc0658f081071822b1333bd6c957e266

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.2-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 7f497afe7502bb9116696f0eac075e44227a0e7033db4c6969b5af6c97ed0893
MD5 7bf40ee9a0a152abb090be475ff6e4ac
BLAKE2b-256 a9f5f81ffc86cf92e0c20f10e5e91d56467ba952c3fa3ea38640b8cec910d007

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.2-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8be9a098701331a8cc1f2437cfbe8f146e00011ed84f2e05e61848cb49fcdd35
MD5 9fdcc2d7c53a0e530a2ab6013e6c730a
BLAKE2b-256 374e454404ca597c286b5e625041c1d0011e25206bb847436ce79705e83190f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gwframe-0.1.2-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 6cec1f580e5af39b7e60f7619f72b7057550bebe54b7866a76fd028e9f24b84a
MD5 18cf61b584c7815076e9d56bb0b82196
BLAKE2b-256 53eacc7aceb7f11a3156f6fbd43c0155adcfa0bca0d4d3a6325e5518395d424a

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