crunchflow.output.spatial ========================= .. py:module:: crunchflow.output.spatial .. autoapi-nested-parse:: Tools for loading, analyzing, and visualizing spatial profile output from CrunchFlow. This module provides the `SpatialProfile` class and associated utility functions to work with CrunchFlow spatial output files (commonly `.tec`, `.out`, or `.dat` files). These files contain gridded data written at specified output times during a simulation, and typically include variables such as mineral saturation, aqueous species concentrations, porosity, and permeability across 1D, 2D, or 3D model domains. Key Features ------------ - Automatically detects file format and loads output variables and metadata. - Supports plotting 2D images or contour maps for any output variable. - Enables comparison of results across time steps using `plot_series`. - Extracts outlines of zones sharing a common attribute (e.g., permeability zone boundaries). - Compatible with `.tec`, `.out`, and `.dat` formats written by CrunchFlow. .. !! processed by numpydoc !! Classes ------- .. toctree:: :hidden: /autoapi/crunchflow/output/spatial/SpatialProfile .. autoapisummary:: crunchflow.output.spatial.SpatialProfile Functions --------- .. autoapisummary:: crunchflow.output.spatial.isnumeric_scientific crunchflow.output.spatial.read_output_times crunchflow.output.spatial.get_tec_metadata crunchflow.output.spatial.get_out_output_time crunchflow.output.spatial.get_tec_output_times Module Contents --------------- .. py:function:: isnumeric_scientific(s) Check if a string is numeric. Return True if a string is an integer, float or in scientific notation, and False otherwise. .. !! processed by numpydoc !! .. py:function:: read_output_times(fname) Given a CrunchFlow input file, return the spatial_profile output times. :Parameters: **fname** : str Name of the input file to read :Returns: **output_times** : list Output times read from the input file .. !! processed by numpydoc !! .. py:function:: get_tec_metadata(file, folder='.') Return a list of the variables in a spatial_profile output file. Given a crunch .tec output file, read it in and return a list of the variables (e.g., 'X-Perm', 'Y-Perm', etc) included in the output file. :Parameters: **file** : str Filename to read in **folder** : str Folder in which 'file' is located. The default is the current directory :Returns: **columns** : list, str ordered list of variables included in filename **title** : str Value included in this file, as output by CrunchFlow **fmt** : str Format of the file, either '.tec' or '.out' .. !! processed by numpydoc !! .. py:function:: get_out_output_time(file) Get the output time from a CrunchFlow .out file. Given a CrunchFlow .out file, read it in and return the output time, which should be stored in the first line. :Parameters: **file** : str Filename to read in :Returns: **time** : float output time of the file .. !! processed by numpydoc !! .. py:function:: get_tec_output_times(crunch_log, folder='.') Given a CrunchFlow output log, get the spatial_profile output times. Search through a file containing all terminal output from a CrunchFlow run and return the spatial_profile output times. For example, during a simulation, CrunchFlow will print progress to the screen, including blocks that look like: >>> WRITING OUTPUT FILES >>> Time (days) = 9.000E+00 >>> File number = 2 This function combs through that terminal output to create a list of times at which .tec files were written. Note that this function is no longer maintained and has been superseded by `read_output_times`. :Parameters: **crunch_log** : str Filename of the crunchflow terminal output **folder** : str Folder in which 'crunch_log' is located.The default is the current directory :Returns: **output_times** : list of float Ordered list of the output times (in CrunchFlow time units) corresponding to each .tec file number. .. !! processed by numpydoc !!