SiLab-Bonn / pylandau

Simple Landau distribution definitions to be used in Python.
GNU Lesser General Public License v2.1
20 stars 5 forks source link

enable eta<1 (scale parameter)? #20

Closed liuxiaoyuyuyu closed 2 years ago

liuxiaoyuyuyu commented 2 years ago

Is it possible to enable eta<1 for the Landau distribution? It will be useful for fitting the signal of a scintillator detector. When a particle goes through the detector, the deposited energy follows a Landau distribution and the width(scale) of the Landau distribution depends on the material and thickness of the detector and it can be less than one.

cbespin commented 2 years ago

Have you tried using eta < 1 already? I do not see any limitations in the code and it is working for me with eta of at least 0.01. There is a limitation of 1e-9 for stability reasons, but I doubt you are hitting that with a scintillator signal.

liuxiaoyuyuyu commented 2 years ago

Hi, when I set eta<1, I got the warning:WARNING: eta < 1 not supported and set to 1! Scale x to fix. And eta was indeed set to 1.

cbespin commented 2 years ago

I see, this was still the case in version 2.1.0 which is the latest one on pip. The current master (and 2.1.2rc) branch of the repo has a lot of stability fixes including allowing eta < 1. If you do not want to clone the code and install manually, there will be a new release very soon (hopefully this week) that will also be released to pip (see #19).

liuxiaoyuyuyu commented 2 years ago

Great! Thanks!

jasqs commented 2 years ago

Hi,

when could we expect the new 2.1.2 version on pip?

cbespin commented 2 years ago

when could we expect the new 2.1.2 version on pip?

Thanks for the reminder @jasqs. I had some trouble building the package for a pip release and then had no time to check again. I will put it on top of my list and let you know when it's done

cbespin commented 2 years ago

@jasqs @liuxiaoyuyuyu The new release is now live, version 2.2.0. Please note, I had to drop support for python 3.7

I will close this issue now. If there is another problem, also related to the new release, please open another issue.