mapped photon to grid cell index, see mapPhotonToGrid function. Took gridattributes structure from lucy's code in the other branch