@@ -25,11 +25,11 @@ spec:
2525 - name : outputFolder
2626 value : " testing"
2727 - name : multiScan
28- value : ' [{"multiScan":{"start":423844 ,"end":423947 ,"excluded":[423908,423909,423911,423916,423917,423935,423936,423937,423940,423942,423943,423944,423945 ]}}]'
28+ value : ' [{"multiScan":{"start":436147 ,"end":436230 ,"excluded":[]}}]'
2929 - name : multiEdge
30- value : ' [{"edgeElement":"Pb ","edgeTransition":"La"},{"edgeElement":"Br ","edgeTransition":"Ka"}]'
30+ value : ' [{"edgeElement":"Tl ","edgeTransition":"La"},{"edgeElement":"Ga ","edgeTransition":"Ka"}]'
3131 - name : elementToAlign
32- value : " Pb "
32+ value : " Tl "
3333 - name : transitionToAlign
3434 value : " La"
3535 - name : alignmentSection
4040 value : true
4141 - name : cor
4242 value : " null"
43+ - name : reconsMethod
44+ value : " FBP"
4345 volumeClaimTemplates :
4446 - metadata :
4547 name : tmp
@@ -57,16 +59,24 @@ spec:
5759 volumeMounts :
5860 - name : session
5961 mountPath : " {{`{{ workflow.parameters.visitdir }}`}}"
60- - name : tmp
61- mountPath : /tmp
6262 command : [bash]
6363 source : |
6464 OUTPUT="{{`{{ workflow.parameters.visitdir }}`}}"/processing/workflows/"{{`{{ workflow.parameters.outputFolder }}`}}"
65+ METHOD="{{`{{ workflow.parameters.reconsMethod }}`}}"
6566 mkdir -p $OUTPUT
6667 echo '{{ .Files.Get "notebooks/xrf_tomo_align_initial.ipynb" | b64enc }}' | base64 -d > $OUTPUT/align_initial.ipynb
6768 echo '{{ .Files.Get "notebooks/xrf_tomo_align_and_normalise.ipynb" | b64enc }}' | base64 -d > $OUTPUT/align_and_normalise.ipynb
6869 echo '{{ .Files.Get "notebooks/xrf_tomo_plotting.ipynb" | b64enc }}' | base64 -d > $OUTPUT/plotting.ipynb
69- echo '{{ .Files.Get "configs/httomo_config_fbp.yaml" | b64enc }}' | base64 -d > $OUTPUT/httomo.yaml
70+ echo '{{ .Files.Get "configs/httomo_config_OLEM.yaml" | b64enc }}' | base64 -d > $OUTPUT/httomo_OLEM.yaml
71+ echo '{{ .Files.Get "configs/httomo_config_FBP.yaml" | b64enc }}' | base64 -d > $OUTPUT/httomo_FBP.yaml
72+ if [ "$METHOD" = "OLEM" ]; then
73+ mv $OUTPUT/httomo_OLEM.yaml $OUTPUT/httomo.yaml
74+ rm $OUTPUT/httomo_FBP.yaml
75+ fi
76+ if [ "$METHOD" = "FBP" ]; then
77+ mv $OUTPUT/httomo_FBP.yaml $OUTPUT/httomo.yaml
78+ rm $OUTPUT/httomo_OLEM.yaml
79+ fi
7080 volumes :
7181 - name : session
7282 hostPath :
@@ -138,6 +148,7 @@ spec:
138148 -p inpath "tomo_xrf_${START}_${END}_${EDGE}.nxs" \
139149 -p outpath_nexus "${EDGE}_aligned_initial.nxs" \
140150 -p outpath_shifts "${EDGE}_shifts.txt" \
151+ -p outpath_cor "${EDGE}_cor.txt" \
141152 -p alignment_section "{{`{{ workflow.parameters.alignmentSection }}`}}" \
142153 -p alignment_band "{{`{{ workflow.parameters.alignmentBand }}`}}"
143154 --prepare-only
@@ -149,6 +160,10 @@ spec:
149160 - name : tmp
150161 mountPath : /tmp
151162 outputs :
163+ parameters :
164+ - name : initcor
165+ valueFrom :
166+ path : " {{`{{ workflow.parameters.visitdir }}`}}/processing/workflows/{{`{{ workflow.parameters.outputFolder }}`}}/{{`{{ workflow.parameters.elementToAlign }}`}}-{{`{{ workflow.parameters.transitionToAlign }}`}}_cor.txt"
152167 artifacts :
153168 - name : align_initial
154169 path : " {{`{{ workflow.parameters.visitdir }}`}}/processing/workflows/{{`{{ workflow.parameters.outputFolder }}`}}/_assets/align_initial.html"
@@ -265,8 +280,9 @@ spec:
265280 inputs :
266281 parameters :
267282 - name : edge
283+ - name : initcor
268284 script :
269- image : ghcr.io/diamondlightsource/httomo:2.5
285+ image : ghcr.io/diamondlightsource/httomo:3.2.1
270286 env :
271287 - name : CUPY_CACHE_DIR
272288 value : /tmp/.cupy/kernel_cache
@@ -284,8 +300,10 @@ spec:
284300 TRANSITION="{{`{{= sprig.mustFromJson(inputs.parameters.edge).edgeTransition }}`}}"
285301 mkdir -p $OUTPUT/httomo_output
286302
303+ COR_ESTIMATE="{{`{{ inputs.parameters.initcor }}`}}"
304+ [[ $COR_ESTIMATE != "null" ]] && sed -i 's/<INITCOR>/'"${COR_ESTIMATE}"'/' $OUTPUT/httomo.yaml
287305 COR="{{`{{ workflow.parameters.cor }}`}}"
288- [[ $COR != "null" ]] && sed -i 's/${{`{{centering.side_outputs.centre_of_rotation}}`}}/'"${COR}"'/' $OUTPUT/httomo.yaml
306+ [[ $COR != "null" ]] && sed -i 's/${{`{{centering.side_outputs.centre_of_rotation}}`}}/'"${COR}"'/' $OUTPUT/httomo.yaml
289307
290308 cmd=(/opt/conda/bin/mpirun -n 1 /opt/conda/bin/python -m httomo run)
291309 cmd+=("--output-folder-name=${ELEMENT}-${TRANSITION}")
@@ -418,6 +436,7 @@ spec:
418436 inputs :
419437 parameters :
420438 - name : edge
439+ - name : initcor
421440 dag :
422441 tasks :
423442 - name : alignment
@@ -432,6 +451,8 @@ spec:
432451 parameters :
433452 - name : edge
434453 value : " {{`{{ inputs.parameters.edge }}`}}"
454+ - name : initcor
455+ value : " {{`{{ inputs.parameters.initcor }}`}}"
435456 dependencies : [alignment]
436457
437458 - name : xrf-tomo-pipeline
@@ -463,6 +484,8 @@ spec:
463484 parameters :
464485 - name : edge
465486 value : " {{`{{ item }}`}}"
487+ - name : initcor
488+ value : " {{`{{ tasks.generate-shifts.outputs.parameters.initcor }}`}}"
466489 withParam : " {{`{{ workflow.parameters.multiEdge }}`}}"
467490
468491 - name : show-results
0 commit comments