Skip to content
New issue

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

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

Already on GitHub? # to your account

Include shaded regions for log values outside TimeROI #35492

Merged
merged 7 commits into from
May 3, 2023
Merged

Conversation

searscr
Copy link
Contributor

@searscr searscr commented Apr 28, 2023

Description of work

Add a shaded region to sample logs plots that show regions of the logs being excluded by the TimeROI. The option is enabled by default in the Sample Log view and can be enabled in python scripts by including ShowTimeROI=True in the argument list.

To test:

from mantid.simpleapi import *
import matplotlib.pyplot as plt
import numpy as np

w=Load('CNCS_7860')
wsfiltered=FilterByTime(w, StartTime=80, StopTime=130)
fig = plt.figure()
ax1 = fig.add_subplot(211,projection='mantid')
ax2 = fig.add_subplot(212,projection='mantid')
ax1.plot(wsfiltered, LogName='ChopperStatus5',ShowTimeROI=True)
ax1.set_title('From run start')
ax2.plot(wsfiltered, LogName='ChopperStatus5',FullTime=True,ShowTimeROI=True)
ax2.set_title('Absolute time')
fig.tight_layout()
fig.show()

Running this script will display a plot with shaded regions where TimeROI is excluding values.
image
Viewing the logs before filtering will have the extra control disabled.

This PR is part of #34794.


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?
  • Are the release notes saved in a separate file, using Issue or PR number for file name and in the correct location?
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.

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.

Running (data is in the system tests area

Load(Filename="HYS_13656-13658", OutputWorkspace="sum")

then bringing up the log viewer does not disable the "Time ROI" button when sum.run().getTimeROI().useAll() is True

Running

Load(Filename="HYS_13656-13658", OutputWorkspace="sum")
FilterByLogValue(
    InputWorkspace="sum", OutputWorkspace="sum", LogName="s1", MinimumValue="0", MaximumValue="24.5", LogBoundary="Left"
)

works exactly as expected

Copy link
Member

@AndreiSavici AndreiSavici left a comment

Choose a reason for hiding this comment

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

Works as expected

@AndreiSavici AndreiSavici dismissed peterfpeterson’s stale review May 2, 2023 21:41

Pete solved the issues

@jmborr jmborr merged commit c5a6cb0 into main May 3, 2023
@jmborr jmborr deleted the ewm1021_updateplot branch May 3, 2023 13:36
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants