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

Create Ultra pset energy bins #811

Conversation

laspsandoval
Copy link
Contributor

Change Summary

Overview

Simple code to create energy bins for pset.

New Files

  • ultra_l1c_pset_bins.py
    • Create energy bins for pset

Testing

test_ultra_l1c_pset_bins.py

@laspsandoval laspsandoval self-assigned this Sep 4, 2024
@laspsandoval laspsandoval added Ins: Ultra Related to the IMAP-Ultra instrument Level: L1 Level 1 processing labels Sep 4, 2024
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.

I was trying to figure out if there was a clever way to generate the energy bins, but didn't come up with anything better than your while loop. Looks good to me with one nit-pick.

imap_processing/ultra/l1c/ultra_l1c_pset_bins.py Outdated 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.

I have a few quick suggestions to think about. Do you know the number of bins and the start? I'd start with that rather than the while < value version.

I think this one-liner might give you what you are after:

3.5 * energy_step ** np.arange(91)

That will also return all bin edges. I'd return that single array of the edges rather than a tuple, and then use it within the code as bin_start = bin_edges[:-1], bin_end = bin_edges[1:].

@laspsandoval laspsandoval merged commit 7b9395b into IMAP-Science-Operations-Center:dev Sep 9, 2024
17 checks passed
@laspsandoval laspsandoval deleted the ultra_l1c_pset_bins_1 branch September 9, 2024 15:23
@bourque bourque added this to the Sept 2024 milestone Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ins: Ultra Related to the IMAP-Ultra instrument Level: L1 Level 1 processing
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants