-
Notifications
You must be signed in to change notification settings - Fork 6
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
added eors #24
added eors #24
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24 +/- ##
=========================================
+ Coverage 98.75% 98.95% +0.2%
=========================================
Files 5 5
Lines 80 96 +16
=========================================
+ Hits 79 95 +16
Misses 1 1
Continue to review full report at Codecov.
|
There are two issues:
|
|
In Julia, In C there isn't a native operator to perform integer division between floating point numbers. Instead, division between integer types is integer division, but that's not the case here (all operands in the |
src/AstroBase.jl
Outdated
@@ -115,4 +115,25 @@ function tio_locator(jd1, jd2) | |||
-47e-6 * t * sec2rad(1) | |||
end | |||
|
|||
""" | |||
equations_of_origins(rnpb, s) |
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.
equation_of_origins
@prakharcode This is a row-major vs. column-major matrix issue. You will see that if you pass the transpose of your matrix to the function the result will be correct. |
@prakharcode BTW, you could also port the test cases from ERFA so you do not have to come up with your own. See here: https://github.com/liberfa/erfa/blob/master/src/t_erfa_c.c |
@giordano Now I ruined your lesson because I did not read your reply closely 🙈 Sorry 😜 |
* added * added gmst06 * added 82 * gmst82 * fixed * coverage * Update AstroBase.jl
* pr00 * rebase * Add doctest * Update AstroBase.jl
src/AstroBase.jl
Outdated
zs = -x | ||
p = (rnpb[1, 1] * xs) + (rnpb[2, 1] * ys) + (rnpb[3, 1] * zs) | ||
q = (rnpb[1, 2] * xs) + (rnpb[2, 2] * ys) + (rnpb[3, 2] * zs) | ||
((p != 0) || (q != 0)) ? s - atan2(q, p) : s |
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.
Parens are unnecessary.
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.
atan(q, p)
see JuliaLang/julia#27248
src/AstroBase.jl
Outdated
sec2rad((xpr + (xyls[1] + xypl[1]) / 1e6)), sec2rad(ypr + (xyls[2] + xypl[2]) / 1e6) | ||
end | ||
|
||
""" | ||
equations_of_origins(rnpb, s) |
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.
equation_of_origins
src/AstroBase.jl
Outdated
function equation_of_origins(rnpb, s) | ||
x = rnpb[1, 3] | ||
ax = x / (1.0 + rnpb[3, 3]) | ||
xs = 1.0 - (ax * x) |
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.
Actually, all parens beyond this point should be removed (except for the function call) 😂 https://en.wikipedia.org/wiki/Order_of_operations#Mnemonics 😜
There were some unrelated changes (deleted lines etc.) but I have fixed them myself. |
@giordano any lights on this error?