Summarizing the questions I have:
-
|
result[vv, i] = lifetime if lifetime < 1000 else 1000 # normalize long lifetimes to 1000 |
How could you reach a lifetime of 1000? A value larger than 70 (in bins) is irrelevant and should be made an NA. Also, use np.min() instead of a ternary. Also also, I'm not sure how you're accessing result as a 2D array (i.e. with only 2 indices). Isn't result 3D? Not sure what is going on, I might need a debugger here.
-
NA, not 0.0.
|
lowest_bin_idx = hist[:bins_lowest_idx_upper_bound].argmin() |
Why can't the smallest bin be after slot 65?
|
with objmode(tau='float32'): |
😱
|
popt, _ = curve_fit(_exp_decay, x, sg_hist, p0=[max(sg_hist), 1/np.average(sg_hist), min(sg_hist)], |
You're using many Python built-in functions here. It will be better if you use their numpy equivalents.
|
np.zeros([Vdim, nbin.prod()], dtype=np.float32), values) |
Start with a numpy array full of nans instead of zeros.
|
def _bin_edges(sample, bins=None, range=None): |
Was this copied from scipy?
Summarizing the questions I have:
python-pysight/src/pysight/nd_hist_generator/binned_lifetime.py
Line 111 in f033a74
How could you reach a lifetime of 1000? A value larger than 70 (in bins) is irrelevant and should be made an NA. Also, use np.min() instead of a ternary. Also also, I'm not sure how you're accessing result as a 2D array (i.e. with only 2 indices). Isn't result 3D? Not sure what is going on, I might need a debugger here.
python-pysight/src/pysight/nd_hist_generator/binned_lifetime.py
Line 123 in f033a74
NA, not 0.0.
python-pysight/src/pysight/nd_hist_generator/binned_lifetime.py
Line 129 in f033a74
Why can't the smallest bin be after slot 65?
python-pysight/src/pysight/nd_hist_generator/binned_lifetime.py
Line 134 in f033a74
😱
python-pysight/src/pysight/nd_hist_generator/binned_lifetime.py
Line 137 in f033a74
You're using many Python built-in functions here. It will be better if you use their numpy equivalents.
python-pysight/src/pysight/nd_hist_generator/binned_lifetime.py
Line 202 in f033a74
Start with a numpy array full of nans instead of zeros.
python-pysight/src/pysight/nd_hist_generator/binned_lifetime.py
Line 223 in f033a74
Was this copied from scipy?