Introduction of matplotlib-independent simulating, peak-wise width values and optional region of interest (ROI) based line calculation for significant speed increase.#29
Open
mwhayward wants to merge 1 commit intosametz:masterfrom
Conversation
Moved peak width at half height values into the peaklist variables to allow for peak-wise (and therein multiplet-wise) width control. Peaklist handling methods and functions have been adapted to handle the new values. Width default values have been consistently set to 0.5Hz throughout the package. plt.py: Divided mplplot into two functions (mplplot in plt.py and create_lineshape in math.py) to separate the matplotlib object creation from the NMR line. This allows users to skip matplotlib if they want to use the line for other uses. Fixed a bug in mplplot_stick which uses the outdated use_line_collection argument in ax.stem. qm.py: Removed the print lines in qm.hamiltonian_sparse. Added width arguments to _compile_peaklist permit the new peaklist structure. math.py: Added the new create_lineshape function that is taken from plt.mplplot so it can be called independently. Added width arguments to many of the functions. Added gaussian functions to complement lorentz functions. Converted add_lorentzians to add_lorentzians_limitable which includes a new and optional parameter: cutoff. This argument allows the restriction of lorentzian curve calculation to only above the given intensity cutoff. Uses the (also new) inverse_lorentz and get_index_of_nearest functions to quickly calculate the restriction zones without any element-wise calculation by numpy. This permits much faster simulation speeds if speed is more valuable than 100% accuracy. Default is None so tutorial/older examples behave the same. Other files: Added support for the new width parameter. Refactoring for add_lorentzians_limitable function. Tests: All executed successfully after modifying expected values to accommodate the above changes.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
General:
Moved peak width at half height values into the peaklist variables to allow for peak-wise (and therein multiplet-wise) width control. Peaklist handling methods and functions have been adapted to handle the new values. Width default values have been consistently set to 0.5Hz throughout the package.
plt.py:
Divided mplplot into two functions (mplplot in plt.py and create_lineshape in math.py) to separate the matplotlib object creation from the NMR line. This allows users to skip matplotlib if they want to use the line for other uses. Fixed a bug in mplplot_stick which uses the outdated use_line_collection argument in ax.stem.
qm.py:
Removed the print lines in qm.hamiltonian_sparse.
Added width arguments to _compile_peaklist permit the new peaklist structure.
math.py:
Added the new create_lineshape function that is taken from plt.mplplot so it can be called independently. Added width arguments to many of the functions.
Added gaussian functions to complement lorentz functions. Converted add_lorentzians to add_lorentzians_limitable which includes a new and optional parameter: cutoff. This argument allows the restriction of lorentzian curve calculation to only above the given intensity cutoff. Uses the (also new) inverse_lorentz and get_index_of_nearest functions to quickly calculate the restriction zones without any element-wise calculation by numpy. This permits much faster simulation speeds if speed is more valuable than 100% accuracy. Default is None so tutorial/older examples behave the same.
Other files:
Added support for the new width parameter.
Refactoring for add_lorentzians_limitable function.
Tests:
All executed successfully after modifying expected values to accommodate the above changes.