Skip to content

Commit

Permalink
Using faster angular distance
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomov committed Apr 25, 2018
1 parent 7ea9583 commit d426c73
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions astromodels/functions/functions_2D.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import numpy as np
from scipy.integrate import quad
from astropy.coordinates import SkyCoord, ICRS, BaseCoordinateFrame
from astropy.io import fits
from astropy import wcs
Expand Down Expand Up @@ -147,8 +146,9 @@ def evaluate(self, x, y, lon0, lat0, sigma):

angsep = angular_distance(lon0, lat0, lon, lat)

return np.power(180 / np.pi, 2) * 1. / (2 * np.pi * sigma ** 2) * np.exp(
-0.5 * np.power(angsep, 2) / sigma ** 2)
s2 = sigma**2

return (180 / np.pi)**2 * 1 / (2.0 * np.pi * s2) * np.exp(-0.5 * angsep**2/s2)

def get_boundaries(self):

Expand Down

0 comments on commit d426c73

Please sign in to comment.