calcam icon indicating copy to clipboard operation
calcam copied to clipboard

RayData.get_ray_start, direction, ray_length, etc performance

Open ssilburn opened this issue 6 months ago • 1 comments

An observation when quickly putting together a code which called get_ray_start(), get_ray_direction() and get_ray_length() individually for every pixel in a detector: this is mind-blowingly slow (estimated 24hr on Heimdall for 880k pixels). It would be good to at least document that this is not a good way to use / call these functions.

ssilburn avatar Jul 04 '25 15:07 ssilburn

The fundamental problem here is the design of these functions to allow use with a raycast with arbitrary x and y pixel coordinate arrays.

I tried some things and could only get a ~6% speed-up which is not enough for me to bother re-validating the code, so for now I'll leave these functions alone. Maybe with some cleverer numpy indexing stuff it could be dramatically improved, but for now I can't figure out a way to do it.

ssilburn avatar Oct 27 '25 22:10 ssilburn