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

Ultra l1c bin data #829

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

laspsandoval
Copy link
Contributor

Change Summary

Overview

Add spatial and energy binning equations.

Updated Files

  • ultra_l1c_pset_bins.py
    • Added spatial and energy binning mechanisms.

Testing

  • test_ultra_l1c_pset_bins.py
    • Tests ultra_l1c_pset_bins.py

@laspsandoval laspsandoval self-assigned this Sep 12, 2024
@laspsandoval laspsandoval added this to the Sept 2024 milestone Sep 12, 2024
@laspsandoval laspsandoval added Ins: Ultra Related to the IMAP-Ultra instrument Level: L1 Level 1 processing labels Sep 12, 2024
@laspsandoval laspsandoval requested review from subagonsouth and sdhoyt and removed request for sdhoyt and subagonsouth September 12, 2024 16:47
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 have a few comments about implementation things and recommendations on functions to look at to see if they might help.

return az, el


def bin_space(
Copy link
Contributor

Choose a reason for hiding this comment

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

You might consider checking out the 2d histogram function. I believe it would be ideal for this binning:
https://numpy.org/doc/stable/reference/generated/numpy.histogram2d.html

energy_bin_edges = build_energy_bins()

# Find the appropriate bin index.
energy_bin_idx = np.searchsorted(energy_bin_edges, energy, side="right") - 1
Copy link
Contributor

Choose a reason for hiding this comment

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


Returns
-------
az_midpoint : np.ndarray
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess that I am missing something. Is there a reason that this function doesn't just produce the 2d histogram data?

Returns
-------
energy_start : np.ndarray
Start of energy bin.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question here... When I think of a function that "bins" data, it returns a histogram rather than the bin center location for each input.

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
None yet
Development

Successfully merging this pull request may close these issues.

2 participants