odatse.scripts.separateT module#

This script separates MCMC data files into multiple files based on temperature values. It reads MCMC result files and splits them into separate files for each temperature.

odatse.scripts.separateT.do_separate(filename: str, buffer_limit: int = 200000) None[source]#

Separate a single MCMC data file into multiple files, one per temperature.

Lines are routed to an output file keyed by the temperature value in the 3rd column (index 2). Unlike a simple “split whenever the value changes from the previous line”, this groups all lines with the same temperature together even when temperatures are interleaved (as in exchange MC), so each temperature gets exactly one file. Temperatures are indexed in order of first appearance.

Lines are buffered per temperature and flushed by open-append-close, so at most two file descriptors are in use at any time regardless of how many distinct temperatures the input contains (keeping one descriptor open per temperature exhausts the default file-descriptor limit for runs with hundreds of temperature points).

Parameters:
  • filename (str) – Path to the MCMC data file to be separated.

  • buffer_limit (int) – Total number of buffered data lines that triggers a flush to disk.

Returns:

Files are written to disk with naming pattern: original_filename_T{index}.ext

Return type:

None

odatse.scripts.separateT.main() None[source]#

Main function to parse arguments and process MCMC data files.

Command line arguments: -d/–data_dir: Directory containing MCMC data -t/–file_type: File type of MCMC data (default: result.txt) –progress: Show progress bar input_files: Optional list of specific files to process

Return type:

None