Skip to content

Commit

Permalink
Remove deprecated scipy call
Browse files Browse the repository at this point in the history
  • Loading branch information
mhardcastle committed Feb 28, 2017
1 parent a791a92 commit 629bcc9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions radioflux/radioflux.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,10 @@ def __init__(self,rm,region,background=None,offsource=None):
self.pixels=np.sum(mask)
data=np.extract(mask,d)
data-=bgval
self.rms.append(scipy.stats.nanstd(data))
self.flux.append(data[np.logical_not(np.isnan(data))].sum()/rm.area)
self.mean.append(scipy.stats.nanmean(data))
nndata=data[~np.isnan(data)]
self.rms.append(np.std(nndata))
self.flux.append(np.sum(nndata)/rm.area)
self.mean.append(np.mean(nndata))
if offsource is not None:
self.error.append(offsource[i]*np.sqrt(self.pixels/rm.area))

Expand Down

1 comment on commit 629bcc9

@henrysting
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np.nanstd and np.nanmean also work

Please sign in to comment.