-
Notifications
You must be signed in to change notification settings - Fork 10
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
odd (wrong?) desiname #211
Comments
When the numbers are truncated, >>> dectrunc = np.trunc((10 ** precision) * target_dec).astype(int).astype(str)
>>> dectrunc
'-132' which isn't enough characters to properly handle the zero-padding below that point. If the zero-padding were performed immediately after, then it might work. >>> dectrunc.zfill(7)
'-000132'
>>> dectrunc.zfill(7)[:-precision] + '.' + dectrunc.zfill(7)[-precision:]
'-00.0132' |
Please take a look at this updated code. I've added some tests for when RA or Dec are very close to zero. |
That update looks great, @weaverba137, thanks for the quick turn-around. |
Thank you for the quick update, Ben. A very nice and clean solution! I think that the solution using 7 and 6 zero padding is specific to precision=4. The level of precision is a variable but is not an input argument, so this is a very minor issue. At some point we should update it though. |
@akremin, I agree, I'll make the padding a function of precision to make that explicit. |
@akremin
I think we've hit a corner-case that the algorithm gets wrong. Haven't checked any catalogs yet; I came across this in the wild.
The text was updated successfully, but these errors were encountered: