slurm_reconstruction¶
nrxrdct.xrdct.slurm_reconstruction ¶
nrxrdct.slurm_reconstruction¶
Tools for distributing tomographic reconstruction across SLURM HPC clusters.
Python API¶
from nrxrdct.slurm_reconstruction import build_sinogram, launch_recon
# Step 1 (optional) — assemble sinogram from integrated HDF5
build_sinogram(
integrated_file = Path("output.h5"),
sinogram_file = Path("sinogram.h5"),
n_rot = 360,
n_tth_angles = 1000,
n_lines = 10,
)
# Step 2 — submit reconstruction jobs
launch_recon(
sinogram_file = Path("sinogram.h5"),
output_file = Path("reconstruction.h5"),
n_jobs = 8,
algo = "SART_CUDA",
num_iter = 200,
gpu = True,
conda_env = "nrxrdct",
)
CLI¶
nrxrdct-slurm-recon build --help
nrxrdct-slurm-recon launch --help
build_sinogram ¶
build_sinogram(integrated_file: Path, sinogram_file: Path, n_rot: int, n_tth_angles: int, n_lines: int = 10, overwrite: bool = False) -> Path
Assemble a sinogram from an integrated HDF5 file and save it to disk.
Calls :func:nrxrdct.reconstruction.assemble_sinogram and writes the
result to sinogram_file as an HDF5 dataset. If sinogram_file already
exists and overwrite is False, the function returns immediately
without rebuilding.
The sinogram is stored with axes labelled so that the worker can read individual 2θ slices efficiently:
sinogram— shape(n_tth, n_rot, n_lines), dtype float32radial— 2θ axis copied from the integrated file, withunitattribute preservedmotors/rot— rotation angles in degreesmotors/dty— translation motor positions
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in src/nrxrdct/xrdct/slurm_reconstruction/launch_recon.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |