![]() |
|
Functions | |
| def | mercury_cg (name='Chain.stat', print_summary=True, row_major_index_order=False) |
| This function reads a MercuryCG .stat file and returns a dictionary of the data. More... | |
| def | get_raw_data (name) |
| This function reads raw data from a file. More... | |
| def | get_dimension (data, raw, row_major_index_order) |
| This function determines the dimension of the data. More... | |
| def | get_coordinates (data, raw, dim, row_major_index_order) |
| This function gets the spatial coordinates and time of the data. More... | |
| def | get_variables (data, raw, names, dim, row_major_index_order) |
| This function gets the variables of the data from the .stat file. More... | |
| def | extend_variables (data) |
| This function extends the variables of the data dictionary by computing several fields from the standard fields. More... | |
| def | read_header1 (header1) |
| Parse the first header line of the input file. More... | |
Variables | |
| string | required_pandas_version = "1.2.0" |
| string | required_numpy_version = "1.20.0" |
| installed_pandas_version = pd.__version__ | |
| installed_numpy_version = np.__version__ | |
| def read_mercury_cg.extend_variables | ( | data | ) |
This function extends the variables of the data dictionary by computing several fields from the standard fields.
| [in,out] | data | The data dictionary to extend the variables of. |
Referenced by mercury_cg().
| def read_mercury_cg.get_coordinates | ( | data, | |
| raw, | |||
| dim, | |||
| row_major_index_order | |||
| ) |
This function gets the spatial coordinates and time of the data.
This function extracts the spatial coordinates and time from the raw data and adds them to the data dictionary.
| [in,out] | data | A dictionary where the keys are the variable names and the values are numpy arrays of the data. |
| [in] | raw | A pandas DataFrame containing the raw data. |
| [in] | dim | A list representing the dimension of the data for spatial coordinates and time if applicable. |
| [in] | row_major_index_order | A boolean value indicating whether the index order is row major. If True, the index order is xyz, otherwise it is zyx. |
Referenced by mercury_cg().
| def read_mercury_cg.get_dimension | ( | data, | |
| raw, | |||
| row_major_index_order | |||
| ) |
This function determines the dimension of the data.
This function calculates the dimension of the data based on the number of data points and the row major index order.
| [in] | data | A dictionary where the keys are the variable names and the values are numpy arrays of the data. |
| [in] | raw | A pandas DataFrame containing the raw data. |
| [in] | row_major_index_order | A boolean value indicating whether the index order is row major. If True, the index order is xyz, otherwise it is zyx. |
References int().
Referenced by mercury_cg().
| def read_mercury_cg.get_raw_data | ( | name | ) |
This function reads raw data from a file.
This function reads raw data from a file and returns the raw data and the headers.
| [in] | name | The name of the file to read from. |
References oomph::DoubleVectorHelpers.split().
Referenced by mercury_cg().
| def read_mercury_cg.get_variables | ( | data, | |
| raw, | |||
| names, | |||
| dim, | |||
| row_major_index_order | |||
| ) |
This function gets the variables of the data from the .stat file.
This function extracts the variables from the raw data and adds them to the data dictionary.
| [in] | data | A dictionary where the keys are the variable names and the values are numpy arrays of the data. |
| [in] | raw | A pandas DataFrame containing the raw data. |
| [in] | names | A list of strings representing the field names of the input from a MercuryCG .stat file. |
| [in] | dim | A list representing the dimension of the data for spatial coordinates and time if applicable. |
| [in] | row_major_index_order | A boolean value indicating whether the index order is row major. If True, the index order is xyz, otherwise it is zyx. |
References int(), and compute_granudrum_aor.str.
Referenced by mercury_cg().
| def read_mercury_cg.mercury_cg | ( | name = 'Chain.stat', |
|
print_summary = True, |
|||
row_major_index_order = False |
|||
| ) |
This function reads a MercuryCG .stat file and returns a dictionary of the data.
This function reads a MercuryCG .stat file, processes the data, and returns a dictionary of the data. The dictionary keys are the variable names and the values are numpy arrays of the data.
| [in] | name | The name of the .stat file created by MercuryCG to read from. Default is 'Chain.stat'. |
| [in] | print_summary | If True, print a summary of the data key shapes. Default is True. |
| [in] | row_major_index_order | If True, the index order for spatial coordinates is xyz, otherwise it is zyx. Default is False. |
References extend_variables(), get_coordinates(), get_dimension(), get_raw_data(), get_variables(), Eigen::internal.print(), and read_header1().
Referenced by compute_granudrum_aor.compute_granudrum_aor().
| def read_mercury_cg.read_header1 | ( | header1 | ) |
Parse the first header line of the input file.
This function takes the first header line of the input file, splits it into separate words, and extracts the values associated with certain keys. The keys it looks for are 'n', 'width', 'timeMin', 'min', and 'max'. The values associated with these keys are then converted to floats and stored in a dictionary.
| [in] | header1 | A string of the first header line of the input file. |
References int().
Referenced by mercury_cg().
| read_mercury_cg.installed_numpy_version = np.__version__ |
| read_mercury_cg.installed_pandas_version = pd.__version__ |
| string read_mercury_cg.required_numpy_version = "1.20.0" |
| string read_mercury_cg.required_pandas_version = "1.2.0" |