astronomy-commons / axs

Astronomy eXtensions for Spark: Fast, Scalable, Analytics of Billion+ row catalogs
https://axs.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
23 stars 12 forks source link

distance calculation in AXS #22

Open AltieriBruno opened 4 years ago

AltieriBruno commented 4 years ago

We have found an issue with the distance computed by calcGnom for catalogue cross-correlation in AXS :

https://github.com/astronomy-commons/axs/blob/fa3c8746201768a7cd96690a77e945faf1e1dafc/AxsUtilities/src/main/scala/org/dirac/axs/FrameFunctions.scala#L14

Which for very small angles is ~ SQRT( delta(ra)^2 + delta(dec)^2 ) while in the equirectangular approximation it is ~ SQRT( (delta(ra) * cos(dec1+dec2)/2 )^2 + delta(dec)^2 )

The missing factor of the cosine of the declination yields to an overestimated distance away from the equator.

My impression is that the Gnomonic projection is not suitable in astronomy and is more related to geophysics.

This leads to an actual loss of cross-correlated sources at high latitudes.

NigelHambly commented 3 years ago

Hi Folks: we're extremely interested in using AXS on a code-to-data platform for Gaia science, but see that some issues have been identified with the spherical trig for computing correctly the matches as one moves away from the equator, or across the RA 0h boundary etc. Are there any plans for pulling in the fixes being worked on by @stargaser and making a new release? Let us know if we can help with testing/validating any branches/forks.

ctslater commented 3 years ago

Hi, yes I'm working on the distance computation issue now. I've also brought the code up to spark 3.0, so we will make a new release based on that once the distances are sorted out. Thanks for the offer to help with testing; I'll post back here once we have a release candidate.