NSLS-II / pyCHX

chx_analysis_codes
BSD 3-Clause "New" or "Revised" License
5 stars 6 forks source link

resolve poisson and gamma distributions between _commonspeckle and skbeam #54

Open ambarb opened 3 years ago

ambarb commented 3 years ago

Neet to address differences in two distribution functions.

Gamma Distribution

_commonspeckle

(lines 472-474 are completely different) https://github.com/NSLS-II/pyCHX/blob/2ecdacf0dd8496dd8e90bb4975273b59e1d08e26/pyCHX/v2/_commonspeckle/chx_speckle.py#L471-L475

skbeam

https://github.com/scikit-beam/scikit-beam/blob/655d55f6396524f012bd5d1e2dc3b3fa9d6d6512/skbeam/core/fitting/lineshapes.py#L414-L415

Poisson Distribution

_commonspeckle

(make sure K is a float) https://github.com/NSLS-II/pyCHX/blob/2ecdacf0dd8496dd8e90bb4975273b59e1d08e26/pyCHX/v2/_commonspeckle/chx_speckle.py#L545-L550

skbeam

https://github.com/scikit-beam/scikit-beam/blob/655d55f6396524f012bd5d1e2dc3b3fa9d6d6512/skbeam/core/fitting/lineshapes.py#L489-L493

ambarb commented 3 years ago

@danielballan @afluerasu would the ultimate plan be to import these distributions INTO skbeam or to import FROM skbeam?

ambarb commented 3 years ago

For gamma distribution @yugangzhang told us that the original scipy function is wrong and he had to correct it manually. @xmchenGH checked that the latest scipy function performs as expected. It sounds like we can convert back to the original skbeam code for the gamma distribution. For this we will simply import.

Thanks @xmchenGH for your help on this one.