diff --git a/amstrax/plugins/events/corrected_areas.py b/amstrax/plugins/events/corrected_areas.py index d1110906..28eb794d 100644 --- a/amstrax/plugins/events/corrected_areas.py +++ b/amstrax/plugins/events/corrected_areas.py @@ -22,7 +22,7 @@ class CorrectedAreas(strax.Plugin): """ - __version__ = "0.5.1" + __version__ = "0.6.0" depends_on = ("event_basics", "event_positions") @@ -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"]