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("SRd")
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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

seissolxdmfwriter-0.2.2-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file seissolxdmfwriter-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for seissolxdmfwriter-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d9d1bdff25b68eff6c8caa11f4cc6d0b7eff64886a1cd1a4892193a088a955e6
MD5 2d3dd4d793866c37b418de75db8bce20
BLAKE2b-256 ef5475ac6a751ecc9ec037310a20793fab1162204845d85305d44fba08258672

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