catm-python-lib
|
reading utillities for configuration file of GET electronics More...
Go to the source code of this file.
Functions | |
catmlib.util.xcfgreader.classify_indices (values) | |
Classify indices by values in a list. | |
catmlib.util.xcfgreader.get_tree (input_path) | |
Parse an XML configuration file and return its root element. | |
catmlib.util.xcfgreader.get_node (root, node_id_name='CoBo') | |
Retrieve a specific <Node> element by its ID from the XML tree. | |
catmlib.util.xcfgreader.get_instance (node, instance_id_name=' *') | |
Retrieve a specific <Instance> element by its ID within a given <Node>. | |
catmlib.util.xcfgreader.get_block (instance, label_name='AsAd', block_name='0') | |
Retrieve a specific block element (e.g., AsAd or Aget) by tag and ID within an Instance. | |
catmlib.util.xcfgreader.print_tree (element, indent=0, indent_label=1) | |
Recursively print elements at a specified depth level in an XML tree. | |
catmlib.util.xcfgreader.write_text (input_path, output_path) | |
catmlib.util.xcfgreader.read_text (intput_path=None) | |
Reads a tab-separated text file into a pandas DataFrame. | |
catmlib.util.xcfgreader.get_matching_indices (data, cobo_value, asad_value, aget_value, channel_value) | |
Get indices of rows in a DataFrame that match specified values. |
reading utillities for configuration file of GET electronics
Definition in file xcfgreader.py.
catmlib.util.xcfgreader.classify_indices | ( | values | ) |
Classify indices by values in a list.
This function groups the indices of elements in the input list by their values.
values | A list of values to be classified. |
Definition at line 15 of file xcfgreader.py.
catmlib.util.xcfgreader.get_block | ( | instance, | |
label_name = 'AsAd', | |||
block_name = '0' ) |
Retrieve a specific block element (e.g., AsAd or Aget) by tag and ID within an Instance.
instance | The parent Instance element. |
label_name | The tag name of the block to find (e.g., 'AsAd', 'Aget'). |
block_name | ID attribute of the block element to retrieve (default is '0'). |
Definition at line 63 of file xcfgreader.py.
catmlib.util.xcfgreader.get_instance | ( | node, | |
instance_id_name = '*' ) |
Retrieve a specific <Instance> element by its ID within a given <Node>.
node | The parent Node element. |
instance_id_name | ID attribute value of the desired Instance element (default is '*'). |
Definition at line 52 of file xcfgreader.py.
catmlib.util.xcfgreader.get_matching_indices | ( | data, | |
cobo_value, | |||
asad_value, | |||
aget_value, | |||
channel_value ) |
Get indices of rows in a DataFrame that match specified values.
Each parameter can be set to a specific value (non-negative) to filter, or a negative value to ignore the filter.
data | A pandas DataFrame that contains columns: cobos, asads, agets, channels. |
cobo_value | Integer. Cobo value to match (set < 0 to ignore). |
asad_value | Integer. Asad value to match (set < 0 to ignore). |
aget_value | Integer. Aget value to match (set < 0 to ignore). |
channel_value | Integer. Channel value to match (set < 0 to ignore). |
Definition at line 151 of file xcfgreader.py.
catmlib.util.xcfgreader.get_node | ( | root, | |
node_id_name = 'CoBo' ) |
Retrieve a specific <Node> element by its ID from the XML tree.
root | Root element of the XML tree. |
node_id_name | ID attribute value of the desired Node element (default is 'CoBo'). |
Definition at line 40 of file xcfgreader.py.
catmlib.util.xcfgreader.get_tree | ( | input_path | ) |
Parse an XML configuration file and return its root element.
input_path | Path to the XML configuration file. |
Definition at line 29 of file xcfgreader.py.
catmlib.util.xcfgreader.print_tree | ( | element, | |
indent = 0, | |||
indent_label = 1 ) |
Recursively print elements at a specified depth level in an XML tree.
element | The current element to print. |
indent | Current recursion depth (used internally). |
indent_label | Target depth level at which to print elements. |
Definition at line 75 of file xcfgreader.py.
catmlib.util.xcfgreader.read_text | ( | intput_path = None | ) |
Reads a tab-separated text file into a pandas DataFrame.
intput_path | The path to the text file. If None, the function returns None. |
Definition at line 140 of file xcfgreader.py.
catmlib.util.xcfgreader.write_text | ( | input_path, | |
output_path ) |
Definition at line 89 of file xcfgreader.py.