Skip to main content

PSOut Reader & Writer

A reader/writer for the PSCAD *.psout file

Examples

Reading

import mhi.psout
import matplotlib.pyplot as plt

with mhi.psout.File('Cigre.psout') as file:

    ac_voltage = file.call("Root/Main/AC Voltage/0")
    run = file.run(0)

    for call in ac_voltage.calls():
        trace = run.trace(call)
        time = trace.domain
        plt.plot(time.data, trace.data, label=trace['Description'])

    plt.xlabel(time['Unit'])
    plt.ylabel(trace['Unit'])
    plt.legend()
    plt.show()

Writing

from math import sin, cos, pi
from mhi.psout import File, OpenType, PageSize

with File('SinCos.psout', open_type=OpenType.CREATE_OVERWRITE,
          page_size=PageSize.PS_1024) as file:

    # Create Call Tree
    root = file.make_pscad_root()
    time_call = file.make_pscad_domain(1234567, 'PGB')
    module = root.add_module(200, "Trig Funcs")
    sin_call = module.add_pgb_call(201, "Sine")
    cos_call = module.add_pgb_call(202, "Cosine")

    # Create a "time" samples for all runs
    time = [0.001 * i for i in range(201)]

    for freq in (50, 60):
        run = file.add_run(Description=f"{freq} Hertz sin waves")
        w = 2 * pi * freq

        # Time domain
        time_trace = run.add_pscad_domain(time_call, unit='s', data=time)

        # Create "sin" and "cos" traces
        sine = [sin(w*t) for t in time]
        cosine = [cos(w*t) for t in time]

        run.add_pscad_trace(sin_call, 'Trig', domain=time_trace, data=sine)
        run.add_pscad_trace(cos_call, 'Trig', domain=time_trace, data=cosine)

Documentation

See: py -m mhi.psout help

Release files for mhi-psout 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mhi-psout 2.0.0
File Size Uploaded
mhi_psout-2.0.0.tar.gz 462.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for mhi-psout 2.0.0
File
mhi_psout-2.0.0-cp315-cp315-win_amd64.whl CPython 3.15 CPython 3.15 Windows x86-64 Details
mhi_psout-2.0.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
mhi_psout-2.0.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
mhi_psout-2.0.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
mhi_psout-2.0.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
mhi_psout-2.0.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
mhi_psout-2.0.0-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
mhi_psout-2.0.0-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
mhi_psout-2.0.0-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details

Total release size: 1.3 MB

Release files / mhi_psout-2.0.0.tar.gz

Download URL mhi_psout-2.0.0.tar.gz
Size 462.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f09c1bdc8c872a8e4731c16de532aed68b5f4cf5180087c76a79d39d136a0a2e
BLAKE2b-256 checksum
How to use checksums
afe24b35566ae9b62c2595a332cc5a25eb81104e074c12bca7bdb0dcc69217e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0rc2

Release files / mhi_psout-2.0.0-cp315-cp315-win_amd64.whl

Download URL mhi_psout-2.0.0-cp315-cp315-win_amd64.whl
Size 90.5 kB
Tags CPython 3.15 Windows x86-64
SHA-256 checksum
How to use checksums
d91b06e192ccf05e831b1341fce366ec9beaffba2fb51b199b03e911dece6b1a
BLAKE2b-256 checksum
How to use checksums
c43588c75dceb219cd5394394ad6cc9283a9a1093bfa7de0b3d6aab54ac11fed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0rc2

Release files / mhi_psout-2.0.0-cp314-cp314-win_amd64.whl

Download URL mhi_psout-2.0.0-cp314-cp314-win_amd64.whl
Size 90.5 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
b99ec5dfe1bbffaa31b828414daee599b3cdb4139a1df700ac8428cf87d22ab6
BLAKE2b-256 checksum
How to use checksums
4207c13a2d664086bc239603a33e91f0daf89b9ee83d1e661d182f59a2bc0b75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0rc2

Release files / mhi_psout-2.0.0-cp313-cp313-win_amd64.whl

Download URL mhi_psout-2.0.0-cp313-cp313-win_amd64.whl
Size 88.5 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
63d3a7e98d7b7ffab3b884dbd37772d2ed7859af856e6ed2b278e11a1c9e98c2
BLAKE2b-256 checksum
How to use checksums
9be222fa443b03ee30aaab615ab5dfe20ed272883db304a4569c9fe73af024e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0rc2

Release files / mhi_psout-2.0.0-cp312-cp312-win_amd64.whl

Download URL mhi_psout-2.0.0-cp312-cp312-win_amd64.whl
Size 88.5 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
fbd8d7561f50dfb8555b0d35c48f379f814ad37f662ba3680c27e311d1edb8cb
BLAKE2b-256 checksum
How to use checksums
e8e7f3bb6edcd5a62a0e82466024fc1dcb3b3c0d524678d51d3cb70d025f0e13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0rc2

Release files / mhi_psout-2.0.0-cp311-cp311-win_amd64.whl

Download URL mhi_psout-2.0.0-cp311-cp311-win_amd64.whl
Size 88.4 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
f9f215e73c41d717de9e23b2a20b52b20f82dfa17cbed380b2b16b269da59f1d
BLAKE2b-256 checksum
How to use checksums
4069ecb8aa126681627ef042f02829dc5ab8e0e730cda69d50456bd05685b020
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0rc2

Release files / mhi_psout-2.0.0-cp310-cp310-win_amd64.whl

Download URL mhi_psout-2.0.0-cp310-cp310-win_amd64.whl
Size 88.4 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
46bf5ba0ab27bb13395e47835afa07e928c829091ef0443bbcfc578866127e30
BLAKE2b-256 checksum
How to use checksums
5ea702153c476fec6f6eef7d1dc4a052991b7019ab71d4dc8dd766e617691413
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0rc2

Release files / mhi_psout-2.0.0-cp39-cp39-win_amd64.whl

Download URL mhi_psout-2.0.0-cp39-cp39-win_amd64.whl
Size 88.4 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
a98504e9172bb26d15e29e77995d01b2baf2a7c491617fd5d72e794ef83f8386
BLAKE2b-256 checksum
How to use checksums
bc2a2e60e593608728dc06f87ef9dcc2fc2e56b2d5fd9ff42de70a0bc11ba8d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0rc2

Release files / mhi_psout-2.0.0-cp38-cp38-win_amd64.whl

Download URL mhi_psout-2.0.0-cp38-cp38-win_amd64.whl
Size 88.4 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
ff03bc31b3be669a0fcf28a328a00585f79b536b45207bea47c36cc3463494c1
BLAKE2b-256 checksum
How to use checksums
08aafb6e520adc5a430907666cd409ba3ef4b8b2342657906346d49e5d4eb73e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0rc2

Release files / mhi_psout-2.0.0-cp37-cp37m-win_amd64.whl

Download URL mhi_psout-2.0.0-cp37-cp37m-win_amd64.whl
Size 88.4 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
c302b39dbf4b0e6f5aee76373bb007e59ab05e3a1c8088c1c9a7f67025d38483
BLAKE2b-256 checksum
How to use checksums
c04387a3bcda6421bcb80cdc2dea348cbc36c4bad24b54713149a0f7cc861c4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0rc2

Release history Release notifications | RSS feed

This release

2.0.0 This release

10 release files

1.3.0

9 release files

1.2.2

9 release files

1.2.1

9 release files

1.2.0

9 release files

1.0.5

9 release files

1.0.4

8 release files

1.0.3

8 release files

1.0.2

7 release files

1.0.1

7 release files

1.0.0

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page