new: pulse center of gravity
This commit is contained in:
@@ -122,6 +122,11 @@ class Spectrum(np.ndarray):
|
||||
return self.l[np.argmax(self.wl_int, axis=-1)]
|
||||
return np.array([s.wl_max for s in self])
|
||||
|
||||
@property
|
||||
def center_of_gravity(self):
|
||||
intensity = self.time_int
|
||||
return np.sum(intensity * self.t) / np.sum(intensity)
|
||||
|
||||
def mask_wl(self, pos: float, width: float) -> Spectrum:
|
||||
"""
|
||||
Filters the spectrum with a bandpass centered at `pos` of FWHM `width`.
|
||||
|
||||
Reference in New Issue
Block a user