Adams Python Scripting Language

Python functions exist to extract data points from the existing rainflow object (rf_obj). These functions are as follows:
1. Digitized turning points: rf_obj.dtp or rf_obj.digitized_turning_points
2. Rainflow from-to matrix: rf_obj.rfm or rf_obj.rainflow_matrix
3. Rainflow range-mean matrix rf_obj.rmm or rf_obj.range_mean_matrix
4. Range pairs: rf_obj.rp or rf_obj.ranges
5. Cumulative range pairs rf_obj.crp or rf_obj.cumulative_ranges
6. level crossings rf_obj.lc or rf_obj.level_crossings
7. pseudo damage rf_obj.pd or rf_obj.pseudo_damage
8. equivalent load rf_obj.el or rf_obj.equivalent_load
There can be multiple rainflow objects (rf_obj) depending on number of plots generated by the user. The rf_obj(s) can be accessed as follows from the adams_rf_interface module.
1. rainflow_objects(): Returns a list of all Rainflow objects in the session.
 
>>> from msc.durability.adams import adams_rf_interface
>>> rf_obj_list = adams_rf_interface.rainflow_objects()
>>> rf_obj_list
[<msc.durability.rainflow.EquivalentLoad object at 0x0000014A1ED7DB90>]
>>> rf_obj_list[0].equivalent_load
array([ 0.15085271, 0.78874687, 2.16301867, 4.27620028, 6.99732269,
10.1616243 , 13.61794238, 17.24377672])
>>> rf_obj_list[0].bins
64
New Rainflow object can also be created using python functions as follows:
>>> from msc.durability import rainflow as rfc
>>>rf_obj = rfc.EquivalentLoad(name='Ref Case', data=signal, bins=64, beta_exponents= np.arange(3, 13), target=int(1.E6), tested=int(8.E5))
Where signal is a sampled data.
Please refer to durability\examples\rainflow folder for more information about how to create new rainflow objects using python interface.