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

SWE: calculate phase space density #1041

Merged

Conversation

tech3371
Copy link
Contributor

Change Summary

closes #884

Overview

Function to calculate SWE L2 phase space density. I used lot of ideas Greg suggested before leave.

Updated Files

  • imap_processing/swe/l1b/swe_l1b_science.py
    • update caused from refactor code
  • imap_processing/swe/l2/swe_l2.py
    • main changes to calculate phase space density
  • imap_processing/swe/utils/swe_utils.py
    • refactor way of reading in lookup table

Testing

  • imap_processing/tests/swe/test_swe_l2.py
    • added test for new function

@tech3371 tech3371 added Ins: SWE Related to the SWE instrument Level: L2 Level 2 processing labels Oct 22, 2024
@tech3371 tech3371 requested a review from a team October 22, 2024 19:10
@tech3371 tech3371 self-assigned this Oct 22, 2024
@tech3371 tech3371 requested review from vmartinez-cu, laspsandoval and maxinelasp and removed request for a team October 22, 2024 19:10
@tech3371 tech3371 changed the title calculate phase space density SWE: calculate phase space density Oct 22, 2024
Copy link
Contributor

@maxinelasp maxinelasp left a comment

Choose a reason for hiding this comment

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

LGTM, although I'm not super familiar with the rest of the code base. I appreciate the use of dataframes rather than dicts.


# TODO: add this to instrument status summary
# TODO: add these to instrument status summary
ENERGY_CONVERSION_FACTOR = 4.75
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these constants be in a swe constants.py type file? Fine if they're only used here, just wanted to ask

Copy link
Contributor Author

@tech3371 tech3371 Oct 30, 2024

Choose a reason for hiding this comment

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

This is a temporary storage. I image these going into instrument status summary. Right now, it's only used here. I will keep constants.py idea in mind if we use this in another place later on.

@tech3371
Copy link
Contributor Author

LGTM, although I'm not super familiar with the rest of the code base. I appreciate the use of dataframes rather than dicts.

Thank you for quick review. I know you just go back.

dataframes ideas credit goes to Greg. I was not happy with what I had before and asked Greg for ideas. He was the one who suggested getting everything in same shape to simplify mathematical operations.

@tech3371 tech3371 merged commit e9c6eb9 into IMAP-Science-Operations-Center:dev Oct 30, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ins: SWE Related to the SWE instrument Level: L2 Level 2 processing
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Convert counts to phase space density
2 participants