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

Adding function sun_position_el (ported from SatelliteToolbox.jl) #2

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

spacenewb
Copy link

Added sun_position_el and associated tests

spacenewb added 3 commits July 8, 2023 13:58
Computes sun position in local coordinates.  Ported from SatelliteToolbox.jl
updated tests to include all algorithms with independent tolerances
fixed independent tolerances for test of sun_position_el
@ronisbr
Copy link
Member

ronisbr commented Jul 8, 2023

Hi @spacenewb!

Thanks!

I have some comments that I will provide as a review in the source-code.

Furthermore, I think we should not add those functionalities in SatelliteToolboxBase.jl. Otherwise, packages that will not need all those functionalities will need to load them. The correct approach is to add SatelliteToolboxTransformations.jl as dependency to this package. Can you please make this modification?

spacenewb added 2 commits July 9, 2023 00:34
Added SatelliteToolboxTransformations.jl as a dependency to this package
The algorithms to compute the RA and DEC gave negative angular results. This is corrected to give only positive angular results.
@spacenewb
Copy link
Author

spacenewb commented Jul 8, 2023

Sure!

It was tardy on my part. I was too lazy to check the source code in SatelliteToolboxTransformations.jl. I have corrected the duplicate import issues now. There was a minor bug in the sun_position_el function as well, which is now corrected. On my local system, SatelliteToolboxCelestialBodies.jl now passes all the tests.

spacenewb added 3 commits July 9, 2023 10:48
Manually added dependency and compatibility for SatelliteToolboxTransformations.jl
The previous algorithms used were case based and less robust. The currently implemented algorithm (PSA+) is a fast approximated solution up to 50 arcsecs accuracy.
@spacenewb
Copy link
Author

I changed the algorithm used by the function to compute the topocentric sun position. The new algorithm is called PSA+. It can be found at Updating the PSA sun position algorithm.

@ronisbr
Copy link
Member

ronisbr commented Jul 11, 2023

Hi @spacenewb!

I left some comments in the code review section, can you please take a look? The most important one is related the function return be linked to a flag. In this case, the code will be type unstable and thus very slow.

@spacenewb
Copy link
Author

spacenewb commented Jul 11, 2023

Hi @spacenewb!

I left some comments in the code review section, can you please take a look? The most important one is related the function return be linked to a flag. In this case, the code will be type unstable and thus very slow.

Hi @ronisbr

I cannot see any pending requests. I don't know if this is my mistake. Could you please check if you have left a code review

@ronisbr
Copy link
Member

ronisbr commented Jul 11, 2023

Yes! I think so, take a look here: https://github.com/JuliaSpace/SatelliteToolboxCelestialBodies.jl/pull/2/files

The main problem is related to the flag, because it will add type instability.

@spacenewb
Copy link
Author

I have updated the function sun_position_el such that it returns all output variables without any flag. I also happened to stumble upon the need to use the radius of the Earth as a constant. Do you think it's wise to export it as a constant in the SatelliteToolboxBase and then use it here in SatelliteToolboxCelestialBodies?

@spacenewb
Copy link
Author

spacenewb commented Jul 11, 2023

Yes! I think so, take a look here: https://github.com/JuliaSpace/SatelliteToolboxCelestialBodies.jl/pull/2/files

The main problem is related to the flag, because it will add type instability.

I still cannot see any reviews. I am sorry because I am learning the platform. I must be doing something wrong.

I get this when I filter the PR list on the basis of reviews:

Reviews - Not reviewed by me:

NotReviewedByMe

Reviews - Changes requested:

ChangesRequested

However, I have addressed the main issue about the flag in sun_position_el.

@ronisbr
Copy link
Member

ronisbr commented Jul 21, 2023

Hum, very strange, I am seeing the reviews in the code. Do you mind if I merge this commit and make the modifications myself?

@spacenewb
Copy link
Author

Please feel free to merge this commit. I am sorry that I could not do the modifications myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants