Skip to content

Conversation

@mhasself
Copy link
Member

Description

Extends sun avoidance code and tests to cover situations where a scope is pointed below horizon level, or in the el > 90 range.

Motivation and Context

The ACU Sun Avoidance code was developed for SAT, considering elevation range (0, 90). The LAT can move through elevations (-90, 180), which presents new challenges.

The most pressing concern was to recognize that the Earth blocks the Sun, so it's always safe to point at el=-90, even at local midnight.

A full examination yielded lots of other edge cases though, such as how to handle cases where the Sun has just set or is just about to rise.

How Has This Been Tested?

I tested this extensively using ACU simulator by tweaking the Sun position into key areas (zenith, sunset, sunrise) and testing status variables and escape behavior. These manual tests led to many, and more pointed unit tests.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

mhasself added 2 commits June 17, 2025 16:54
- Properly handles LAT range, el=-90 through 180.
- Fix "sun_time_shift" feature, for testing+debugging, works better
- When sun is below horizon, a status indicator is explicitly set.
- When boresight is below horizon, a status indicator is set.
- Lots of tests for the extended elevation range of LAT.
- Allow el_dodging
- el_horizon=0 instead of 10.
Copy link
Member

@BrianJKoopman BrianJKoopman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Good to see all the added tests! Just a couple of small comments.

@mhasself
Copy link
Member Author

Looks good to me. Good to see all the added tests! Just a couple of small comments.

Thanks for the careful read! All comments addressed now, I believe.

@mhasself mhasself requested a review from BrianJKoopman June 18, 2025 19:05
@BrianJKoopman BrianJKoopman merged commit 4f77da8 into main Jun 18, 2025
5 checks passed
@BrianJKoopman BrianJKoopman deleted the mhasself/acu-sun-horizon branch June 18, 2025 19:26
@BrianJKoopman BrianJKoopman changed the title ACU: fix Sun Avoidance for extended el range ACU: Fix sun avoidance for extended el range Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants