fix NameError in process.py - #119
Open
rfwebster wants to merge 1 commit into
Open
Conversation
When trying to run the example notebooks I ran into this error, with the source_size function seems the kernel_sigma should just be sigma:
NameError Traceback (most recent call last)
../postprocess_final.ipynb Cell 4 line 4
2 kernel_sigma = 0.8/2.355 #80pm FWHM
3 haadf_img = np.sum(vd.data[:,:,40:],axis=2)
----> 4 ss = source_size(haadf_img, rx, ry, sigma=kernel_sigma)
5 shot = apply_poisson_noise_STEM(ss, dose=dose)
File ../site-packages/pyprismatic/process.py:236, in source_size(data, rx, ry, sigma)
234 ryy = ryy-ry[len(ry)//2-1]
235 rr = np.sqrt(rxx**2.0 + ryy**2.0)
--> 236 source_size_kernel = rad_gaussian(rr, kernel_sigma)
238 return signal.convolve2d(data, source_size_kernel, 'same')/signal.convolve2d(np.ones(np.shape(data)), source_size_kernel, 'same')
NameError: name 'kernel_sigma' is not defined
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.
When trying to run the example notebooks I ran into this error, with the source_size function seems the kernel_sigma should just be sigma:
NameError Traceback (most recent call last)
../postprocess_final.ipynb Cell 4 line 4
2 kernel_sigma = 0.8/2.355 #80pm FWHM
3 haadf_img = np.sum(vd.data[:,:,40:],axis=2)
----> 4 ss = source_size(haadf_img, rx, ry, sigma=kernel_sigma)
5 shot = apply_poisson_noise_STEM(ss, dose=dose)
File ../site-packages/pyprismatic/process.py:236, in source_size(data, rx, ry, sigma)
234 ryy = ryy-ry[len(ry)//2-1]
235 rr = np.sqrt(rxx2.0 + ryy2.0)
--> 236 source_size_kernel = rad_gaussian(rr, kernel_sigma)
238 return signal.convolve2d(data, source_size_kernel, 'same')/signal.convolve2d(np.ones(np.shape(data)), source_size_kernel, 'same')
NameError: name 'kernel_sigma' is not defined