-
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
1148 hi l1c populate despun z #1253
1148 hi l1c populate despun z #1253
Conversation
Add test coverage for pset_geometry function
…cartesian functions Calculate despun_z vector and hae lat/lon of spin bins in L1C pset Add test coverage for hae lat/lon values
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.
LGTM! If you think it's important, we could extract out a function to transform from AZ/EL in frame A to AZ/EL in frame B.
@@ -72,8 +79,9 @@ def generate_pset_dataset(de_dataset: xr.Dataset) -> xr.Dataset: | |||
pset_dataset.epoch.data[0] = np.mean(de_dataset.epoch.data[[0, -1]]).astype( | |||
np.int64 | |||
) | |||
pset_et = j2000ns_to_j2000s(pset_dataset.epoch.data[0]) |
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.
Ah good to know! I'll need to add this to the Ultra L2 code as well.
|
||
pset_dataset.update(pset_geometry()) | ||
pset_dataset.update(pset_geometry(pset_et, logical_source_parts["sensor"])) |
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 add a comment to explain what this update does?
(As I understand it: pset_geometry
calculates the hae frame projection of the DPS bins lat/lon and the despun Z vector, then this adds those to the xr.Dataset
.)
np.full(3600, np.deg2rad(el)), | ||
] | ||
).T | ||
dps_cartesian = spherical_to_cartesian(dps_az_el) |
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 transformation all looks good! I wonder, since we've been talking so much about shared functionality, if we should make a function like:
AZ_b, EL_b = frame_transform_az_el(input_frame=A, projection_frame=B, input_az=AZ_a, input_el=EL_a)
which combines these 3 often repeated steps:
- Make unit vectors from AZ_a, EL_a angles in frame A
- Transform these vectors to unit vectors in frame B
- Convert to projected AZ_b, EL_b angles in frame B
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.
Good idea! I'll write a SPICE ticket for this function.
@mock.patch( | ||
"imap_processing.hi.l1c.hi_l1c.frame_transform", side_effect=lambda a, b, c, d: b | ||
) |
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.
Just checking, this is mocking the frame transform to simply return the input position? Maybe add a comment or replace argument b with position.
4cb7084
into
IMAP-Science-Operations-Center:dev
Change Summary
Overview
Adds computation of despun_z (Pointing frame z-axis) in the HAE Ecliptic frame and the pointing set spin bin locations in the HAE Ecliptic frame.
Updated Files
pset_geometry()
functionCloses: #1148 #1149