Skip to content

Fixes in NXmpes#361

Merged
lukaspie merged 4 commits into
fairmatfrom
mpes-enum
Mar 20, 2025
Merged

Fixes in NXmpes#361
lukaspie merged 4 commits into
fairmatfrom
mpes-enum

Conversation

@lukaspie
Copy link
Copy Markdown
Collaborator

@rettigl I am not sure how one would write this now, both on the appdef level and in the file. Do you have a good suggestion? Even with this approach here, it is failing when I write ['kinetic_energy'] into the file

@lukaspie lukaspie requested a review from rettigl March 17, 2025 17:02
@rettigl
Copy link
Copy Markdown
Collaborator

rettigl commented Mar 17, 2025

I think exactly like that, it's the same here:

<item value="['angular0', 'angular1', 'energy']"/>

I believe that worked at some point. I will have a look.

Copy link
Copy Markdown
Collaborator

@rettigl rettigl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for me:
"/ENTRY/CALIBRATION[transmission_correction]":{
"calibrated_axis": "@DaTa:angular0.data",
"transmission_function/@signal": "relative_intensity",
"transmission_function/@axes": "kinetic_energy",
"transmission_function/kinetic_energy": "@DaTa:angular0.data",
"transmission_function/kinetic_energy/@Units": "eV",
"transmission_function/relative_intensity": "@DaTa:angular0.data"
},
Changing @axes gives:
WARNING: The value at /ENTRY[entry]/CALIBRATION[transmission_correction]/transmission_function/@axes should be one of the following: ['kinetic_energy'].

@lukaspie
Copy link
Copy Markdown
Collaborator Author

lukaspie commented Mar 18, 2025

But that is exactly the issue, @axes is supposed to be an array, see the screenshot.

image

In your implementation, @axes is just the single string "kinetic_energy", whereas it should be ["kinetic_energy"].

How do we need to denote the enum of an array of strings in the application definition and how should we write it in the template?

@rettigl
Copy link
Copy Markdown
Collaborator

rettigl commented Mar 18, 2025

You are right, I will check again.

@lukaspie lukaspie changed the title enumeration fix in NXmpes Fixes in NXmpes Mar 18, 2025
@rettigl
Copy link
Copy Markdown
Collaborator

rettigl commented Mar 18, 2025

This works for me:

  "/ENTRY/CALIBRATION[transmission_correction]":{
    "calibrated_axis": "@data:angular0.data",
    "transmission_function/@signal": "relative_intensity",
    "transmission_function/@axes": ["kinetic_energy"],
    "transmission_function/kinetic_energy": "@data:angular0.data",
    "transmission_function/kinetic_energy/@units": "eV",
    "transmission_function/relative_intensity": "@data:angular0.data"
  },

The axes is indeed supposed to be a list of strings inside the file, not a single string.

Comment thread base_classes/nyaml/NXparameters.yaml Outdated
@lukaspie lukaspie merged commit 5dfb75c into fairmat Mar 20, 2025
@lukaspie lukaspie deleted the mpes-enum branch March 20, 2025 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants