Skip to main content

A python writer for SeisSol xdmf output

Project description

seissolxdmfwriter

A python module to write seissol outputs readable by paraview.

import seissolxdmfwriter as sxw
import seissolxdmf as sx
import numpy as np

fn = "test-fault.xdmf"
# Read data from input file using seissolxdmf
sx = sx.seissolxdmf(fn)
geom = sx.ReadGeometry()
connect = sx.ReadConnect()
dt = sx.ReadTimeStep()
outputTimes = sx.ReadTimes()

SRs = sx.ReadData("SRs")
SRd = sx.ReadData("SRs")
SR = np.sqrt(SRs**2 + SRd**2)

# Write the 0,4 and 8th times steps of array SRs and SR in SRtest-fault.xdmf/SRtest-fault.h5
dictTime = {outputTimes[i]: i for i in [0, 4, 8]}
sxw.write(
    "test-fault",
    geom,
    connect,
    {"SRs": SRs, "SR": SR},
    dictTime,
    reduce_precision=True,
    backend="hdf5",
)

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

seissolxdmfwriter-0.2.1.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file seissolxdmfwriter-0.2.1.tar.gz.

File metadata

  • Download URL: seissolxdmfwriter-0.2.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for seissolxdmfwriter-0.2.1.tar.gz
Algorithm Hash digest
SHA256 de5f2d8d4b866bf8ac2261a61a2160fe440ff977f94a923a324a622149841da8
MD5 e8e41dda2132aec5090cbd2cac96d696
BLAKE2b-256 150514d25a9bc3b4a2e227afb6c2416975a3c237c0e1e52bce70395792063664

See more details on using hashes here.

Supported by

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