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

axsdist units are unclear #17

Open ctslater opened 4 years ago

ctslater commented 4 years ago

Ernesto Castillo asks a very good question: what are the units on axsdist? This seems to be computed by calcGnom in FrameFunctions.scala, but I can't follow what the final formula is producing.

Dav-v commented 4 years ago

Hi, are there any updates on this? Looking at the functions calcGnom() and degToGnom() and the conversion gnom_dist = degToGnom(r) ( gnom_dist = tan(rad(r)) ), could this be a gnomonic projection? Is there something in the documentation or in other external sources that explains the method and the formulas used to determine the distance?

zecevicp commented 4 years ago

If we take the Gnomonic projection equations and set phi_1 and lambda_0 both to zero, (and also substitute lambda for abs(ra_2-ra_1) and phi for abs(dec_2-dec_1)), that would be as though the projection is centered on ra_1 and dec_1. That's what was implemented. I hope that makes sense for you?

Dav-v commented 4 years ago

Yes, thank you very much @zecevicp . I was also wondering, is there a particular reason why the UDFs are written in Scala? Wouldn't be possible to implement calcGnom() directly in Python as a PandasUDF or using the built-in SQL functions? Thanks again