Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flux changes for NXmx #1035

Merged
merged 9 commits into from
Sep 15, 2022
Merged

Flux changes for NXmx #1035

merged 9 commits into from
Sep 15, 2022

Conversation

phyy-nx
Copy link
Contributor

@phyy-nx phyy-nx commented Mar 15, 2022

  • Add flux_integrated and total_flux_integrated, Useful where temporal profiles of flux are not known.
  • Change total_flux to not be required
  • Add NXbeam attribute flux, to point to which flux field is used
  • Add optional NXmonitor for additional incident beam data

Closes #986
Closes nexusformat/NIAC#96

- Add flux_integrated and total_flux_integrated, Useful where temporal profiles of flux are not known.
- Change total_flux to not be required
- Add NXbeam attribute flux, to point to which flux field is used
- Add optional NXmonitor for additional incident beam data

Closes #986
@phyy-nx phyy-nx added the NIAC should review The NIAC should review/discuss label Mar 15, 2022
@phyy-nx phyy-nx requested review from yayahjb March 15, 2022 02:32
Copy link
Contributor

@yayahjb yayahjb left a comment

Choose a reason for hiding this comment

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

Good fix -- Herbert

@woutdenolf
Copy link
Contributor

woutdenolf commented Mar 15, 2022

Referenced units:

  • NX_FLUX: 1/s/cm^2
  • NX_PER_AREA: 1/cm^2
  • NX_FREQUENCY: 1/s
  • NX_DIMENSIONLESS

This is what currently exists:

NXbeam
  flux[i]: (optional) NX_FLOAT {units=NX_FLUX}

NXmx
ENTRY: (required) NXentry
  BEAM: (required) NXbeam
   flux: (optional) NX_FLOAT {units=NX_FLUX}
   total_flux: (required) NX_FLOAT {units=NX_FREQUENCY}

This is the proposed changes in this MR (without the NXmonitor part, only the flux related things):

NXbeam
  flux[i]: (optional) NX_FLOAT {units=NX_FLUX}

NXmx
ENTRY: (required) NXentry
  BEAM: (required) NXbeam
   @flux: (optional) NX_CHAR
   total_flux: (optional) NX_FLOAT {units=NX_FREQUENCY}
   flux: (optional) NX_FLOAT {units=NX_FLUX}
   flux_integrated: (optional) NX_FLOAT {units=NX_PER_AREA}
   total_flux_integrated: (optional) NX_FLOAT {units=NX_DIMENSIONLESS}

So the word "integrated" stands for time integrated and the word "total" stands for area integrated.

The reason we cannot come up with sensible names like

  • flux_integrated -> flux_time_integrated
  • total_flux -> flux_area_integrated
  • total_flux_integrated -> flux_time_and_area_integrated

is because NXmx already has total_flux.

Sorry @phyy-nx for my initial pessimistic view, the two units that were wrong scared the hell out of me. The names are very unfortunate but we already have total_flux in NXmx so I don't see another way either. I'd say we should not propagate these unfortunate names to NXbeam in the future.

I have no strong opinion on the addition of the optional NXmonitor.

@phyy-nx
Copy link
Contributor Author

phyy-nx commented Mar 15, 2022

No worries, thanks for the comments. I'll review your comments more carefully as soon as I get a chance.

@yayahjb
Copy link
Contributor

yayahjb commented Mar 15, 2022 via email

@woutdenolf
Copy link
Contributor

woutdenolf commented Mar 15, 2022

I'll review your comments more carefully as soon as I get a chance.

@phyy-nx There is nothing to review, I didn't propose anything different. You can go ahead with what you have after fixing the units of flux_integrated and total_flux_integrated. I just described in my own words what my understanding is of your changes. If this corresponds with what you intended, then I have no further comments. After fixing those two units it is all clear now. The names are unfortunate but as I said, I don't think we can do better provided what is already in the standard.

but it can be a disaster to make changes to existing tags

For sure.

@woutdenolf
Copy link
Contributor

@phyy-nx Maybe you could add a comment about flux integration to the respective fields?

  • flux_integrated: flux integrated over time
  • total_flux: flux integrated over area
  • total_flux_integrated: flux integrated over time and area

You can understand that from the units but maybe it is good to mention it explicitly since the words "total" and "integrated" are not self explanatory.

@prjemian
Copy link
Contributor

prjemian commented Jun 2, 2022

@phyy-nx Since this is labeled "NIAC should review", then is there anything to do at the Code Camp this month? If not, then remove this PR from the Code Camp project.

@woutdenolf
Copy link
Contributor

I proposed a fix for all my comments in Merge #1082. You can merge it in this branch if you approve.

@prjemian prjemian added this to the NXDL 2022.06 milestone Jun 14, 2022
@phyy-nx
Copy link
Contributor Author

phyy-nx commented Jun 14, 2022

Ok, I think that's all the feedback from the spring NIAC. I think we can remove the code camp label and vote on it this fall.

@phyy-nx phyy-nx removed the code camp label Jun 14, 2022
@woutdenolf woutdenolf self-requested a review June 14, 2022 17:19
Copy link
Contributor

@woutdenolf woutdenolf left a comment

Choose a reason for hiding this comment

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

LGTM

@prjemian
Copy link
Contributor

GitHub reports a merge conflict with NXmx.nxdl.xml.

Also, since we will not merge this until the NIAC looks at it, can we convert this PR to draft state to prevent someone merging?

@phyy-nx phyy-nx marked this pull request as draft June 14, 2022 21:09
@phyy-nx
Copy link
Contributor Author

phyy-nx commented Jun 14, 2022

Conflicts are fixed

@phyy-nx
Copy link
Contributor Author

phyy-nx commented Jun 16, 2022

Conversation from code camp summer 2022. Since this needs a NIAC vote anyway, let's make as a goal to use the logic proposed in #1002 to enforce a choice between flux, total_flux, flux_integrated, total_flux_integrated, and the path to an NXmonitor with per-shot flux information. We'd like to have that ready by the fall NIAC meeting. Owners: @benajamin for finishing the new NXDL rule needed to enforce choices between fields and groups, and @phyy-nx to add the logic to this PR.

@phyy-nx
Copy link
Contributor Author

phyy-nx commented Sep 14, 2022

From Fall 2022 NIAC, don't need to wait on #1002. Instead, vote on this, merge it, and add a new issue to require one of flux, total_flux, flux_integrated, total_flux_integrated

@prjemian
Copy link
Contributor

There is a conflict involving the NXmonitor group.

@phyy-nx phyy-nx marked this pull request as ready for review September 14, 2022 22:15
@phyy-nx
Copy link
Contributor Author

phyy-nx commented Sep 14, 2022

Conflicts fixed, ready for NIAC vote

@prjemian
Copy link
Contributor

prjemian commented Sep 15, 2022

CI testing failed:

Warning, treated as error:
/home/runner/work/definitions/definitions/build/manual/source/classes/applications/NXmx.rst:1005:undefined label: 'nxmx-entry-instrument-beam-total-flux-field'
make: *** [Makefile:62: html] Error 2
Error: Process completed with exit code 2.

And that means my previous change was not correct. My apology. Please switch back to:

:ref:`flux </NXmx/ENTRY/INSTRUMENT/BEAM/flux-field>`

…te that the user can provide a link to an NXmonitor
This reverts commit 85b5288.
Copy link
Contributor

@prjemian prjemian left a comment

Choose a reason for hiding this comment

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

LGTM

@benajamin
Copy link
Contributor

The proposal is to accept the changes to NXmx represented by pull request #1035

@benajamin benajamin added NIAC approved and removed NIAC should review The NIAC should review/discuss labels Sep 15, 2022
@phyy-nx phyy-nx merged commit e3f64e9 into main Sep 15, 2022
@phyy-nx phyy-nx deleted the nxmx_flux branch September 15, 2022 15:39
@phyy-nx
Copy link
Contributor Author

phyy-nx commented Sep 15, 2022

Thanks folks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

NXmx total_flux NXmx total_flux
6 participants