This project is for plot LinearMSTMM solver result that is write with hdf5.
Project description
PlotLinearSolverResult
This project is for plot LinearMSTMM solver result that is write with hdf5.
First import this package.
import PlotLinearSolverResult.read_from_hdf5 as rh
import matplotlib.pyplot as plt
import numpy as np
Then, initialize a H5File from h5 file path.
f = rh.H5File('test_write_vibration_characteristics.h5')
Using print_directory_information that can print the diractory information of the h5file to the dataset.
f.print_directory_information()
├──Animation
└──Index
├──Ground
└──Frame
└──Part_Beam
├──Frame
└──Part_BeamNodes
├──Curve
└──Index
├──Ground
└──Markers
└──Marker_0
└──Part_Beam
└──Nodes
├──ModalInformation
├──Index
├──Ground
└──Frame
└──Part_Beam
├──Frame
└──Part_BeamNodes
├──NaturalFrequencies
└──SystemModalMass
└──TimeStamps
[[[['/Animation/Index/Ground/Frame'],
['/Animation/Index/Part_Beam/Frame',
'/Animation/Index/Part_Beam/Part_BeamNodes']]],
[[[['/Curve/Index/Ground/Markers/Marker_0']], [[]]]],
[[['/ModalInformation/Index/Ground/Frame'],
['/ModalInformation/Index/Part_Beam/Frame',
'/ModalInformation/Index/Part_Beam/Part_BeamNodes']],
'/ModalInformation/NaturalFrequencies',
'/ModalInformation/SystemModalMass'],
'/TimeStamps']
Get the keys of the attribute of the dataset.
keys = f.get_keys_attr_dset('/Animation/Index/Part_Beam/Part_BeamNodes')
keys[5]
'PhysicalDisplacementY'
Using get_index_attr_dset_in_data to get the index of the attribute of the dataset in the data over times.
Using get_keys_attr_dset_with_index_in_data to get the keys of the attribute of the dataset with the index in the data.
Using get_animation_data to get animation data over time.
Using get_TimesStamps to get TimesStamps data.
Finally, you can plot with times and data.
index = f.get_index_attr_dset_in_data('/Animation/Index/Part_Beam/Part_BeamNodes',keys[5])
animation_data = f.get_animation_data()
times = f.get_TimeStamps()
plt.plot(times,animation_data[:,index[0]])
[<matplotlib.lines.Line2D at 0x1ef4062c8d0>]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plotlinearsolverresult-0.1.4.tar.gz.
File metadata
- Download URL: plotlinearsolverresult-0.1.4.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66c81f77251af66574db492e81c33ebdaeb9c14ce7ce6304111e6ff730f88635
|
|
| MD5 |
7a27d66dc7e40d52d30bfdb664012042
|
|
| BLAKE2b-256 |
64439b1ddcbd34f6e65528f7f116dac2941636a21b3c52e9259d8fae73ebd105
|
File details
Details for the file plotlinearsolverresult-0.1.4-py3-none-any.whl.
File metadata
- Download URL: plotlinearsolverresult-0.1.4-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a8e1e0f4eb226ae5d79bfa5cf135efe8d9f838777a954094972a779da67d84a
|
|
| MD5 |
f16ea66489ccdcebecb677ef4c87ae29
|
|
| BLAKE2b-256 |
53b5bfaa94a9cd09ceb96175a42fe9ce8a5b942d73531febe8f5350c6a53415d
|