usnistgov / mass

Microcalorimeter pulse-analysis software
MIT License
6 stars 0 forks source link

Crashes after computing average pulses #233

Open joefowler opened 1 year ago

joefowler commented 1 year ago

Original report by LTD-ops (Bitbucket: LTD-ops, GitHub: LTD-ops).


Error with mass 0.7.10 and Python 3.10. SOFIA gamma data set 211109.

Crashes after computing the average pulses. If the last channels are removed, the error still occurs on whatever is the last remaining one.

Fixed by downgrading to mass=0.7.5 and by association numpy=1.22.3, matplotlib=3.5.1

compute_average_pulse chan 251 100.0% done, estimated ? left
compute_average_pulse chan 251 finished in 0.0 min
mask 875281 469947
compute_average_pulse chan 253 100.0% done, estimated ? left
compute_average_pulse chan 253 finished in 0.0 min
mask 1058992 0
WARNING: Mask for average pulse has fewer than 200 pulses: 0
WARNING: Mask for average pulse has fewer than 10 pulses: 0
/Users/mpcroce/Repositories/mass/mass/mathstat/power_spectrum.py:136: RuntimeWarning: invalid value encountered in divide
return self.specsum / self.nsegments
Traceback (most recent call last):
File "/Users/mpcroce/Repositories/sofia_repositories/microanalyzer/MicroAnalyzer.py", line 1168, in run
self.analysisChain()
File "/Users/mpcroce/Repositories/sofia_repositories/microanalyzer/MicroAnalyzer.py", line 1178, in analysisChain
mu.getListMode(cfgDict,directory,startTime,endTime,bDrift,bCoadd,bEcal,gui=True,cutsFile=self.cutsFile)
File "/Users/mpcroce/Repositories/sofia_repositories/microanalyzer/mass_util.py", line 2735, in getListMode
setup.data, setup.lims, setup.cal = analyze(setup,
File "/Users/mpcroce/Repositories/sofia_repositories/microanalyzer/mass_util.py", line 743, in analyze
data.compute_noise_spectra(max_excursion=maxExcursion, forceNew=forceNew)
File "/opt/anaconda3/envs/mass2/lib/python3.10/site-packages/wrapt-1.15.0-py3.10.egg/wrapt/wrappers.py", line 669, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
File "/opt/anaconda3/envs/mass2/lib/python3.10/site-packages/Deprecated-1.2.13-py3.10.egg/deprecated/classic.py", line 285, in wrapper_function
return wrapped_(*args_, **kwargs_)
File "/Users/mpcroce/Repositories/mass/mass/core/channel_group.py", line 513, in compute_noise_spectra
ds.compute_noise(max_excursion=max_excursion, n_lags=n_lags, forceNew=forceNew)
File "/Users/mpcroce/Repositories/mass/mass/core/channel.py", line 1687, in compute_noise
self.noise_records.compute_autocorrelation(
File "/Users/mpcroce/Repositories/mass/mass/core/channel.py", line 383, in compute_autocorrelation
self._compute_continuous_autocorrelation(n_lags=n_lags, data_samples=data_samples,
File "/Users/mpcroce/Repositories/mass/mass/core/channel.py", line 361, in _compute_continuous_autocorrelation
raise Exception(
Exception: Apparently all chunks had excusions, so no autocorrelation was computed
Abort trap: 6

joefowler commented 1 year ago

Original comment by Joseph Fowler (Bitbucket: joe_fowler, ).


Who is LTD-ops; who filed this issue? I’ll assume that /Users/mpcroce/ is the key to this riddle…

It looks to me like this error arises when you’re computing the noise autocorrelation, specifically because the analysis finds zero data “chunks” that are limited to values within ±max_excursion of the median value. Chunks exceeding that limit will be removed from noise analysis (on the assumption that they contain pulses). Can you run just the noise analysis part with a larger values for max_excursion ?

I don’t see why the Exception should lead to a hard crash of Python, however. That is unexpected, and not good.

joefowler commented 1 year ago

Original comment by Joseph Fowler (Bitbucket: joe_fowler, ).


Removing milestone: v0.7 (automated comment)