Skip to content

Commit

Permalink
Merge branch 'master' into corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
cfuselli authored Oct 24, 2024
2 parents e302fc2 + 5cf0c22 commit 3d702d2
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion amstrax/plugins/events/corrected_areas.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CorrectedAreas(strax.Plugin):
"""

__version__ = "0.5.1"
__version__ = "0.6.0"

depends_on = ("event_basics", "event_positions")

Expand Down Expand Up @@ -62,6 +62,19 @@ def s1_naive_z_correction(self, z):

return correction

def s1_naive_z_correction(self, z):
"""
Apply a naive z-dependent S1 correction.
Returns the correction factor for the S1 area.
"""

s1_correction_function = lambda z: y0 + a * z
zmin, zmax, y0, a = self.config["s1_naive_z_correction"]
s1_correction_average = s1_correction_function((zmin + zmax) / 2)
correction = s1_correction_average/s1_correction_function(z)

return correction

def compute(self, events):
result = np.zeros(len(events), self.dtype)
result["time"] = events["time"]
Expand Down

0 comments on commit 3d702d2

Please sign in to comment.