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

SWAPI l2 Implementation - counts to rate #721

Merged
merged 4 commits into from
Jul 31, 2024

Conversation

tech3371
Copy link
Contributor

Change Summary

Overview

Process SWAPI L1 to L2. This PR will close this ticket: #706

New Files

  • imap_processing/swapi/l2/swapi_l2.py
    • L2 code

Updated Files

Added L2 updates to these files

  • imap_processing/cdf/config/imap_swapi_global_cdf_attrs.yaml
  • imap_processing/cdf/config/imap_swapi_variable_attrs.yaml
  • imap_processing/cli.py
  • imap_processing/swapi/l1/swapi_l1.py

Testing

  • imap_processing/tests/swapi/test_swapi_l1.py
  • imap_processing/tests/swapi/test_swapi_l2.py

@tech3371 tech3371 added Ins: SWAPI Related to the SWAPI instrument Level: L2 Level 2 processing CDF Related to CDF files labels Jul 26, 2024
@tech3371 tech3371 requested review from a team July 26, 2024 21:59
@tech3371 tech3371 self-assigned this Jul 26, 2024
@tech3371 tech3371 requested review from bryan-harter, maxinelasp, anamanica, greglucas and subagonsouth and removed request for a team July 26, 2024 21:59
@tech3371 tech3371 linked an issue Jul 26, 2024 that may be closed by this pull request
t_bin time. t_bin is the exposure time per energy bin which is
obtained by dividing the time for one complete sweep
(12 s, coarse + fine sweep) by the total energy steps (72),
i.e., t_bin = 12/72 = 0.167 s. This will be constant.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Make this a global constant outside the function? TIME_PER_BIN = 12 / 72

Note that 12/72 is not equal to 0.167, it is 0.166666 repeating. Do you want to store 0.167 or 12/72?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Their algorithm document says to use 0.167. That's why I used that. This comment was to give background understanding of where that value came from. I can ask SWAPI team this week.

imap_processing/swapi/l2/swapi_l2.py Outdated Show resolved Hide resolved
imap_processing/swapi/l2/swapi_l2.py Outdated Show resolved Hide resolved
imap_processing/tests/swapi/test_swapi_l2.py Outdated Show resolved Hide resolved
imap_processing/tests/swapi/test_swapi_l2.py Outdated Show resolved Hide resolved
imap_processing/tests/swapi/test_swapi_l2.py Outdated Show resolved Hide resolved
imap_processing/tests/swapi/test_swapi_l2.py Show resolved Hide resolved
@tech3371 tech3371 requested a review from greglucas July 29, 2024 15:54
Copy link
Contributor

@subagonsouth subagonsouth left a comment

Choose a reason for hiding this comment

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

This looks good to me. I left some comments that are more advice about changes that can avoid future challenges.

imap_processing/tests/swapi/test_swapi_l2.py Outdated Show resolved Hide resolved
imap_processing/tests/swapi/test_swapi_l2.py Show resolved Hide resolved
Copy link
Collaborator

@greglucas greglucas left a comment

Choose a reason for hiding this comment

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

Looks good to me. Some minor nits that don't impact the actual calculations.

imap_processing/swapi/l2/swapi_l2.py Outdated Show resolved Hide resolved
imap_processing/swapi/l2/swapi_l2.py Outdated Show resolved Hide resolved
@tech3371 tech3371 merged commit 00b70ad into IMAP-Science-Operations-Center:dev Jul 31, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CDF Related to CDF files Ins: SWAPI Related to the SWAPI instrument Level: L2 Level 2 processing
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

SWAPI L2 algorithm - Convert counts to rate
3 participants