Replace deprecated `normed` with `density` in numpy.histogram()

The normed keyword argument has been removed from np.histogram, np.histogram2d, and np.histogramdd. Use density instead. If normed was passed by position, density is now used.

Here is the change log:
https://numpy.org/devdocs/release/2.24.1-notes.html#expired-deprecations
LT1AB
Yuankailiu 2023-02-22 23:07:22 -08:00
parent 735fba0bdb
commit 3322c29698
4 changed files with 23 additions and 23 deletions

View File

@ -120,7 +120,7 @@ def runESD(self, debugPlot=True):
meanval = np.mean(val) meanval = np.mean(val)
stdval = np.std(val) stdval = np.std(val)
hist, bins = np.histogram(val, 50, normed=1) hist, bins = np.histogram(val, 50, density=True)
center = 0.5*(bins[:-1] + bins[1:]) center = 0.5*(bins[:-1] + bins[1:])

View File

@ -152,7 +152,7 @@ def runRangeCoreg(self, debugPlot=True):
meanval = np.mean(val) meanval = np.mean(val)
stdval = np.std(val) stdval = np.std(val)
hist, bins = np.histogram(val, 50, normed=1) hist, bins = np.histogram(val, 50, density=True)
center = 0.5*(bins[:-1] + bins[1:]) center = 0.5*(bins[:-1] + bins[1:])

View File

@ -141,7 +141,7 @@ def main(iargs=None):
meanval = np.mean(val) meanval = np.mean(val)
stdval = np.std(val) stdval = np.std(val)
hist, bins = np.histogram(val, 50, normed=1) hist, bins = np.histogram(val, 50, density=True)
center = 0.5*(bins[:-1] + bins[1:]) center = 0.5*(bins[:-1] + bins[1:])

View File

@ -205,7 +205,7 @@ def main(iargs=None):
meanval = meanval * referenceTop.bursts[0].rangePixelSize meanval = meanval * referenceTop.bursts[0].rangePixelSize
stdval = stdval * referenceTop.bursts[0].rangePixelSize stdval = stdval * referenceTop.bursts[0].rangePixelSize
hist, bins = np.histogram(val, 50, normed=1) hist, bins = np.histogram(val, 50, density=True)
center = 0.5*(bins[:-1] + bins[1:]) center = 0.5*(bins[:-1] + bins[1:])
outputDir = os.path.dirname(inps.output) outputDir = os.path.dirname(inps.output)