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

Workflow dependency restructure #155

Merged
merged 11 commits into from
Aug 7, 2024

Conversation

SimonHeybrock
Copy link
Member

Fixes #154.

There are some subtleties here, around different way of handling ESS NeXus vs. Mantid files.

The I(Q) beam-center finder was a headache, but I hope by passing the workflow I managed to make it a bit more natural. There is potential room for improvement, by avoiding reloading data even if positions change, but I left it for now until we know if this actually is an issue in practice.

"metadata": {},
"outputs": [],
"source": [
"workflow[BeamCenter] = sc.vector([0, 0, 0], unit='m')\n",
Copy link
Member

Choose a reason for hiding this comment

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

I find it strange from a UX point of view that we first need to set the center to [0,0,0] before computing it...

But I guess you made it so because we don't want to have it set to zero by default in the workflow because users will forget to compute it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. It could in principle also be used to set a default that then gets refined... and I think I should add a test to ensure that we still get the absolute (relative to [0,0,0]) beam center back in a such as case.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is in fact not working: If we set anything but [0,0,0] the beam-center finder(s) return a beam center relative to the previously set center, which is not what we want, I think?

Copy link
Member Author

Choose a reason for hiding this comment

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

Please see update, as discussed on the call.

Comment on lines +57 to +58
sample_offset: SampleOffset,
detector_bank_offset: DetectorBankOffset,
Copy link
Member

Choose a reason for hiding this comment

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

I keep changing my mind about these things. Are they just ISIS specifics that will go away at ESS and therefore should just be corrected in the input files and not appear here at all, or are they going to be very common and done for almost every experiment, and thus should be part of the general SANS workflow...

Copy link
Member Author

Choose a reason for hiding this comment

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

Time will tell? We can refactor later?

@@ -22,15 +22,19 @@
"""Sample holder mask"""


def detector_edge_mask(sample: TofData[SampleRun]) -> DetectorEdgeMask:
# It may make more sense to depend on CalibratedDetector here, but the current
Copy link
Member

Choose a reason for hiding this comment

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

Yes, that would make more sense, but we need the masks to be there before we start computing a center of mass, which is annoying.

Copy link
Member Author

Choose a reason for hiding this comment

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

The masks are anyway applied after setting the beam center (see your other comment #155 (comment)). So this could easily be changed, but maybe that is not how the scientists work? Do you remember where these numbers come from?

Copy link
Member Author

Choose a reason for hiding this comment

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

Note than in principle we could set masks before loading data (when they come from a file).... but maybe that is not desirable if other types of masks come into play?

Copy link
Member

Choose a reason for hiding this comment

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

Numbers for masks came from trial and error with Wojciech. We just wanted to mask the edges and found values that worked.

src/ess/isissans/sans2d.py Show resolved Hide resolved
pipeline = sciline.Pipeline(providers, params=params)
pipeline[MaskedData[SampleRun]] = data
calibrated = pipeline.compute(CalibratedMaskedData[SampleRun])
graph = workflow.compute(ElasticCoordTransformGraph)
Copy link
Member

Choose a reason for hiding this comment

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

Nice you could remove all of the above 👍

Copy link
Member

@nvaytet nvaytet left a comment

Choose a reason for hiding this comment

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

Looks good to me.
Tests are failing but I assume this is expected?

@SimonHeybrock
Copy link
Member Author

Looks good to me. Tests are failing but I assume this is expected?

Yes, failing due to unreleased and unreviewed changes in ESSreduce.

@SimonHeybrock SimonHeybrock force-pushed the workflow-dependency-restructure branch from 98126e4 to 00eb05d Compare August 7, 2024 03:31
@SimonHeybrock SimonHeybrock merged commit d56f59b into split-event-load Aug 7, 2024
3 checks passed
@SimonHeybrock SimonHeybrock deleted the workflow-dependency-restructure branch August 7, 2024 05:27
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