Don't need that flatten
Add boilerplate for array version of gvecToDetectorXY

and split out the single transformation into a separate function