From 7d1881c187199435cb69588d37411550c9e323ce Mon Sep 17 00:00:00 2001 From: Jessica V Date: Thu, 8 Oct 2026 07:22:20 +0100 Subject: [PATCH 1/3] Update element and transition enums --- i14/schema/xanesPointSchema.json | 3 +-- i14/schema/xanesSchema.json | 5 ++--- i14/schema/xanesSparseSchema.json | 3 +-- i14/schema/xrfTomoSchema.json | 5 ++--- nxstacker/schema/nxstackerSchema.json | 3 +-- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/i14/schema/xanesPointSchema.json b/i14/schema/xanesPointSchema.json index 7fc80ae..d6e1117 100644 --- a/i14/schema/xanesPointSchema.json +++ b/i14/schema/xanesPointSchema.json @@ -13,7 +13,6 @@ "edgeElement": { "type": "string", "enum": [ - "", "H", "He", "Li", @@ -136,7 +135,7 @@ }, "edgeTransition": { "type": "string", - "enum": ["", "Ka", "Kb", "La", "Lb", "M"] + "enum": ["Ka", "Kb", "La", "Lb", "M"] }, "normalise": { "type": "boolean", diff --git a/i14/schema/xanesSchema.json b/i14/schema/xanesSchema.json index 9929b37..121cfd8 100644 --- a/i14/schema/xanesSchema.json +++ b/i14/schema/xanesSchema.json @@ -19,14 +19,14 @@ }, "edgeTransition": { "type": "string", - "enum": ["", "Ka", "Kb", "La", "Lb", "M"] + "enum": ["Ka", "Kb", "La", "Lb", "M"] }, "elementToAlign": { "$ref": "#/$defs/elements" }, "transitionToAlign": { "type": "string", - "enum": ["", "Ka", "Kb", "La", "Lb", "M"] + "enum": ["Ka", "Kb", "La", "Lb", "M"] }, "method": { "type": "string", @@ -46,7 +46,6 @@ "elements": { "type": "string", "enum": [ - "", "H", "He", "Li", diff --git a/i14/schema/xanesSparseSchema.json b/i14/schema/xanesSparseSchema.json index c98083c..b1d5ea4 100644 --- a/i14/schema/xanesSparseSchema.json +++ b/i14/schema/xanesSparseSchema.json @@ -22,7 +22,6 @@ "edgeElement": { "type": "string", "enum": [ - "", "H", "He", "Li", @@ -145,7 +144,7 @@ }, "edgeTransition": { "type": "string", - "enum": ["", "Ka", "Kb", "La", "Lb", "M"] + "enum": ["Ka", "Kb", "La", "Lb", "M"] } }, "required": ["outputFolder", "multiScan", "edgeElement", "edgeTransition"] diff --git a/i14/schema/xrfTomoSchema.json b/i14/schema/xrfTomoSchema.json index 6b0f056..47f5f17 100644 --- a/i14/schema/xrfTomoSchema.json +++ b/i14/schema/xrfTomoSchema.json @@ -26,7 +26,7 @@ }, "edgeTransition": { "type": "string", - "enum": ["", "Ka", "Kb", "La", "Lb", "M"] + "enum": ["Ka", "Kb", "La", "Lb", "M"] } } } @@ -36,7 +36,7 @@ }, "transitionToAlign": { "type": "string", - "enum": ["", "Ka", "Kb", "La", "Lb", "M"] + "enum": ["Ka", "Kb", "La", "Lb", "M"] }, "alignmentSection": { "type": "string", @@ -95,7 +95,6 @@ "elements": { "type": "string", "enum": [ - "", "H", "He", "Li", diff --git a/nxstacker/schema/nxstackerSchema.json b/nxstacker/schema/nxstackerSchema.json index c9c3351..8c7f96b 100644 --- a/nxstacker/schema/nxstackerSchema.json +++ b/nxstacker/schema/nxstackerSchema.json @@ -128,7 +128,6 @@ "element": { "type": "string", "enum": [ - "", "H", "He", "Li", @@ -251,7 +250,7 @@ }, "transition": { "type": "string", - "enum": ["", "Ka", "Kb", "La", "Lb", "M"] + "enum": ["Ka", "Kb", "La", "Lb", "M"] } } }, From c7a99afec91e58aa0fbeaf28b4cdcd7cb9554133 Mon Sep 17 00:00:00 2001 From: Jessica V Date: Fri, 9 Oct 2026 13:37:00 +0100 Subject: [PATCH 2/3] Add max_fractional_shift and brute parameters --- i14/notebooks/xanes_autoprocessing0.ipynb | 2 +- i14/schema/xanesSchema.json | 14 ++++++++++++++ i14/schema/xanesUISchema.json | 8 ++++++++ i14/templates/xanes-auto-template.yaml | 13 ++++++++++++- 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/i14/notebooks/xanes_autoprocessing0.ipynb b/i14/notebooks/xanes_autoprocessing0.ipynb index 2d2eaac..df82c46 100644 --- a/i14/notebooks/xanes_autoprocessing0.ipynb +++ b/i14/notebooks/xanes_autoprocessing0.ipynb @@ -417,7 +417,7 @@ " reference=\"current\",\n", " bin_rule=\"sturges\",\n", " max_fractional_shift=max_fractional_shift,\n", - " brute=False\n", + " brute=brute\n", " )\n", " s_element_align.align2D(shifts=shifts)\n", "elif method == \"fourier\":\n", diff --git a/i14/schema/xanesSchema.json b/i14/schema/xanesSchema.json index 121cfd8..a21c185 100644 --- a/i14/schema/xanesSchema.json +++ b/i14/schema/xanesSchema.json @@ -34,6 +34,20 @@ "title": "Method", "description": "The method to use for alignment. `mutual` (mutual information) or `fourier` (Fourier correlation)." }, + "max_fractional_shift": { + "type": "number", + "title": "Max Fractional Shift", + "default": 0.2, + "maximum": 1, + "minimum": 0, + "description": "This number is used to define the maximum shift that could be applied to an axis, as a fraction of the size of the axis. Setting it to a higher number results in longer duration of alignment." + }, + "brute": { + "type": "boolean", + "title": "Brute", + "default": false, + "description": "To use a brute force method or mutual information." + }, "normalise": { "type": "boolean", "title": "Normalise", diff --git a/i14/schema/xanesUISchema.json b/i14/schema/xanesUISchema.json index 6dc24dd..4eaa4c0 100644 --- a/i14/schema/xanesUISchema.json +++ b/i14/schema/xanesUISchema.json @@ -27,6 +27,14 @@ "type": "Control", "scope": "#/properties/method" }, + { + "type": "Control", + "scope": "#/properties/max_fractional_shift" + }, + { + "type": "Control", + "scope": "#/properties/brute" + }, { "type": "Control", "scope": "#/properties/normalise" diff --git a/i14/templates/xanes-auto-template.yaml b/i14/templates/xanes-auto-template.yaml index a8b076f..ae695b5 100644 --- a/i14/templates/xanes-auto-template.yaml +++ b/i14/templates/xanes-auto-template.yaml @@ -39,6 +39,10 @@ spec: value: None - name: transitionToAlign value: None + - name: max_fractional_shift + value: 0.2 + - name: brute + value: false - name: normalise value: true volumeClaimTemplates: @@ -89,6 +93,10 @@ spec: value: "{{`{{ workflow.parameters.edgeElement }}`}}-{{`{{ workflow.parameters.edgeTransition }}`}}" - name: elementToAlign value: "{{`{{ steps.gen-element-to-align.outputs.result }}`}}" + - name: max_fractional_shift + value: "{{`{{ workflow.parameters.max_fractional_shift }}`}}" + - name: brute + value: "{{`{{ workflow.parameters.brute }}`}}" - name: method value: "{{`{{ workflow.parameters.method }}`}}" - name: normalise @@ -117,6 +125,8 @@ spec: - name: outputFolder - name: edgeElement - name: elementToAlign + - name: max_fractional_shift + - name: brute - name: method - name: normalise script: @@ -147,7 +157,8 @@ spec: -p window_width 40 \ -p sztol 0.9 \ -p ref_index None \ - -p max_fractional_shift 0.2 \ + -p max_fractional_shift "{{`{{ inputs.parameters.max_fractional_shift }}`}}" \ + -p brute "{{`{{ inputs.parameters.brute }}`}}" \ -p auto_processing False \ > $OUTPUT/papermill.log 2>&1 From d75497af33d982a6cd98c68d27f6edcc4ef49935 Mon Sep 17 00:00:00 2001 From: Jessica V Date: Mon, 12 Oct 2026 10:52:17 +0100 Subject: [PATCH 3/3] Add display condition for mutual method --- i14/schema/xanesUISchema.json | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/i14/schema/xanesUISchema.json b/i14/schema/xanesUISchema.json index 4eaa4c0..89d4579 100644 --- a/i14/schema/xanesUISchema.json +++ b/i14/schema/xanesUISchema.json @@ -1,5 +1,8 @@ { "type": "VerticalLayout", + "options": { + "formWidth": "80%" + }, "elements": [ { "type": "Control", @@ -29,15 +32,29 @@ }, { "type": "Control", - "scope": "#/properties/max_fractional_shift" - }, - { - "type": "Control", - "scope": "#/properties/brute" + "scope": "#/properties/brute", + "rule": { + "effect": "SHOW", + "condition": { + "scope": "#/properties/method", + "schema": { + "const": "mutual" + } + } + } }, { "type": "Control", - "scope": "#/properties/normalise" + "scope": "#/properties/max_fractional_shift", + "rule": { + "effect": "SHOW", + "condition": { + "scope": "#/properties/brute", + "schema": { + "const": true + } + } + } } ] }, @@ -67,6 +84,10 @@ } ] }, + { + "type": "Control", + "scope": "#/properties/normalise" + }, { "type": "Control", "scope": "#/properties/outputFolder"