esheldon / esutil

A variety of python utilities focusing on numerical, scientific, and astrophysical computing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

coords.sphdist fails if ra2, dec2 is array but ra1, dec1 is scalar

GoogleCodeExporter opened this issue · comments

numpy.where messes it up. you can't unpack it as done in coord.py:487 when the 
dimension of the input is messy. 

To achieve the same clipping, use numpy.clip:


    costheta.clip(min=-1.0, max=1.0, out=costheta)


It's faster and error proofer. There are several similar cases in the code.

Original issue reported on code.google.com by rainwood...@gmail.com on 7 Apr 2012 at 7:11

Thanks for the suggestion, that is better.  Please "svn update" to get the 
fixed version.  Let me know how it goes.

Original comment by erin.sheldon@gmail.com on 8 Apr 2012 at 12:36

Original comment by erin.sheldon@gmail.com on 8 Mar 2013 at 10:57

  • Changed state: Fixed