Skip to content
Snippets Groups Projects
Commit 8cf1dc42 authored by Wout De Nolf's avatar Wout De Nolf
Browse files

PlotSpectrumData: add "flatten_mu" to the possible Y values (take by default)

parent cca95533
No related branches found
No related tags found
1 merge request!102Resolve "Plot “flat” group instead of “norm” if “make flat” is ticked"
Pipeline #81195 passed
...@@ -61,7 +61,6 @@ def process_spectr_pre_edge( ...@@ -61,7 +61,6 @@ def process_spectr_pre_edge(
"leexiang", "leexiang",
"tables", "tables",
"fit_erfc", "fit_erfc",
"make_flat",
): ):
if opt_name in _conf: if opt_name in _conf:
opts[opt_name] = _conf[opt_name] opts[opt_name] = _conf[opt_name]
......
...@@ -5,6 +5,7 @@ from ewokscore import Task ...@@ -5,6 +5,7 @@ from ewokscore import Task
_Y_TO_X_NAME = { _Y_TO_X_NAME = {
"mu": "energy", "mu": "energy",
"normalized_mu": "energy", "normalized_mu": "energy",
"flatten_mu": "energy",
"chi": "k", "chi": "k",
"ft": "ft", "ft": "ft",
"noise_savgol": "energy", "noise_savgol": "energy",
...@@ -13,6 +14,7 @@ _LABELS = { ...@@ -13,6 +14,7 @@ _LABELS = {
"energy": "Energy (eV)", "energy": "Energy (eV)",
"mu": "μ", "mu": "μ",
"normalized_mu": "Norm(μ)", "normalized_mu": "Norm(μ)",
"flatten_mu": "Norm(μ)",
"chi": "k^{kweight} χ(k) (Å^-{kweight})", "chi": "k^{kweight} χ(k) (Å^-{kweight})",
"ft": "|χ(k)| (Å^-{kweightp1})", "ft": "|χ(k)| (Å^-{kweightp1})",
"k": "Wavenumber (Å^-1)", "k": "Wavenumber (Å^-1)",
...@@ -29,7 +31,7 @@ def process_plotspectrumdata( ...@@ -29,7 +31,7 @@ def process_plotspectrumdata(
plot_data = dict() plot_data = dict()
if not plot_names: if not plot_names:
plot_names = ("normalized_mu", "chi", "ft", "noise_savgol") plot_names = ("flatten_mu", "chi", "ft", "noise_savgol")
for yname in plot_names: for yname in plot_names:
ylabel = _LABELS[yname] ylabel = _LABELS[yname]
......
...@@ -53,12 +53,12 @@ def test_larch_plotspectrumdata(filename_cu_from_pymca): ...@@ -53,12 +53,12 @@ def test_larch_plotspectrumdata(filename_cu_from_pymca):
{ {
"id": "plotdata", "id": "plotdata",
"name": "plot_names", "name": "plot_names",
"value": ("normalized_mu", "mu", "chi", "ft", "noise_savgol"), "value": ("flatten_mu", "normalized_mu", "mu", "chi", "ft", "noise_savgol"),
} }
) )
result = execute_graph(_LARCH_WORKFLOW, inputs=inputs) result = execute_graph(_LARCH_WORKFLOW, inputs=inputs)
assert len(result["plot_data"]) == 5 assert len(result["plot_data"]) == 6
for name, data in result["plot_data"].items(): for name, data in result["plot_data"].items():
if name == "chi": if name == "chi":
n = 324 n = 324
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment