Skip to content

Commit

Permalink
cast to float32 for c codes (needs a better fix)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonwright committed May 10, 2024
1 parent e6b26c3 commit 38bc4c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ImageD11/sparseframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ def __init__( self, hname, scan, start = 0, n=None,
for name in self.names:
if name in grp:
setattr( self, name, grp[name][s:e] )
if 'intensity' in self.names:
self.intensity = self.intensity.astype(np.float32)
# pointers into this scan
self.nnz = nnz[start:end]
self.ipt = nnz_to_pointer( self.nnz )
Expand Down Expand Up @@ -327,7 +329,7 @@ def lmlabel(self, threshold = 0, countall=True, smooth=True ):
if smooth:
self.signal = np.empty( self.intensity.shape, np.float32 )
else:
self.signal = self.intensity
self.signal = self.intensity.astype(np.float32)
# temporary workspaces
npxmax = self.nnz.max()
vmx = np.zeros( npxmax, np.float32 )
Expand Down

0 comments on commit 38bc4c8

Please sign in to comment.