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

[defect] Wrong work flow in transmission calculation when the useTimeSlice flag is off on BioSANS #788

Closed
glass-ships opened this issue Dec 18, 2024 · 1 comment

Comments

@glass-ships
Copy link
Member

Problem Description:

There is a useTimeSlice flag designed for BioSANS, when it is turned on the results will be sliced based on the number specified by the timeSliceInterval keyword. But when the useTimeSlice flag is off, and both scattering and empty transmission samples are specified independently, the transmission calculation is way off.
This useTimeSlice feature are only available in QA branch.

Steps to Reproduce:

In BioSANS data reduction scripts, when the scattering and transmission are collected separately, the final results are way off in QA compared to production. As can be seen in this picture

Screen_Shot_2021-03-15_at_12.51.48_AM

This result can be reproduced in Jupyter notebook. The differences with QA kernel can be viewed by comparing QA and production runs
RC490_IPTS24666_15m

  • Transmission and Scattering are measured as separate exposures.
  • Scattering (called samples) list and transmission (called samples_trans) list are different.
  • Reduced data from Production and QA (and Dev) are very different.
  • Transmission co-efficients for 18Å neutrons calculated in Production and QA environments are very different. It seems scattering data is also used to calculate transmission.
  • Transmission Co-efficients are ~0.000122% for sample (AgBeh 2mm) and ~97% for empty cell (background).
  • Four scripts on Jupyter examples [pre-commit.ci] pre-commit autoupdate #1Save 1D/2D file to CANSAS format #4.
  • Data obtained from SANS environment is correct and expected result including the transmission value (RC490_IPTS24666_15m18A_Prod.ipynb) – (red curve in figure).
  • Data from QA environment has the issue- Transmission values are off! (RC490_IPTS24666_15m18A_QA.ipynb) – (blue curve in figure).
  • Data from switched lists between scattering and transmission because it seemed like transmission was being calculated using scattering data gave correct transmission values but the curve did not sit correctly on absolute scale with data from SANS environment (RC490_IPTS24666_15m18A_QA_ScatTransSwitched.ipynb) – (green curve in figure).
  • Data by making scattering and transmission to be identical lists gave the same result as if we have two different lists but the scattering list is used to calculate transmission and scattering!

(RC490_IPTS24666_15m18A_QA_ScatTransMadeSame.ipynb)

Investigation/Analysis Results:

The code that caused this error is in sans-backend/drtsans/mono/biosans/api.py from line 947 to 974

drtsans.mono.biosans.api

It can be seen from the code that when scattering and empty transmission are measured independently and the userTimeSlice option is off, the function _prepare_sample_transmission_ws will be executed twice.

@glass-ships
Copy link
Member Author

This issue was migrated from code.ornl.gov.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant