Skip to content

Additional Notes

Peter Jan Randewijk edited this page Apr 28, 2026 · 28 revisions

A. Working with .psout files

A.0 Introduction

The .psout format is a modern, proprietary binary format introduced in PSCAD V5 for storing EMTDC simulation data. It replaces legacy text-based .out files, offering significantly smaller file sizes, faster read/write speeds, and the ability to store multiple, hierarchical simulation runs (including sequential and parallel results) in a single file

A.1 PSOUT Reader

.psout files can be viewed from within PSCAD using the PSOUT Reader

image

A.2 Enerplot

MHI also has a separate tool, Enerplot that can be used not only for plotting .psout files, but also to perform post processing of data using e.g. Python mhi.enerplot library

image

A.3 MTB library functions and scripts

The MTB Plotter makes use of the "low level" mhi-psout Python library provides "high level" library or function, process_psout.py to process and plot .psout files a little bit easier.

These library functions are

  • getPsoutSignal use by getPsoutSignals below
  • getPsoutSignals to extract a list of signals as a Pandas DataFrame
  • findPsoutSignalPath find the signal path name or names of a specified signal name

Two scripts are also provided,

A.3.1 Examples

  • For more information on using psout_to_csv, call the script from the command line with -h or --help, e.g.
E:\Users\PRW\SAAI\Solbakke_TSO\MTB\plotter>py psout_to_csv.py -h
usage: psout_to_csv [-h] [-p [PSOUTFOLDER]] [-o [OUTPUTROOTFOLDER]] [-f [FIGURESETUPPATH]] [-c [COMPRESSIONTYPE]] [-q]
                    [-v]

Convert .psout to .csv with optional compression if required

options:
  -h, --help            show this help message and exit
  -p, --psoutFolder [PSOUTFOLDER]
                        the folder where the .psout files are located
  -o, --outputRootFolder [OUTPUTROOTFOLDER]
                        the folder where the .psout files are located
  -f, --figureSetupPath [FIGURESETUPPATH]
                        the folder where the .psout files are located
  -c, --compressionType [COMPRESSIONTYPE]
                        the output compression type e.g. .zip, .bx2, .gz or .xz
  -q, --quiet           run quietly
  -v, --version         show program's version number and exit
  • To list all the signals and their relative signal path in a .psout file using list_psout_signals,
E:\Users\PRW\SAAI\Solbakke_TSO\MTB\export\MTB_27042026160858>py pylist_psout_signals.py Solbakke_88.psout

Signal Hierarchy for: Solbakke_88.psout
======================================================================

[ MAIN CANVAS SIGNALS ]
  ...
  mtb_GroundTRF1

[ SUB-MODULE SIGNALS ]
  ...
  MTB\fft_neg_Id_pu
  MTB\fft_neg_Imag_pu
  MTB\fft_neg_Iq_pu
  MTB\fft_neg_Vmag_pu
  MTB\fft_pos_Id_pu
  MTB\fft_pos_Imag_pu
  MTB\fft_pos_Iq_pu
  MTB\fft_pos_Vmag_pu
  MTB\init_brk
  MTB\meas_Ia_kA
  MTB\meas_Ia_pu
  MTB\meas_Ib_kA
  MTB\meas_Ib_pu
  MTB\meas_Ic_kA
  MTB\meas_Ic_pu
  MTB\meas_Vab_pu
  MTB\meas_Vag_kV
  MTB\meas_Vag_pu
  MTB\meas_Vbc_pu
  ...
  • Then to extract certain signals from the .psout file into a DataFrame, using getPsoutSignals,
In [1]: getPsoutSignals('..\\export\\MTB_27042026160858\\Solbakke_88.psout',['MTB\meas_Ia_pu', 'MTB\meas_Ib_pu', 'MTB\meas_Ic_pu'])
Out[1]: 
       time  MTB\meas_Ia_pu  MTB\meas_Ib_pu  MTB\meas_Ic_pu
0     0.000        0.000000        0.000000        0.000000
1     0.001        0.000267        0.000734        0.000512
2     0.002        0.000632        0.000996        0.000524
3     0.003        0.001027        0.001116        0.000651
4     0.004        0.001383        0.001169        0.000919
    ...             ...             ...             ...
8496  8.496        1.000203        0.999704        0.999979
8497  8.497        1.000204        0.999704        0.999979
8498  8.498        1.000204        0.999704        0.999979
8499  8.499        1.000204        0.999704        0.999978
8500  8.500        1.000204        0.999704        0.999978

[8501 rows x 4 columns]
  • The plotter.py script uses the findPsoutSignalPath function to check the location of the MTB instance in case it is not placed on the 'Main' canvas, e.g.
In [2]: findPsoutSignalPath('..\\export\\MTB_27042026160858\\HVK_Agg_1.psout','mtb_s_pavail_pu')
Out[2]: ['External_Grid\\MTB'

As there can only be one MTB per project, MTB signals in figureSetup.csv need only be specified as e.g. MTB\mtb_s_pavail_pu If the MTB is not located on the 'Main' canvas, all MTB signals will automatically be renamed to External_Grid\MTB\mtb_s_pavail_pu as per the above example.

As signal names are not necessarily unique, i.e. for Unit measurement blocks with Use legacy Unit measurement signal naming = False in config.ini, these signals have to be specified with their relative path signal names in figureSetup.csv e.g.

In [3]: findPsoutSignalPath('..\\export\\MTB_27042026160858\\Solbakke_88.psout','fft_pos_Id_pu')
Out[3]: ['Unit', 'MTB', 'Unit_2', 'Unit_1']

Clone this wiki locally