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

Inconsistency with Run.getProtonCharge() function in period datasets #39020

Open
MialLewis opened this issue Mar 6, 2025 · 0 comments · May be fixed by #39029
Open

Inconsistency with Run.getProtonCharge() function in period datasets #39020

MialLewis opened this issue Mar 6, 2025 · 0 comments · May be fixed by #39029
Assignees
Labels
Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) ISIS Team: LSS Issue and pull requests managed by the LSS subteam at ISIS Reflectometry Issues and pull requests related to reflectometry
Milestone

Comments

@MialLewis
Copy link
Contributor

MialLewis commented Mar 6, 2025

Describe the bug

The getProtonCharge() function returns a property that does not take period filtering into account on initial load.
When filtering is applied this property is updated, accounting for period filtering AND the new filtering applied.
The proton_charge_by_period property only accounts for period filtering, not any subsequent filtering applied.

We want getProtonCharge() to be consistent in how it treats period filtering.

To Reproduce

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

# POLREF data - so may need to call via "POLREF00043577"

test_run, test_run_monitors = Load("43577", LoadMonitors=True)



test_run_filtered = FilterByLogValue(InputWorkspace='test_run', LogName='HTS_I', MinimumValue=57.76, MaximumValue=57.79)



period_i = 0
print(test_run[period_i].getRun().getProtonCharge())
print(test_run[period_i].getRun().getProperty("proton_charge_by_period").value[period_i])
print(test_run_filtered[period_i].getRun().getProperty("proton_charge_by_period").value[period_i])
print(test_run_filtered[period_i].getRun().getProtonCharge())

Output:

40.272796630859375
20.135597229003906
20.135597229003906
18.184533727238886

Expected Output:

20.135597229003906
20.135597229003906
20.135597229003906
18.184533727238886
@MialLewis MialLewis added Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) ISIS Team: LSS Issue and pull requests managed by the LSS subteam at ISIS Reflectometry Issues and pull requests related to reflectometry labels Mar 6, 2025
@MialLewis MialLewis added this to the Release 6.13 milestone Mar 7, 2025
@MialLewis MialLewis moved this from New to In Progress in ISIS LSS Sprint Planning Mar 11, 2025
@MialLewis MialLewis self-assigned this Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) ISIS Team: LSS Issue and pull requests managed by the LSS subteam at ISIS Reflectometry Issues and pull requests related to reflectometry
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

1 participant