File Manipulation

TRSFX.manipulation.crystfel_to_meteor(input=None, output=None)

Converts Phenix-processed MTZ files to Meteor-ready MTZ files

Parameters:
  • input (str) – Input file path

  • output (str) – Output file path, if None, appends ‘_meteor.mtz’ to input filename

Return type:

None

TRSFX.manipulation.sample_crystals(stream, count=None, percent=None, seed=2026)

Sample crystals from the stream file

Parameters:
  • stream (Stream) – Stream object containing data

  • count (Optional[int]) – Number of crystals to sample

  • percent (Optional[float]) – Percentage of total crystals to sample (0-100)

  • seed (int) – Random seed for reproducibility

Returns:

Tuple of sampled chunks and total number of crystals sampled

Return type:

tuple[list[Chunk], int]