Mon, 21 Oct 2019 15:07:48 +0300
Simplistic first signal bin correction when calculating range-corrected signal for plotting.
atmospheric_lidar/generic.py | file | annotate | diff | comparison | revisions |
--- a/atmospheric_lidar/generic.py Fri May 31 14:52:42 2019 +0300 +++ b/atmospheric_lidar/generic.py Mon Oct 21 15:07:48 2019 +0300 @@ -712,7 +712,7 @@ duration = np.array(durations) return duration - def calculate_rc(self, idx_min=-2000, idx_max=-500): + def calculate_rc(self, idx_min=-2000, idx_max=-500, first_signal_bin=0): """ Calculate range corrected signal. The background signal is estimated as the mean signal between idx_min and idx_max. @@ -725,9 +725,14 @@ Minimum index to calculate background signal. idx_max : int Maximum index to calculate background signal. + first_signal_bin : int + First bin with useful signal. Positive integer. """ background = np.mean(self.matrix[:, idx_min:idx_max], axis=1) - self.rc = (self.matrix.transpose() - background).transpose() * (self.z ** 2) + background_corrected = (self.matrix.transpose() - background).transpose() + background_corrected = np.roll(background_corrected, -first_signal_bin, axis=1) + background_corrected[:, -9:] = 0 + self.rc = background_corrected * (self.z ** 2) def noise_mask(self, idx_min=-2000, idx_max=-500, threshold=1.): """ Calculate points that are probably noise.