-
Notifications
You must be signed in to change notification settings - Fork 16
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
1019 calculate instrument spin phase #1022
1019 calculate instrument spin phase #1022
Conversation
Add function get_spacecraft_to_instrument_spin_phase_offset Add test coverage for new geometry functions
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.
Nice!
imap_processing/spice/geometry.py
Outdated
""" | ||
Get the spin phase offset from the spacecraft to the instrument. | ||
|
||
The spin phase offset is can be calculated using the instrument frame SPICE |
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.
The spin phase offset is can be calculated using the instrument frame SPICE | |
The spin phase offset can be calculated using the instrument frame SPICE |
instrument_spin_phase_offset = get_spacecraft_to_instrument_spin_phase_offset( | ||
instrument | ||
) | ||
return (spacecraft_spin_phase + instrument_spin_phase_offset) % 1 |
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.
This % 1
is to get the [0, 1)
range?
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.
Yes, that is correct. The s/c spin phase is in [0, 1)
but then we add a positive offset value that is also in the range [0, 1), so we need to "unwind" the phase back into the [0, 1)
range.
) | ||
def test_get_instrument_spin_phase(instrument, fake_spin_data): | ||
"""Test coverage for get_instrument_spin_phase()""" | ||
ets = np.array([7.5, 30, 61, 75, 106, 121, 136]) |
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.
can you spell est
out?
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.
Sure... that should be MET instead of ephemeris time (et) anyway.
f7b2467
into
IMAP-Science-Operations-Center:dev
Change Summary
Overview
Adds two functions:
get_spacecraft_to_instrument_spin_phase_offset()
This function provides the offset to apply to the spacecraft spin phase to get the instrument spin phase. For now, this is a hard coded table. In the future, it will most likely use SPICE to determine the phase offset.
get_instrument_spin_phase()
This function just adds the offset to the spacecraft spin phase and does a modulus with 1 to return the phase to the [0, 1) range.
Updated Files
Closes: #1019