Skip to content

binningMode = 'SUM' does not work as it's supposed to #95

@ronichester

Description

@ronichester

in spikeFileIO.py, the following lines have the same effect as binningMode = 'OR' :

elif binningMode.upper() == 'SUM':
				emptyTensor[pEvent[validInd], 
							yEvent[validInd],
							xEvent[validInd],
							tEvent[validInd]] += 1/samplingTime

That is because += 1 in this case does not work, I believe it's a bug in your code.
The idea is to sum the number of spikes on the same pixel in the same time window, but the way it's written it does not sum; i did many tests myself.
In order to work as expected, the code should be something like this:

elif binningMode.upper() == 'SUM':
    for p,y,x,t in zip(pEvent[validInd], yEvent[validInd], xEvent[validInd], tEvent[validInd]):
                    emptyTensor[p,y,x,t] += 1/samplingTime

This implementation is terribly NOT efficient (up to the point it is unfeasible) but it works as expected.
I can't think of a clever way to use the np.array characteristics to make it work efficiently; any ideas?

The point is, in my opinion, the way the code is written now, binning mode OR = binning mode SUM, and I am sure it was not supposed to be this way.

Cheers,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions