Skip to content

Log smooth powerlaw bug#3164

Open
aldo9253 wants to merge 8 commits intoIMAP-Science-Operations-Center:devfrom
aldo9253:log_smooth_powerlaw_bug
Open

Log smooth powerlaw bug#3164
aldo9253 wants to merge 8 commits intoIMAP-Science-Operations-Center:devfrom
aldo9253:log_smooth_powerlaw_bug

Conversation

@aldo9253
Copy link
Copy Markdown
Collaborator

@aldo9253 aldo9253 commented May 8, 2026

Change Summary

Added comments to clarify unit input/output from functions. Corrected variable usage in log_smooth_powerlaw and swapped calibration files.

#3163

Overview

idex_l2a.py

File changes

Re-processed l2a from 2026-04-12 and inspected fits.

Testing

@lacoak21 lacoak21 self-requested a review May 8, 2026 18:10
@lacoak21 lacoak21 added the Ins: IDEX Related to the IDEX instrument label May 8, 2026
@lacoak21 lacoak21 added this to IMAP May 8, 2026
@lacoak21 lacoak21 requested a review from Copilot May 8, 2026 18:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes IDEX L2A dust velocity/mass estimation around the calibration “log smooth powerlaw” by correcting calibration-file usage, using the intended transition-sharpness parameter in the calibration curve, and clarifying/adjusting units (notably pC → C).

Changes:

  • Swapped the two IDEX calibration CSV inputs so t_rise_params and yield_params are loaded from the correct files.
  • Fixed log_smooth_powerlaw() to use k (not m) for the smooth transition terms.
  • Converted fitted signal amplitude from pC to C before computing mass, and updated several unit-related docstrings/comments.
Comments suppressed due to low confidence (1)

imap_processing/idex/idex_l2a.py:916

  • fit_impact() now documents time/time_of_impact in microseconds and amplitude in pC, but rise_time and discharge_time are still documented as seconds. Since these time constants are used directly in the exponent with time (and upstream initial guesses are in microseconds), the docstrings for rise_time/discharge_time should also be updated to microseconds for consistency and correctness.
    amplitude : float
        Signal height (pC).
    rise_time : float
        How fast the signal rises (s).
    discharge_time : float
        How fast the signal decays (s).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread imap_processing/idex/idex_l2a.py
Comment on lines 355 to +357
yield_val = 10 ** log_smooth_powerlaw(np.log10(v_est), log_a_y, yield_params[1:])
mass_est = sig_amp / yield_val
sig_amp_coulombs = sig_amp * 1e-12
mass_est = sig_amp_coulombs / yield_val
Comment thread imap_processing/idex/idex_l2a.py
Copy link
Copy Markdown
Contributor

@lacoak21 lacoak21 left a comment

Choose a reason for hiding this comment

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

Approved! Excellent work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ins: IDEX Related to the IDEX instrument

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants