GEOtoENG converts SW4 SSI output into motion files that can be used by OpenSees and related workflows.
The script reads an SSI HDF5 file, maps user node coordinates into the SW4 grid, optionally rotates or zeroes motion components, and writes truncated motion histories. ZFP-compressed SSI files are supported through hdf5plugin.
Python packages:
numpyscipyh5pympi4pymatplotlibhdf5plugin
Typical run pattern:
mpirun -np 4 python convert.py ...--drm: read node coordinates from an OpenSees DRM template and writeDRMinput.h5drm--hdf5: read node coordinates from an HDF5 file and writeh5NodeMotion.h5--csv: read node coordinates from a CSV file and writecsvNodeMotion.h5--csvwith--template: use a CSV mapping file together with an SSI template file
When --output-format is omitted, the script keeps the current default for each input mode:
- DRM input defaults to OpenSees DRM output
- HDF5 and CSV inputs default to point-motion HDF5 output
- CSV + template input defaults to ESSI template output
-c, --csv CSV settings / coordinate file
-d, --drm DRM file with node coordinates
-h5, --hdf5 HDF5 file with node coordinates
-e, --ssi SW4 SSI output file
-t, --template SSI template file
-o, --output-format point, opensees, or essi
-P, --savepath output directory
-r, --reference reference coordinate offset
-R, --rotateanlge rotation angle in degrees
-s, --timerange start end step
-z, --zeroMotionDir None, x, y, or z
-p, --plotonly only plot input nodes
-v, --verbose verbose logging
Notes:
--timerange start end stepis in SSI time units.- If
start == end, the script keeps all steps fromstartto the end of the SSI record. --output-format point,--output-format opensees, and--output-format essiare supported for DRM, HDF5, CSV, and template-driven inputs.- HDF5 and CSV inputs keep their
nodeTagmetadata when writing OpenSees or ESSI-style outputs.
Generate OpenSees DRM input from the checked-in sample files:
mpirun -np 3 python convert.py \
-d template/DRMTemplate.h5drm \
--ssi tests/data/small.ssi \
-c template/motion_setting.csv \
-P tests/Generate motion histories from an HDF5 node file:
mpirun -np 3 python convert.py \
-h5 template/h5NodeCrds.h5 \
--ssi tests/data/small.ssi \
-c template/motion_setting.csv \
-P tests/Force point-motion output explicitly from an HDF5 node file:
mpirun -np 3 python convert.py \
-h5 template/h5NodeCrds.h5 \
--ssi tests/data/small.ssi \
-c template/motion_setting.csv \
--output-format point \
-P tests/Generate OpenSees DRM output from a template-driven run:
mpirun -np 3 python convert.py \
-c template/motion_setting.csv \
-t template/DRMTemplate.h5drm \
--ssi tests/data/small.ssi \
--output-format opensees \
-P tests/Generate plots only:
mpirun -np 1 python convert.py \
-d template/DRMTemplate.h5drm \
--ssi tests/data/small.ssi \
-c template/motion_setting.csv \
-ptemplate/DRMTemplate.h5drmtemplate/h5NodeCrds.h5template/motion_setting.csvtests/data/small.ssi