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/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..a21c185 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", @@ -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", @@ -46,7 +60,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/xanesUISchema.json b/i14/schema/xanesUISchema.json index 6dc24dd..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,7 +32,29 @@ }, { "type": "Control", - "scope": "#/properties/normalise" + "scope": "#/properties/brute", + "rule": { + "effect": "SHOW", + "condition": { + "scope": "#/properties/method", + "schema": { + "const": "mutual" + } + } + } + }, + { + "type": "Control", + "scope": "#/properties/max_fractional_shift", + "rule": { + "effect": "SHOW", + "condition": { + "scope": "#/properties/brute", + "schema": { + "const": true + } + } + } } ] }, @@ -59,6 +84,10 @@ } ] }, + { + "type": "Control", + "scope": "#/properties/normalise" + }, { "type": "Control", "scope": "#/properties/outputFolder" 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/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 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"] } } },