read_output#

crispy.image_ridge_find.read_output(fname, get_unconverged=True)[source]#

Read SCMS output files and retrieve walker coordinates.

This function reads the results of the SCMS ridge-finding process from a file. It can optionally include unconverged walker coordinates if available.

Parameters:
  • fname (str) – Path to the main output file containing converged walker coordinates.

  • get_unconverged (bool, optional, default=True) – If True, attempts to read the file containing unconverged walker coordinates alongside the converged data.

Returns:

  • coords (ndarray) – Coordinates of converged walkers from the main output file.

  • coords_unconverged (ndarray, optional) – Coordinates of unconverged walkers if get_unconverged is True and the corresponding file exists.

Notes

  • The file name for unconverged walkers is derived by appending a suffix (e.g., _unconverged) to the main file name.

  • If the unconverged file does not exist and get_unconverged is True, an exception may be raised depending on the file handling logic.

Examples

Read only the converged walkers:

>>> from crispy import image_ridge_find as irf
>>> coords = irf.read_output("output.txt", get_unconverged=False)

Read both converged and unconverged walkers:

>>> coords, coords_unconverged = irf.read_output("output.txt", get_unconverged=True)