coseda.exporters package

Submodules

coseda.exporters.hklf4 module

Convert CrystFEL reflection lists to SHELX HKLF 4 format.

coseda.exporters.hklf4.crystfel_to_hklf4(in_path, out_path, *, d_min=None, cell=None)[source]

Convert a CrystFEL reflection list (“crystfel.hkl”) into a SHELX HKLF 4 file.

The output uses the canonical FORTRAN format 3I4, 2F8.2, I4: - h, k, l as 4-char integers - intensity and sigma as 8-char floats with 2 decimals - batch number as 4-char integer (always 0)

The file contains only reflection records followed by a mandatory zero-terminator record (h=k=l=0). HKLF 4 belongs in the .ins instruction file, not in the .hkl reflection file.

Parameters:
  • in_path (str | Path) – Source CrystFEL .hkl file.

  • out_path (str | Path) – Destination HKLF 4 path.

  • d_min (float | None) – Optional resolution cutoff in Å. Reflections with d-spacing below this value are excluded. Requires cell to be provided.

  • cell (tuple[float, float, float, float, float, float] | None) – Unit cell parameters (a, b, c, alpha, beta, gamma) in Å and degrees. Required when d_min is set.

Returns:

Number of reflections written.

Return type:

int

coseda.exporters.hklf4.main(argv=None)[source]

Simple CLI wrapper matching the prototype script usage.

Parameters:

argv (List[str] | None)

Return type:

int

coseda.exporters.mtz module

coseda.exporters.p4p module

coseda.exporters.res module

Module contents