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

Add log compression option to AlignAndFocusPowder #37352

Merged

Conversation

rosswhitfield
Copy link
Member

@rosswhitfield rosswhitfield commented May 14, 2024

Description of work

Modify the CompressTolerance parameter and add a parameter CompressBinningMode to allow for logorithmic compression that is now available in CompressEvents. The logic of AlignAndFocusPowder::shouldCompressUnfocused() method should be updated as well since the predicted number of logorithmic compressed events is different than linear compression.

Summary of work

Fixes 5163: Modify AlignAndFocusPowder to take advantage of new capability in CompressEvents

Further detail of work

To test:

Taken from the unit test, you play with the difference between linear and log binning.

ws = CreateSampleWorkspace("Event", "Powder Diffraction", XMin=300, XMax=16666, BinWidth=1.0, NumBanks=1, BankPixelWidth=12, NumEvents=10000)
RotateInstrumentComponent(ws, ComponentName="bank1", Y=1, Angle=90.)
MoveInstrumentComponent(ws, ComponentName="bank1", X=5, Y=-.1, Z=.1, RelativePosition=False)

out  = AlignAndFocusPowder(ws, Dspacing=False, PreserveEvents=True, CompressTolerance=-1e-5, ResampleX=1000)
out2 = AlignAndFocusPowder(ws, Dspacing=False, PreserveEvents=True, CompressTolerance=1e-5, ResampleX=1000)

Reviewer

Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.

Code Review

  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there is GUI work does it follow the GUI standards?
  • If there are changes in the release notes then do they describe the changes appropriately?
  • Do the release notes conform to the release notes guide?

Functional Tests

  • Do changes function as described? Add comments below that describe the tests performed?
  • Do the changes handle unexpected situations, e.g. bad input?
  • Has the relevant (user and developer) documentation been added/updated?

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

Gatekeeper

If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.

@rosswhitfield rosswhitfield added this to the Release 6.11 milestone May 14, 2024
@rosswhitfield rosswhitfield force-pushed the AlignAndFocusPowder_compress_log branch from 4c2bafc to 47655c8 Compare May 14, 2024 02:46
@rosswhitfield rosswhitfield marked this pull request as ready for review May 14, 2024 04:06
Copy link
Member

@peterfpeterson peterfpeterson 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. This will allow more people to use the feature in AlignAndFocusPowder and integrating it into calling workflow algorithms.

@KedoKudo KedoKudo merged commit 9202a6d into mantidproject:main May 16, 2024
10 checks passed
@rosswhitfield rosswhitfield deleted the AlignAndFocusPowder_compress_log branch May 17, 2024 06:46
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.

None yet

3 participants