flopy.utils.compare module

compare(namefile1: str | PathLike = None, namefile2: str | PathLike = None, precision='auto', max_cumpd=0.01, max_incpd=0.01, htol=0.001, outfile1: str | PathLike | None = None, outfile2: str | PathLike | None = None, files1: str | PathLike | List[str | PathLike] | None = None, files2: str | PathLike | List[str | PathLike] | None = None)[source]

Compare the budget and head results for two MODFLOW-based model simulations.

Parameters:
  • namefile1 (str or PathLike, optional) – namefile path for base model

  • namefile2 (str or PathLike, optional) – namefile path for comparison model

  • precision (str) – precision for binary head file (“auto”, “single”, or “double”) default is “auto”

  • max_cumpd (float) – maximum percent discrepancy allowed for cumulative budget terms (default is 0.01)

  • max_incpd (float) – maximum percent discrepancy allowed for incremental budget terms (default is 0.01)

  • htol (float) – maximum allowed head difference (default is 0.001)

  • outfile1 (str or PathLike, optional) – budget comparison output file name. If outfile1 is None, no budget comparison output is saved. (default is None)

  • outfile2 (str or PathLike, optional) – head comparison output file name. If outfile2 is None, no head comparison output is saved. (default is None)

  • files1 (str, PathLike, or list, optional) – base model output file. If files1 is not None, results will be extracted from files1 and namefile1 will not be used. (default is None)

  • files2 (str, PathLike, or list, optional) – comparison model output file. If files2 is not None, results will be extracted from files2 and namefile2 will not be used. (default is None)

Returns:

success – boolean indicating if the budget and head differences are less than max_cumpd, max_incpd, and htol.

Return type:

bool

compare_budget(namefile1: str | PathLike | None, namefile2: str | PathLike | None, max_cumpd=0.01, max_incpd=0.01, outfile: str | PathLike | None = None, files1: str | PathLike | List[str | PathLike] | None = None, files2: str | PathLike | List[str | PathLike] | None = None)[source]

Compare the budget results from two simulations.

Parameters:
  • namefile1 (str or PathLike, optional) – namefile path for base model

  • namefile2 (str or PathLike, optional) – namefile path for comparison model

  • max_cumpd (float) – maximum percent discrepancy allowed for cumulative budget terms (default is 0.01)

  • max_incpd (float) – maximum percent discrepancy allowed for incremental budget terms (default is 0.01)

  • outfile (str or PathLike, optional) – budget comparison output file name. If outfile is None, no comparison output is saved. (default is None)

  • files1 (str, PathLike, or list, optional) – base model output file. If files1 is not None, results will be extracted from files1 and namefile1 will not be used. (default is None)

  • files2 (str, PathLike, or list, optional) – comparison model output file. If files2 is not None, results will be extracted from files2 and namefile2 will not be used. (default is None)

Returns:

success – boolean indicating if the difference between budgets are less than max_cumpd and max_incpd

Return type:

bool

compare_concentrations(namefile1: str | PathLike, namefile2: str | PathLike, precision='auto', ctol=0.001, outfile: str | PathLike | None = None, files1: str | PathLike | List[str | PathLike] | None = None, files2: str | PathLike | List[str | PathLike] | None = None, difftol=False, verbose=False)[source]

Compare the mt3dms and mt3dusgs concentration results from two simulations.

Parameters:
  • namefile1 (str or PathLike) – namefile path for base model

  • namefile2 (str or PathLike) – namefile path for comparison model

  • precision (str) – precision for binary head file (“auto”, “single”, or “double”) default is “auto”

  • ctol (float) – maximum allowed concentration difference (default is 0.001)

  • outfile (str or PathLike, optional) – concentration comparison output file name. If outfile is None, no comparison output is saved. (default is None)

  • files1 (str, PathLike, or list, optional) – base model output file. If files1 is not None, results will be extracted from files1 and namefile1 will not be used. (default is None)

  • files2 (str, PathLike, or list, optional) – comparison model output file. If files2 is not None, results will be extracted from files2 and namefile2 will not be used. (default is None)

  • difftol (bool) – boolean determining if the absolute value of the concentration difference greater than ctol should be evaluated (default is False)

  • verbose (bool) – boolean indicating if verbose output should be written to the terminal (default is False)

Returns:

success – boolean indicating if the concentration differences are less than ctol.

Return type:

bool

compare_heads(namefile1: str | PathLike | None, namefile2: str | PathLike | None, precision='auto', text='head', text2=None, htol=0.001, outfile: str | PathLike | None = None, files1: str | PathLike | List[str | PathLike] | None = None, files2: str | PathLike | List[str | PathLike] | None = None, difftol=False, verbose=False, exfile: str | PathLike | None = None, exarr=None, maxerr=None)[source]

Compare the head results from two simulations.

Parameters:
  • namefile1 (str or PathLike) – namefile path for base model

  • namefile2 (str or PathLike) – namefile path for comparison model

  • precision (str) – precision for binary head file (“auto”, “single”, or “double”) default is “auto”

  • htol (float) – maximum allowed head difference (default is 0.001)

  • outfile (str or PathLike) – head comparison output file name. If outfile is None, no comparison output is saved. (default is None)

  • files1 (str or PathLike, or List of str or PathLike) – base model output files. If files1 is not None, results will be extracted from files1 and namefile1 will not be used. (default is None)

  • files2 (str or PathLike, or List of str or PathLike) – comparison model output files. If files2 is not None, results will be extracted from files2 and namefile2 will not be used. (default is None)

  • difftol (bool) – boolean determining if the absolute value of the head difference greater than htol should be evaluated (default is False)

  • verbose (bool) – boolean indicating if verbose output should be written to the terminal (default is False)

  • exfile (str or PathLike, optional) – path to a file with exclusion array data. Head differences will not be evaluated where exclusion array values are greater than zero. (default is None)

  • exarr (numpy.ndarry) – exclusion array. Head differences will not be evaluated where exclusion array values are greater than zero. (default is None).

  • maxerr (int) – maximum number of head difference greater than htol that should be reported. If maxerr is None, all head difference greater than htol will be reported. (default is None)

Returns:

success – boolean indicating if the head differences are less than htol.

Return type:

bool

compare_stages(namefile1: str | PathLike = None, namefile2: str | PathLike = None, files1: str | PathLike | List[str | PathLike] | None = None, files2: str | PathLike | List[str | PathLike] | None = None, htol=0.001, outfile: str | PathLike | None = None, difftol=False, verbose=False)[source]

Compare SWR process stage results from two simulations.

Parameters:
  • namefile1 (str or PathLike) – namefile path for base model

  • namefile2 (str or PathLike) – namefile path for comparison model

  • precision (str) – precision for binary head file (“auto”, “single”, or “double”) default is “auto”

  • htol (float) – maximum allowed stage difference (default is 0.001)

  • outfile (str or PathLike, optional) – head comparison output file name. If outfile is None, no comparison output is saved. (default is None)

  • files1 (str, PathLike, or list, optional) – base model output file. If files1 is not None, results will be extracted from files1 and namefile1 will not be used. (default is None)

  • files2 (str, PathLike, or list, optional) – comparison model output file. If files2 is not None, results will be extracted from files2 and namefile2 will not be used. (default is None)

  • difftol (bool) – boolean determining if the absolute value of the stage difference greater than htol should be evaluated (default is False)

  • verbose (bool) – boolean indicating if verbose output should be written to the terminal (default is False)

Returns:

success – boolean indicating if the stage differences are less than htol.

Return type:

bool

compare_swrbudget(namefile1: str | PathLike | None, namefile2: str | PathLike | None, max_cumpd=0.01, max_incpd=0.01, outfile: str | PathLike | None = None, files1: str | PathLike | List[str | PathLike] | None = None, files2: str | PathLike | List[str | PathLike] | None = None)[source]

Compare the SWR budget results from two simulations.

Parameters:
  • namefile1 (str or PathLike, optional) – namefile path for base model

  • namefile2 (str or PathLike, optional) – namefile path for comparison model

  • max_cumpd (float) – maximum percent discrepancy allowed for cumulative budget terms (default is 0.01)

  • max_incpd (float) – maximum percent discrepancy allowed for incremental budget terms (default is 0.01)

  • outfile (str or PathLike, optional) – budget comparison output file name. If outfile is None, no comparison output is saved. (default is None)

  • files1 (str, PathLike, or list, optional) – base model output file. If files1 is not None, results will be extracted from files1 and namefile1 will not be used. (default is None)

  • files2 (str, PathLike, or list, optional) – comparison model output file. If files2 is not None, results will be extracted from files2 and namefile2 will not be used. (default is None)

Returns:

success – boolean indicating if the difference between budgets are less than max_cumpd and max_incpd

Return type:

bool

eval_bud_diff(fpth: str | PathLike, b0, b1, ia=None, dtol=1e-06)[source]