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

Investigate/fix noisy low-r region of PDF in POLARIS reduction #38961

Open
RichardWaiteSTFC opened this issue Feb 24, 2025 · 0 comments
Open
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

Describe the bug

Comparison of PDF produced by Mantid (LEFT) and Gudrun (RIGHT)

Image

This could be due to the implementation of the fourier filter here

def fast_fourier_filter(ws, rho0, freq_params=None):

  • The output from this filter has regular bin-width (the input doesn’t) taken from smallest bin-width in data
  • If no rmax is supplied in the freq_params then it uses hard-coded rmax=200 – I’m not sure how reasonable this is?

It also affects PDF with merge_banks=False

Image

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", # "98531"
              mode="PDF", do_absorb_corrections=True, do_van_normalisation=True,
              van_normalisation_method="Absolute",
              empty_can_subtraction_method= "PaalmanPings",
              sample_empty_scale=1.0)

# produce PDF
polaris.create_total_scattering_pdf(run_number="98533", 
                                    q_lims=[[-1, 0.5, 0.5, 0.5, 0.5],[-1, 30, 30, 30, 30]],
                                    delta_q=0.02,
                                    delta_r=0.02,
                                    pdf_type="g(r)",
                                    freq_params=[0.91],
                                    lorch_filter=True,
                                    placzek_order=2,
                                    sample_temp=300,
                                    pdf_output_name="pdf",
                                    merge_banks=True)

Expected behavior
Would produce result similar to gudrun

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

1 participant