Closed bpindelski closed 10 years ago
Hmmm.... I have a feeling this should ring some Python version bell, but perhaps we've already moved passed that minimum requirement. (I know it doesn't work with 2.4)
@joshmoore You are right, this is a Python 2.5 feature. And I still remember the lesson that using post-2.4 features taught me. Having said that, please see http://www.openmicroscopy.org/site/support/omero5/sysadmins/system-requirements.html.
My immediate thought is is there a reason why are we sticking to math.atan(y/x)
instead of math.atan2(y,x)
which is correctly handling zero values for x and or y (and would prevent our code from handling this error?)
Apart from my comment above, the fix proposed works when running Plot_Profile on horizontal single lines of various widths.
Next steps?
@joshmoore I'll leave the call to @will-moore. I've tried looking at the code of the script, but it doesn't immediately say if X/Y-parallel lines are allowed.
The Plot Profile script now works fine on horizontal and vertical lines. The fix above should also be applied to the Kymograph script to fix the same bug there, see: http://trac.openmicroscopy.org.uk/ome/ticket/11988 Thanks!
@will-moore Thanks for testing. I'm happy to go with @sbesson's suggestion in this PR and use atan2
, as long as it won't impact the values produced by the script.
Last call? Otherwise, I'll merge and we can atan2
later.
Fine by me ;)
--rebased-to #90
This PR fixes the situation in which a
ZeroDivisionError
is thrown when the ROI line is parallel to the X axis and hence they1
andy2
values are equal, returning 0 in the subtraction.The error returned was:
To test - check that the values returned from the script make sense. /cc @will-moore