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

Fairmat 2024: additions and clarifications in NXbeam #1408

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

lukaspie
Copy link
Contributor

@lukaspie lukaspie commented Sep 23, 2024

With this PR, the idea is:

  • to clarify how the incident_energy field in NXbeam is to be used. Specfically, for polychromatic beams, a single field incident_energy is not sufficient, but rather one needs information about the incident_energy_spread. In addition, for a polychromatic beam, it is useful to incidate the incident_energy_weights, i.e., how much each each of energies contributes to the overall intensity.
  • add some fields about pulsed beams and allow for descriptions of FROG (frequency-resolved optical gating) setups.
  • add a field previous_device to indicate that this beam originate from a given beam device. This can be useful to describe the chain of devices and beams in the description of the beam paths (e.g., in an optical spectroscopy experiment).

@sanbrock sanbrock mentioned this pull request Sep 26, 2024
1 task
@lukaspie lukaspie linked an issue Sep 29, 2024 that may be closed by this pull request
1 task
@prjemian
Copy link
Contributor

RST wraps computer code with double backticks:

* correct: ``energy``
* incorrect: `energy`

This is one of the most common typos in the documentation.

@lukaspie
Copy link
Contributor Author

RST wraps computer code with double backticks:

* correct: ``energy``
* incorrect: `energy`

This is one of the most common typos in the documentation.

You are right, I changed it here for our new contribution where we make use of backticks.

Copy link
Contributor

@RubelMozumder RubelMozumder left a comment

Choose a reason for hiding this comment

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

I just randomly went through the file to be knowledged of the NAIC decision. I found some typos of bouble back tick while mentioning some fields.

base_classes/NXbeam.nxdl.xml Outdated Show resolved Hide resolved
base_classes/NXbeam.nxdl.xml Outdated Show resolved Hide resolved
base_classes/NXbeam.nxdl.xml Outdated Show resolved Hide resolved
@lukaspie lukaspie force-pushed the fairmat-2024-nxbeam branch from 2529db0 to c75d5c2 Compare October 16, 2024 08:44
@lukaspie
Copy link
Contributor Author

lukaspie commented Dec 6, 2024

@phyy-nx I added a bit of description to this PR as well. As far as I can remember, there was a bit of discussion on this PR in the NIAC meeting, but no formal decision was taken. This PR is ready in so far as further discussion (and subsequent decision) by NIAC can be initiated.

Note that when going through this PR again, I figured it could also be useful to extract the characteristics of a pulsed beam (which make up most of the changes in this PR) to its own sub-class. We would be open to doing so if that is what NIAC wants.

@phyy-nx
Copy link
Contributor

phyy-nx commented Dec 9, 2024

Comments from Telco:

  • Instead of duplicating documentation from incident_wavelength in incident_energy, supply a reference instead and note the same conventions. The same for incident_energy_weights and incident_energy_spread.
  • Change units back to NX_ANY for incident_polarization and final_polarization. Rationale: neutrons are specified as a percentage of spin states, so we can't constrain it here.

Once done, based on Telco conversation, we can put this up for an online vote

@phyy-nx
Copy link
Contributor

phyy-nx commented Dec 10, 2024

Hi all, as discussed in the Telco, now that the above points have been addressed (thanks @lukaspie), we can now move this PR to an online vote.  NIAC committee members please vote on this PR using emojis. 👍 for yes, 👎 for no, anything else (for example 👀) to abstain.  We need 14 votes to hit quorum so please review and vote!

As you review, please make a special note of the proposal to add these fields:

    <field name="previous_device">
        <doc>
             Indicates the beam device from which this beam originates.
             This defines, whether the beam in an "input" or "output" beam.
        </doc>
    </field>
    <field name="next_device">
        <doc>
             Gives the beam device which this beam will interact with next.
        </doc>
    </field>

As discussed on the call, these two fields allow connecting devices together. A figure was shown demonstrating the usage. We decided that the depends_on convention used for NXtransformations wasn't applicable here, due to the possibility of a set of branched connections.

Any questions we can answer here. Otherwise, cast a vote! Thanks!

@lukaspie
Copy link
Contributor Author

As a follow up to the discussion in the Telco, here is the image that I was showing on how we are envisioning connecting devices and instances of NXbeam together.
image

@lukaspie lukaspie removed discussion needed NIAC should review The NIAC should review/discuss labels Dec 11, 2024
@PeterC-DLS
Copy link
Contributor

Can the previous/next thing be an NXsample? Maybe a better name is required than device

@phyy-nx
Copy link
Contributor

phyy-nx commented Dec 18, 2024

Can the previous/next thing be an NXsample? Maybe a better name is required than device

My thought was that this is for components hooked together. The only usage of NXbeam at present is in NXmx and it is a member of an NXinstrument group. The implication is that beam hits the sample. Indeed, NXmx used to have the NXbeam group in the NXsample group, but we moved it to the NXinstrument group instead.

@sanbrock @mkuehbach @lukaspie is connecting a beam to a sample directly a use case you are interested in?

@lukaspie lukaspie force-pushed the fairmat-2024-nxbeam branch from da81fb9 to 3599458 Compare January 16, 2025 15:59
@phyy-nx
Copy link
Contributor

phyy-nx commented Jan 16, 2025

Proposal from Telco:

  • Remove previous/next device from this PR
  • Remove NXbeam_element from this PR
  • Add inputs and outputs to NXcomponent: lists of other components (NX_CHAR, rank of 0 or 1 (single or multiple), but it's optional)

Implies that NXcomponent would include anything that can affect the beam

A charge to the committee: go review and comment on #1525!! (consider implications of #1507)

Would want a flow/class diagram showing this inheritance. Also, don't want to lose the cool figure above of the multiple beam paths!

@lukaspie lukaspie force-pushed the fairmat-2024-nxbeam branch from 5eb2ceb to 15cd321 Compare January 17, 2025 13:39
@lukaspie
Copy link
Contributor Author

Proposal from Telco:

  • Remove previous/next device from this PR
  • Remove NXbeam_element from this PR

Done here, should be ready for trying another vote.

  • Add inputs and outputs to NXcomponent: lists of other components (NX_CHAR, rank of 0 or 1 (single or multiple), but it's optional)

Implies that NXcomponent would include anything that can affect the beam

Implemented like this in #1525

A charge to the committee: go review and comment on #1525!! (consider implications of #1507)

Would want a flow/class diagram showing this inheritance. Also, don't want to lose the cool figure above of the multiple beam paths!

What's missing here is where to put this figure. Should the beam still have next/previous element? Or is this chaining just through the components?

@phyy-nx
Copy link
Contributor

phyy-nx commented Jan 27, 2025

Hi all, as discussed in the Telco, we can now move this PR to an online vote. NIAC committee members please vote on this PR using emojis on this comment. 👍 for yes, 👎 for no, anything else (for example 👀) to abstain. We need 14 votes to hit quorum so please review and vote!

@@ -245,6 +269,80 @@
<dim index="1" value="nP"/>
</dimensions>
</field>
<field name="pulse_energy" type="NX_FLOAT" units="NX_ENERGY">
<doc>
Energy of a single pulse at the diagnostic point

Choose a reason for hiding this comment

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

First, the definition seems to restrict the location to a "diagnostic point". What is a diagnostic point? NXbeam description doesn't mention "diagnostic point".

Second, the description suggests that this field is only available for diagnostic points; it is not available for the other uses of NXbeam. Is this the intention?

These two comments also apply to average_power, fluence and pulse_duration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The docs of NXbeam are talking about "properties of the beam at a given location", which to be is the same as the diagnostic point. What other use of NXbeam than "the characteristics of the beam at a certain point" do you imagine?

Choose a reason for hiding this comment

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

You say that "properties of the beam at a given location" is the same as the diagnostic point, but this definition isn't provided in the proposed changes. The term "diagnostic point" is just used.

Also, I'm also not sure your statement is true. The definition of NXBeam also lists NXsample as a place where NXbeam is used and I don't think a sample is a diagnostic point.

The existing fields seem to use "this component". As a suggestion, would the following work?

Energy of a single pulse at this component.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with you here, but this is not covered by the vote. We could just add it after the vote (since it only changes the docstring) or make a separate PR for this.

</doc>
<attribute name="reference_beam" type="NX_CHAR">
<doc>
A reference to the beam in relation to which the delay is.

Choose a reason for hiding this comment

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

The value is NX_CHAR, but perhaps the semantics of the value could be better described.

Is the value some facility-local specification, some internal reference to a description elsewhere within the NeXus file, ...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea here is to use it like the @depends_on field in NXtransformations (see also discussion about NXcomponent), i.e., an internal reference to a description elsewhere within the NeXus file.

We could make this clearer, but not sure if that is covered by the ongoing vote.

domna and others added 15 commits February 3, 2025 10:48
… version of yaml.

Removing unintensional comments
* Add nexus definitions/files for beam path description

* Update base_classes/nyaml/NXopt_assembly.yaml

Co-authored-by: Lukas Pielsticker <[email protected]>

* Update base_classes/nyaml/NXopt_assembly.yaml

Co-authored-by: Lukas Pielsticker <[email protected]>

* Apply suggestions from code review

Co-authored-by: Lukas Pielsticker <[email protected]>

* Apply suggestions from code review

Co-authored-by: Lukas Pielsticker <[email protected]>

* Apply suggestions from code review

Co-authored-by: Lukas Pielsticker <[email protected]>

* Apply suggestions from code review

Co-authored-by: Lukas Pielsticker <[email protected]>

* Apply suggestions from code review

Co-authored-by: Lukas Pielsticker <[email protected]>

* Apply suggestions from code review

Co-authored-by: Lukas Pielsticker <[email protected]>

* Apply suggestions from code review

Co-authored-by: Lukas Pielsticker <[email protected]>

* add_NX_defs_for_beam_path

* modifying_yaml_files

* fixing_nyaml_make_file

* Adjusted files with Sandor together according to
earlier hardcoded .nxs file

* Added the missing nxdl.xml files via nyaml2nxdl
Version=0.0.8 was used for nyaml.

* moved created nxdl.xml files to correct directory

* Suggestions to fix ci/cd by in NXtransfer_matrix_table.yaml

Co-authored-by: Florian Dobener <[email protected]>

* renaming transfer_matrix_table to beam_transfermatrix_table and opt_element to beam_device; also merging NXopt_beam to NXbeam

* remove old nxdl files

---------

Co-authored-by: Ron Hildebrandt <[email protected]>
Co-authored-by: Lukas Pielsticker <[email protected]>
Co-authored-by: Florian Dobener <[email protected]>
# Conflicts:
#	base_classes/nyaml/NXbeam.yaml
@lukaspie lukaspie force-pushed the fairmat-2024-nxbeam branch from e7a860c to 8052de6 Compare February 3, 2025 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NIAC vote needed PR needs an approving vote from NIAC before merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NXbeam