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

Focus not respecting sample_empty if a reduction has already been run in POLARIS script #38959

Open
RichardWaiteSTFC opened this issue Feb 24, 2025 · 0 comments
Assignees
Labels
Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) Diffraction Issues and pull requests related to diffraction ISIS Team: Diffraction Issue and pull requests managed by the Diffraction subteam at ISIS Powder Issues and pull requests related to powder diffraction
Milestone

Comments

@RichardWaiteSTFC
Copy link
Contributor

RichardWaiteSTFC commented Feb 24, 2025

Describe the bug
If you have already run focus then subsequent calls to focus will use the last empty run specified (or if not specified previously then the default in the mapping file), regardless of sample_empty user supplies.

This is despite polaris._inst_settings.sample_empty looking like it is set correctly - perhaps it is just retrieving a cached/saved version?

To Reproduce
(1) Ask me for files
(2) Update paths in .yaml files
(3) Run this script

from mantid.simpleapi import *
import numpy as np
from isis_powder import polaris, SampleDetails

config_file_path = r"C:\Users\xhg73778\Documents\POLARIS\PR34144Files\polaris_config_example.yaml"
polaris = polaris.Polaris(config_file=config_file_path, user_name="test")


sample_details = SampleDetails(height=4.0, radius=0.2985, center=[0, 0, 0], shape='cylinder')
sample_details.set_material(chemical_formula='Si', packing_fraction=0.6)
sample_details.set_container(radius=0.3175, chemical_formula='V')
polaris.set_sample_details(sample=sample_details)

# focus
polaris.create_vanadium(first_cycle_run_no="98532", multiple_scattering=True, mayers_mult_scat_events=1)
polaris.focus(run_number="98533", input_mode='Summed', sample_empty="98532",
              mode="PDF", do_absorb_corrections=True, do_van_normalisation=True,
              van_normalisation_method="Absolute",
              empty_can_subtraction_method= "PaalmanPings",
              sample_empty_scale=1.0)

(4) Check the workspace history, the last call to the Minus algorithm should use a workspace derived from run 98532
(5) Call focus again without specifying sample_empty

polaris.focus(run_number="98533", input_mode='Summed', 
              mode="PDF", do_absorb_corrections=True, do_van_normalisation=True,
              van_normalisation_method="Absolute",
              empty_can_subtraction_method= "PaalmanPings",
              sample_empty_scale=1.0)

(6) Check the workspace history, the last call to the Minus algorithm will use the same workspace derived from run 98532

Expected behavior
It should use the default empty run specified in the cycle map .yaml file, this will appear in the history like summed_emtpy or similar.

Screenshots

Platform/Version (please complete the following information):

  • OS: [e.g. Windows, RHEL 7, Ubuntu, macOS]
  • OS Version:
  • Mantid Version [e.g. 6.0.0]

Additional context

@RichardWaiteSTFC RichardWaiteSTFC added Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) Diffraction Issues and pull requests related to diffraction ISIS Team: Diffraction Issue and pull requests managed by the Diffraction subteam at ISIS Powder Issues and pull requests related to powder diffraction labels Feb 24, 2025
@RichardWaiteSTFC RichardWaiteSTFC added this to the Release 6.13 milestone Feb 24, 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) Diffraction Issues and pull requests related to diffraction ISIS Team: Diffraction Issue and pull requests managed by the Diffraction subteam at ISIS Powder Issues and pull requests related to powder diffraction
Projects
Status: Todo
Development

No branches or pull requests

2 participants