pygama icon indicating copy to clipboard operation
pygama copied to clipboard

Added DPZ extractor to pargen

Open SamuelBorden opened this issue 1 year ago • 3 comments

The function get_dpz_decay_constants works to get the constants needed for the double pole zero filter in three steps:

  1. A guess for the long and short time constants are obtained by taking linear fits to the logarithm of a superpulse
  2. These guesses are used to seed a least squares fit
  3. The least squares values are then used in a dsp chain that optimizes the flatness of the decaying tails of waveforms

This is a first pass at the routine, so we should think maybe a bit more about where to put this in the dataflow. Right now this quickly interfaces with the single pole-zero dataflow script; to do that, the superpulse is created inside the function get_dpz_decay_constants. But we might want to make get_dpz_decay_constants a bit more general and instead create the superpulse in the dataflow.

There are other issues currently with the double pole zero filter, see https://github.com/legend-exp/dspeed/pull/52. So I am going to mark this as a draft PR

SamuelBorden avatar Feb 15 '24 21:02 SamuelBorden

Codecov Report

Attention: Patch coverage is 62.98343% with 67 lines in your changes are missing coverage. Please review.

Project coverage is 25.51%. Comparing base (ae3752a) to head (7fdd904). Report is 50 commits behind head on main.

Files Patch % Lines
src/pygama/pargen/extract_tau.py 62.98% 67 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #558      +/-   ##
==========================================
+ Coverage   22.82%   25.51%   +2.68%     
==========================================
  Files          42       42              
  Lines        8110     8220     +110     
==========================================
+ Hits         1851     2097     +246     
+ Misses       6259     6123     -136     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 15 '24 21:02 codecov[bot]

@ggmarshall @SamuelBorden can this be merged to main or will mess up with the refactor?

gipert avatar Apr 25 '24 08:04 gipert

I need to change some imports from the energy cal routines, but then it should be good to go. I'll work on synergizing this with the pargen refactor

SamuelBorden avatar Apr 26 '24 00:04 SamuelBorden