Skip to content
Snippets Groups Projects
Commit b8a02232 authored by Egor Sobolev's avatar Egor Sobolev
Browse files

Fix minimum lenght in fast azimuthal integration (numpy.bincount)

parent 55b4a347
No related branches found
No related tags found
1 merge request!3Center refinement using powder diffraction data
......@@ -2,13 +2,14 @@ import numpy as np
def azint_fast(ri, img, mask=None, nan=np.nan):
max_ri = np.max(ri)
if mask is None:
r, v = ri, img
else:
r = ri[~mask]
v = img[~mask]
n = np.bincount(r)
rdf = np.bincount(r, weights=v)
n = np.bincount(r, minlength=max_ri + 1)
rdf = np.bincount(r, weights=v, minlength=max_ri + 1)
np.divide(rdf, n, where=n > 0, out=rdf)
rdf[n == 0] = nan
return rdf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment