|
BeSpiceWaveParserLimitedEdition
|
The Python object-oriented API is included in the same Python module as the standard API. It defines a global parser object. Instead of using section identifiers and curve indices, it uses section and curve classes and objects.
The standard and object-oriented API can be mixed.
After having imported the Python module, the builtin help function can also be used to to get an overview of the implemented functions and classes.
> help(af_waveform_path.get_module_name())
The parser, section and curve properties are similar to the ones define in the C enum _af_wp_prop_enum_type. They are simply transformed to strings by omitting "af_wp" that means the enumerated value af_wp_prop_variable_name becomes the string "prop_variable_name".
The page The Curve Calculator explains how to build expressions that can be evaluated by the curve calculator.
The BeSpice Parser API contains some examples giving an overview over the defined functions and types.
This example is implemented in 001_example_wp_py_obj_print_file_data.py. It shows how to parse spice simulation results and to retrieve the contained data. The functions defined in af_waveform_parser_print_obj.py are used to print all available data to the screen.
This example is implemented in 002_example_wp_py_obj_find_curves.py. It shows how to search for curves in the parsed simulation results.
This example is implemented in 003_example_wp_py_obj_calculator_basics.py. It shows how to use the builtin waveform calculator to extract data from the parsed simulation results.
Please also check the page The Curve Calculator .
This example is implemented in 004_example_wp_py_obj_numpy_and_matplotlib.py. It shows how to read the simulation results to a numpy array. These arrays are better suited for storing large data sets than pure Python structures. The numpy arrays can be directly used from Matplotlib to visualize the curves.
1.8.6