-
Notifications
You must be signed in to change notification settings - Fork 21
q_to_tth & tth_to_q #178
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
Merged
Merged
q_to_tth & tth_to_q #178
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7841ff2
fix docstring and add error messages
yucongalicechen 1b0fa19
add tests
yucongalicechen 4e85b0a
edit error message
yucongalicechen a33482b
add more tests
yucongalicechen 3efde28
add warning msg for wavelength, edit error msg
yucongalicechen a53461f
edit warning msg for wavelength, change index error to runtime error
yucongalicechen 2a5a819
add functionality for handling error messages
yucongalicechen 64d8693
remove docstring from private test functions
yucongalicechen 728ff36
add news
yucongalicechen 490486c
add example and utility
yucongalicechen d481253
edits on docs
yucongalicechen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is confusing. Doesn't this function do it in place and just set the tth array? In this respect, shouldn't this just be a private function and not used by the user at all? In other words, I would load my diffraction data into the object and the object automatically populates all the different arrays. So to get my data on q if I loaded it on tth I would just do
my_diffraction_data.on_qThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a private function for now (I didn't see the "_" in the function name)? We need to call
insert_scattering_quantityin order for it to populate on all arrays automatically. If they just domy_diffraction_pattern = DiffractionObjects()andmy_diffraction_pattern.on_q = ...it is not automatically populated to tth.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but if they do that they are just instantiating an empty DO so there is nothing to populate anywhere..... So that is desired behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question is what behavior do we want? I want to be able to get my intensity data on all the different x-grids, but I can do that by typing
my_pattern.on_qorwhatever. What is the UC where I would want to run that function?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Does this sound better?
Assuming we have created a
DiffractionObjectcalled my_diffraction_pattern from a measured diffraction pattern, and we have specified the wavelength (see Section ??, to be added), we can use theq_to_tthandtth_to_qfunctions to convert between q and two-theta. For example,my_diffraction_pattern.q_to_tth()converts q to two-theta, whilemy_diffraction_pattern.tth_to_q()converts two-theta to q. The converted array can be accessed using by callingmy_diffraction_pattern.on_q[0]for q, ormy_diffraction_pattern.on_tth[0]for two-theta.