oslocyclotronlab / ompy_Archive_Sept2019

Archived version om ompy as of 27. Sept 2019 -- Please use this instead:
https://github.com/oslocyclotronlab/ompy/
GNU General Public License v3.0
0 stars 1 forks source link

Quality of unfolding #39

Open fzeiser opened 5 years ago

fzeiser commented 5 years ago

Issue by fzeiser Thursday Sep 12, 2019 at 13:49 GMT Originally opened as https://github.com/oslocyclotronlab/ompy/issues/39


38 implemented the compton subtraction again and compared unfolding to mama.

Is this good/good enough/better/worse then the results obtained from mama?

My "issue" is at

Have a look at the pictures at the very last cell in https://github.com/oslocyclotronlab/ompy/blob/b15ecf11fd99742da499f2f9aa9bffbe330f40ce/notebooks/code_testing/Test%20compton%20subtraction%20method.ipynb

Originally posted by @fzeiser in https://github.com/oslocyclotronlab/ompy/pull/38#issuecomment-529402373 (updated link)

So how about this picture (from b15ecf1) mama_vs_ompy_ompyResp=ompy_matrix

Where the 1st spectrum and the last two seem *strange"

fzeiser commented 5 years ago

Comment by cecgresonant Thursday Sep 12, 2019 at 19:00 GMT


To me, most spectra seem strange (wrong), there are obvious differences (for example, in the lowest middle panel it seems like the high-energy centroids are wrong). If you do a diff between the mama and ompy unfolding, the deviations are probably easier to see for all spectra.

fzeiser commented 5 years ago

Comment by fzeiser Friday Sep 13, 2019 at 07:49 GMT


A good comment from Magne to work on below: Screenshot 2019-09-12 at 19 00 40

However, I'm not sure you I get your comments correctly. Note that the spectrum you (Mange) commented on is raw (blue) vs ompy (orange). If we were to assume that mama is correct, and the structure is mannel 3 and 9 are a "problem", then mama should not display these structures. However, have a look at the spectrum in the first comment of this issue. It Mama vs ompy. Mama shows basically the same big yellow structures. I'd even say that they might be a bit larger in mama.

fzeiser commented 5 years ago

Comment by fzeiser Friday Sep 13, 2019 at 07:53 GMT


To me, most spectra seem strange (wrong), [...] If you do a diff between the mama and ompy unfolding, the deviations are probably easier to see for all spectra. Originally posted by @cecgresonant in https://github.com/oslocyclotronlab/ompy/issues/39#issuecomment-530960891

i) What do you mean with most spectra seem strange/wrong. Do you mean ompy only, or also the spectra unfolded with mama? ii) I can produce a diff between mama and ompy, of course.

fzeiser commented 5 years ago

Comment by cecgresonant Friday Sep 13, 2019 at 07:56 GMT


I don't think I understand the labeling of the spectra, then. In the spectra you showed in the first comment, I understood the legend says that the blue spectrum is the Mama unfolded result, and the yellow is the OMpy unfolded result. Assuming that, it is clear that OMpy gives very different unfolding results than Mama. If this is not correct, please explain what the spectra are.

The spectra in the most recent post (with Magne's comments) are even more weird. If the blue spectrum really is the raw spectrum, how come you get huge peaks in the yellow unfolded spectrum for example in the last bottom panel?? This does not make any sense to me. It seems like the unfolding is creating peaks where there are no peaks in the raw spectrum.

fzeiser commented 5 years ago

Comment by fzeiser Friday Sep 13, 2019 at 08:04 GMT


For clearities sake I attach the log of how I unfold the data with mama: unfolding_si28_mama.log

And the raw spectrum in mama: mama_raw

and the unfolded spectrum in mama: mama_unfolded

Something Magne and I saw some days ago was that some of the spectra that do wrong, might be strange spectra to unfold. If you look at the highest and lowest areas of the raw spectrum, they basically have very few to no to negative counts. I guess then anything can happen really. More later ;P

fzeiser commented 5 years ago

Comment by cecgresonant Friday Sep 13, 2019 at 08:07 GMT


One thing is clear, one cannot unfold on negative counts!! :) So that might explain some of it. Still confused about the labeling (legends) though.

fzeiser commented 5 years ago

Comment by fzeiser Friday Sep 13, 2019 at 09:04 GMT


Hpow, obvious, but I think I spotted one "issue" in the comparison! Let's remove all negative counts before the unfolding and then compare again! In ompy we can also either set a warning, or raise an error if you try to unfold a spectrum with bins with negative counts. I vote for the second, because I don't see when you should legitimately unfold with negative counts.

fzeiser commented 5 years ago

Comment by cecgresonant Friday Sep 13, 2019 at 09:06 GMT


After a quick look at the log file, I see that you have not really put any diagonal cut in the unfolding either. That means the routine will try to unfold everything, even way outside the E_x = E_gamma diagonal. This is surely not recommended. What is the reason for this choice? Is there a lot of background? If so, probably one should go back and put more strict time gates in the sorting.

fzeiser commented 5 years ago

Comment by fzeiser Friday Sep 13, 2019 at 09:11 GMT


Also, currently, I see that that Eg spectra at with a 100 binning. I guess that's suboptimal for unfolding, right. What binning do you suggest? I think the finest we can do (with the given raw spectrum) is 25 kev -- however, we could of course just use a different spectrum...

fzeiser commented 5 years ago

Comment by fzeiser Friday Sep 13, 2019 at 09:14 GMT


How about we sit together and design (+ log) two cases ;P. One with discrete peaks, like here, and maybe another one, where any effect of the compton subtraction would also be better visible.

fzeiser commented 5 years ago

Comment by cecgresonant Friday Sep 13, 2019 at 09:14 GMT


You are right, 100-keV binning is not optimal. The optimal bin size depends on the Eg, roughly you would like at least three bins to describe a peak. So if you are trying to unfold a 200-keV peak with 100-keV bins this gets imprecise. Probably a 10-keV binning should be okay. Ideally one should have variable bins size as a function of the Eg-FWHM, but that gets very complicated, I guess :)

fzeiser commented 5 years ago

Comment by fzeiser Friday Sep 13, 2019 at 09:15 GMT


It's not so easy to design test cases I recon. But at least for me a good probe on what can go wrong.

fzeiser commented 5 years ago

Comment by cecgresonant Friday Sep 13, 2019 at 09:16 GMT


Yes, probably easier if we sit together at some point :) Unfortunately today my schedule is full, and I am heading to the Nuclear Physics in Astrophysics conference on Sunday. Let's aim for some time during the week 23.-27. September.