Project: datamanagement
Issue DM-4933: Create a utility function do do spherical geometry averaging
I would like to calculate a correct average and RMS for a set of RA, Dec positions. Neither [~jbosch] nor [~price] knew of an easy, simple function to do that that existed in the stack. [~price] suggested: {code} mean = sum(afwGeom.Extent3D(coord.toVector()) for coord in coordList, afwGeom.Point3D(0, 0, 0)) mean /= len(coordList) mean = afwCoord.IcrsCoord(mean) {code} That makes sense, but it's a bit unobvious (it's obvious how it works, but would likely never occur to someone that they should do it that way in the stack). Pedantically it's also not the best way to do a mean while preserving precision, but I don't anticipate that to be an issue in practice. Creating a function that did this would provide clarity. I don't know where that function should live. Note: I know how to do this in Astropy. I'm intentionally not using astropy here. But part of the astropy dependency discussion is likely "how much are we otherwise rewriting in the LSST stack".
Story points: 1