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

795 spice instrument pointing at specified time #903

Conversation

subagonsouth
Copy link
Contributor

Change Summary

Overview

Add preliminary function for computing instrument pointing using spice.

Updated Files

  • imap_processing/spice/geometry.py
    • Modify frame_transform function to allow multiple time inputs with a single position vector.
    • Add simple lookup for getting instrument boresight vectors.
    • Add instrument pointing function that can return Lat/Lon or Cartesian coordinates
  • imap_processing/tests/spice/test_geometry.py
    • Parameterize test for frame_transform and add coverage for multiple time inputs with single position vector
    • Add test coverage for new instrument_pointing function

Closes: #795

…ame_transform funciton

Parameterize frame_transform test
Add frame_transform coverage for multiple ets and single position vector
Add test coverage for instrument_pointing funciton
return pointing
if isinstance(et, typing.Collection):
return np.array([spice.reclat(vec)[1:] for vec in pointing])
return np.array(spice.reclat(pointing)[1:])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

spice.reclat() returns radians. These should probably be converted to degrees.

@@ -62,6 +62,24 @@ class SpiceFrame(IntEnum):
IMAP_GLOWS = -43750


# TODO: Update boresight for in-situ instruments
# TODO: Confirm ENA boresight vectors
BORESIGHT_LOOKUP = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is my low effort initial approach to defining instrument boresights. I am open to suggestions of how to make this better, where to move this definition, etc. I still don't know if we should eventually create an instrument kernel that defines these. I need to get a better understanding of all of the requirements from all of the instruments before making that decision.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have to use .name or can it just be the enumeration itself as the lookup?

Comment on lines 377 to 378
return np.array([spice.reclat(vec)[1:] for vec in pointing])
return np.array(spice.reclat(pointing)[1:])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return np.array([spice.reclat(vec)[1:] for vec in pointing])
return np.array(spice.reclat(pointing)[1:])
return np.rad2deg([spice.reclat(vec)[1:] for vec in pointing])
return np.rad2deg(spice.reclat(pointing)[1:])

@@ -62,6 +62,24 @@ class SpiceFrame(IntEnum):
IMAP_GLOWS = -43750


# TODO: Update boresight for in-situ instruments
# TODO: Confirm ENA boresight vectors
BORESIGHT_LOOKUP = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have to use .name or can it just be the enumeration itself as the lookup?

Copy link
Contributor

@tech3371 tech3371 left a comment

Choose a reason for hiding this comment

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

LTGM with my limited knowledge.

@subagonsouth subagonsouth merged commit 63b77e8 into IMAP-Science-Operations-Center:dev Oct 2, 2024
17 checks passed
@subagonsouth subagonsouth deleted the 795-spice-instrument-pointing-at-specified-time branch October 2, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

SPICE - Instrument pointing at specified time
3 participants