Skip to content

Update q resolution calculation#112

Draft
welbournR wants to merge 16 commits intonextfrom
resolution_fix
Draft

Update q resolution calculation#112
welbournR wants to merge 16 commits intonextfrom
resolution_fix

Conversation

@welbournR
Copy link
Collaborator

Description of work:

Q-resolution calculation updated to include both lambda and theta components. Includes prior functions that weren't integrated into the workflow.

DRAFT - this needs tests to be updated. Request other eyes on the code to check the changes.

Check all that apply:

  • updated documentation
  • Source added/refactored
  • Added unit tests
  • Added integration tests
  • Verified that tests requiring the /SNS and /HFIR filesystems pass without fail

References:

  • Links to IBM EWM items:
  • Links to related issues or pull requests:

⚠️ Manual test for the reviewer

(Instructions for testing here)

Check list for the reviewer

  • best software practices
    • clearly named variables (better to be verbose in variable names)
    • code comments explaining the intent of code blocks
  • All the tests are passing
  • The documentation is up to date
  • code comments added when explaining intent

print("Q summing: %g" % dq_over_q)
return dq_over_q
det_res = 1.0 # mm, approximate value for detector resolution contribution
sigma_pix = pixel_size / np.sqrt(12)
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you please add a comment about where factor np.sqrt(12) is coming from?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if we assume that the pixel can be described by a top-hat function (uniform distribution) then this is the standard deviation. It is an approximation for the real pixel resolution but a reasonable one for now. As we learn and understand more this may evolve!

slit_distance = s1_sample_distance - sample_si_distance
dq_over_q = (s1h + sih) * 0.5 / slit_distance / theta
return dq_over_q
return dtheta_deg, theta_deg
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpicking here, but could we swap the order to return theta_deg, dtheta_deg throughout this function?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants