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

Fix typo found in #1514 #1515

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

telegraphic
Copy link
Contributor

Typo fix to address #1514: a missing minus sign meant that array indexing was broken in calc_frame_pos_angle().

Description

Changed

    dn_ra[-dn_dec > (np.pi / 2.0)] = np.mod(
        dn_ra[dn_dec > (np.pi / 2.0)] + np.pi, 2.0 * np.pi
    )

to

    dn_ra[-dn_dec > (np.pi / 2.0)] = np.mod(
        dn_ra[-dn_dec > (np.pi / 2.0)] + np.pi, 2.0 * np.pi
    )

Motivation and Context

Fixes #1514.

Looking at the indexing, you might expect this code to have failed earlier, however this bug only arises when there are values where abs(dn_dec) > 90 degrees. To meet this requires inputs app_dec - offset_pos to exceed - 90 degrees (meaning an observation close to -90 deg, and/or a large offset position).

The code passed previously because both correct and incorrect index masks returned zero-length arrays. For example, this code runs without an error:

a = np.arange(1024)
a[a<0] = a[a>1024]

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 change)
  • Documentation change (documentation changes only)
  • Version change
  • Build or continuous integration change

Checklist:

Bug fix checklist:

  • My fix includes a new test that breaks as a result of the bug (if possible).
  • All new and existing tests pass.
  • I have updated the CHANGELOG.

@telegraphic
Copy link
Contributor Author

Looks like tests failed with E urllib.error.URLError: <urlopen error timed out>, so probably just need to be re-triggered

@bhazelton
Copy link
Member

The errors are caused by the SPICE server being down. It's hosted at JPL, which is currently being impacted by fires. This is only an issue for jobs where we install lunarsky and run the related tests. If this becomes a frequent or major problem we could re-work the tests so that only a few jobs installed lunarsky, but I'm not inclined to go that route yet.

Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.93%. Comparing base (6da30d9) to head (676adbf).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1515   +/-   ##
=======================================
  Coverage   99.93%   99.93%           
=======================================
  Files          63       63           
  Lines       21849    21849           
=======================================
  Hits        21834    21834           
  Misses         15       15           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Bug in calc_frame_pos_angle function
2 participants