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
Automate fixing common beam failures #81
Conversation
…ion is not valid. Auto re-run to find a valid solution
|
…fairly close to this being automatic, though
…ot crucial so give more lee-way to the comparison
A bit more detail: the Increasing
For each iteration, we just re-do the solution after increasing The default values work well for the cubes I was having issues with but may still not work for certain beam sets. I've added notes in the docs about this and further steps to solve the problem. We could increase the default |
@e-koch could you highlight the part that needs review? I assume the infrastructure stuff doesn't; is it just a question of the epsilon parameter? |
@keflavich -- Yeah, it's just treating Apart from that, it's how lenient we should let the default I'm not sure why the infrastructure changes are showing up here... I already merged #82 with those commits. Will check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, this looks good to me. Do check on why the infrastructure stuff is showing up here, but otherwise I approve
|
||
center, radii, rotation = \ | ||
getMinVolEllipse(edge_pts, tolerance=tolerance) | ||
if pa.value == -np.pi or pa.value == np.pi: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be pa = -np.pi * u.rad
so that a PA in degrees will catch on this too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also is ==
OK here, or do we need almost_equal
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==
is ok since pa
uses np.arctan2
and has the exact angles defined. And small angles from 0. deg don't really affect the beam properties.
@adamginsburg Still unsure why the infrastructure commits are showing up in this PR. But a local merge worked as expected without duplicate commits so I'll give it a shot here. |
We rely on an approximate common beam solver that sometimes fails when the solution is marginally (but within the tolerance) smaller than the true common beam. To encourage the solution to converge to an ellipse just marginally larger (<<1% in area) but can be deconvolved from all beams in the set, we add an
epsilon
to the perimeter points used in the solver. Certain cases still fail whenepsilon
is too small.This PR allows
epsilon
to iteratively increase up to some set maximum to (hopefully) automate what the user would do when this error comes up.