Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

divide by zero bug in elliptical_exact.pyx #12

Merged
merged 1 commit into from
Nov 30, 2012

Conversation

astrofrog
Copy link
Member

I don't know when this got introduced, but I'm getting failed tests due to this function in elliptical_exact.pyx:

def circle_line(double x1, double y1, double x2, double y2):
    '''Intersection of a line defined by two points with a unit circle'''

    cdef double a, b, delta

    # Find the slope and intercept of the line
    a = (y2 - y1) / (x2 - x1)

When x1 == x2 (which happens for vertical lines of course) this give a divide by zero error.

Actually I'm also getting failed tests on master having to do with the changing API for encloses methods, but that will be resolved in my PR #11.

@astrofrog
Copy link
Member

The errors were due to particular alignments of the pixel edges with the aperture. I've fixed this, and all the tests seem to pass. I'm going to add some more thorough tests after this.

astrofrog added a commit that referenced this pull request Nov 30, 2012
divide by zero bug in elliptical_exact.pyx
@astrofrog astrofrog merged commit 4b9629c into astropy:master Nov 30, 2012
astrofrog added a commit to astrofrog/photutils that referenced this pull request Oct 12, 2013
Update setup.py to reflect re-factored setup code for 0.2 release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant