Skip to content

Feature/h5 output reader - #1

Merged
alliemr123 merged 4 commits into
mainfrom
feature/h5-reader
May 6, 2026
Merged

Feature/h5 output reader#1
alliemr123 merged 4 commits into
mainfrom
feature/h5-reader

Conversation

@alliemr123

@alliemr123alliemr123 commented May 6, 2026

Copy link
Copy Markdown
Collaborator

A flexible Python tool for quick visualizing HDF5 SEA-Stack simulation outputs.

It supports:

  • Body motion (position, velocity, acceleration)
  • Joint reactions (force & torque)
  • Translational spring-damper actuators (TSDAs) outputs (energy, power, reaction forces)

With capabilities such as

  • Multiple devices plotting
  • Various naming conventions
  • Filtering via CLI
  • File introspection (--list)

Basic command structure:

run h5 output reader python file in terminal

  • located in data/demos/run_seastack
    • either cd data/demos/run_seastack or direct to cd data/demos/run_seastack/h5outputsReader.py
python h5outputsReader.py <path_to_h5_output_file/results.x.h5> --field <field> [options] --bodies <body> [options] --dof <dof> [options] --joints <joints> [options] --tsda <tsda> [options] --list --mooring <field> [index] --mooring_path <path>

Features

--field

Select what data to plot.

Body fields:

  • position
  • velocity
  • acceleration

Joint fields:

  • joint_force
  • joint_torque

TSDA fields:

  • energy
  • power
  • tsda_force

--bodies

Select body numbers to plot on same figure (default = all)

Used with: body fields

Example:

--bodies 1 2 4

--dof

Select degrees of freedom to plot on separate figures (default = heave)

Options:

  • surge
  • sway
  • heave
  • roll
  • pitch
  • yaw

Used with: body fields (not acceleration)

Example:

--dof heave

or for multiple plots:

--dof surge sway heave

--joints

Select joint names to plot

Used with: joint fields

Tip: use --list to see available joint names

Example:

--joints float_plate_joint

can plot multiple joint parameters on same plot:

--joints joint_12 joint_34

--tsdas

Select TSDA names to plot

Used with: TSDA fields

Example:

--tsdas ram_23_stbd ram_45_stbd

Special option:

--tsdas all
  • Plots the sum of all TSDAs (for energy and power fields specification)
  • Will prints:
    • total energy
    • average power
    • peak power

--list

List all available joint and TSDA names in the file for force and torque data

Example:

--list

--mooring

Load and visualize mooring output data from .out files
Supports:

  • force Fx, Fy, Fz [on body]
  • moment Mx, My, Mz [on body]
  • tension [on line]

With the same --mooring command and [integer] for respective field

Mooring directory can be specified with --mooring_path

Example:

--mooring tension 1 3 5 --mooring_path <path_to/mooring>

--mooring [index] --mooring_path


Full example usage

Plot heave position (all bodies) of 5sa demo - bodies not specified

python h5outputsReader.py 5sa/regular_waves/outputs/results.regular.h5 --field position --dof heave
image

Plot sway velocity (of selected bodies) of 5sa model

(note: order bodies are listed can change plotting order!)

python h5outputsReader.py 5sa/regular_waves/outputs/results.regular.h5 --field velocity --dof sway --bodies 3 5 
image

Plot total TSDA power of RM3

python h5outputsReader.py 5sa/regular_waves/outputs/results.regular.h5 --field power
image

List available joint force outputs for the 5sa

python h5outputsReader.py 5sa/regular_waves/outputs/results.regular.h5 --list
image

Plot joint torque for RM3

python h5outputsReader.py rm3/regular_waves/outputs/results.regular.h5 --field joint_torque --joints float_plate_joint
image

Plot selected TSDA forces (between body 1 and 2) of 5sa (tsda names from list function output)

python h5outputsReader.py 5sa/regular_waves/outputs/results.regular.h5 --field tsda_force --tsdas ram_12_top ram_12_bottom ram_12_stbd ram_12_port
image

Plot selected TSDA energy of 5sa (tsda names from list function output)

python h5outputsReader.py 5sa/regular_waves/outputs/results.regular.h5 --field energy --tsdas ram_23_stbd ram_45_stbd
image

Plot total TSDA power of 5sa

python h5outputsReader.py 5sa/regular_waves/outputs/results.regular.h5 --field energy --tsdas all
imageimage

Plot moment on body 2 of 5sa

python h5outputsReader.py 5sa/regular_waves/outputs/results.regular.h5 --mooring moment 2
image

Plot tension on lines of RM3 specifying path

python h5outputsReader.py 5sa/regular_waves/outputs/results.regular.h5 --mooring tension --mooring_path C:\Users\ariley\source\repos\sea-stack\build\data\demos\run_seastack\rm3\assets\mooring
image

@alliemr123
alliemr123 merged commit 320a6b3 into mainMay 6, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@alliemr123@dav-og