NSLS-II / pyCHX

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

can we generalize speckle` _process` so that bincount can be used on floats? #65

Open ambarb opened 3 years ago

ambarb commented 3 years ago

See the issue below, as they are related, but this is to address a specific question of np.histogram versus np.bincount raised in https://github.com/NSLS-II/pyCHX/issues/52

np.histogram is used for image based data because image normalization process creates floats (this is the case for csxtools get_fccd_images()). Some discussion of the various options would be good. Please add other options if I have missed one. We can consider multiple approaches too, but probably need to prioritize

  1. have 2 _process subfunctions: one for integer data (like Eiger detector) and one for float data
  2. convert floats to integers in a way that we agree.
  3. require input (whether images (aka full np.array) or compressed data) must be integers

@danielballan and others?

ambarb commented 3 years ago

we discussed in meeting.

Best coarse of action is to use only np.bincount so we will strive to merge code for image and compressed data. if pixel number type is float; raise exception and report reason (float not int) and thee recommend conversion method.

OPTION 3

ambarb commented 3 years ago

but leave in the option to run on floats anyway after furhter discussion of complications iwth converting to ccd imaged data to integers if you are in an intermediate regime (like 4 photon events in a single pixel)