-
Notifications
You must be signed in to change notification settings - Fork 19
Additional Notes
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
.psout files can be viewed from within PSCAD using the PSOUT Reader
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
The MTB Plotter makes use of the "low level" mhi-psout Python library to provide as set of "high level" library or function, process_psout.py to process and plot .psout files a little bit easier.
These library functions are
- getPsoutSignal used by getPsoutSignals below to obtain the time domain values and the values of a signal or a signal array
- getPsoutSignals to extract a list of signals as a Pandas DataFrame
- findPsoutSignalPath find the signal path name or names for a specified signal name
Two scripts are also provided,
- psout_to_csv to extract all the signals listed in figureSetup.csv from a .psout file, and convert it to human readable .csv format
- list_psout_signals to list all signal, and their relative signal path, in a .psout file
- 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 output root folder where the date-time stamped folder will be created and the [compressed]
.csv files will be saved
-f, --figureSetupPath [FIGURESETUPPATH]
the path to the figureSetup.csv file
-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
...
- If the relative signal path of the signals in a .psout file is known, the getPsoutSignals function can be used to extract a list of signals from the .psout file into a Pandas DataFrame, e.g.
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 MTB\mtb_s_pavail_pu If the MTB is not located on the 'Main' canvas, all MTB signals will automatically be renamed to the correct relative path, e.g. External_Grid\MTB\mtb_s_pavail_pu as per the above example.
- All 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 correct relative path signal names in figureSetup.csv in order to correctly specify which signal is meant to be plotted, e.g.
In [3]: findPsoutSignalPath('..\\export\\MTB_27042026160858\\Solbakke_88.psout','fft_pos_Id_pu')
Out[3]: ['Unit', 'MTB', 'Unit_2', 'Unit_1']
For further questions or help, please check if the README or the Quickstart Guides contains the answer.
Otherwise, please contact the Energinet simulation model team: simuleringsmodeller@energinet.dk