You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ExposureBins and TimeEnergyBins calculate "good segments," which are contiguous segments of data separated by bad time intervals (typically no data). This is determined by comparing the high edge of a bin to the low edge of the next bin, and if they are not the same, then the end of the good segment is declared, and a new segment starts. The implementation in ExposureBins, for example, is
mask = (self.lo_edges[1:] != self.hi_edges[:-1])
There are cases when self.lo_edges[1:] and self.hi_edges[:-1] are slightly different, usually by rounding/numerical precision limitations, especially on older files that use 32-bit floats. This causes an incorrect segmentation of the data. An improvement is to implement a tolerance:
mask = np.abs(self.lo_edges[1:] - self.hi_edges[:-1]) > tol
where tol is the tolerance in seconds allowed. As an example, tol=1e-4 is sufficient for BATSE continuous data.
The keyword option of tol could either be added as an option to the _calculate_good_segments() method and passed via an option in the initializer, or have the initializer set a private tolerance variable and _calculate_good_segments() uses that private variable.
The text was updated successfully, but these errors were encountered:
ExposureBins
andTimeEnergyBins
calculate "good segments," which are contiguous segments of data separated by bad time intervals (typically no data). This is determined by comparing the high edge of a bin to the low edge of the next bin, and if they are not the same, then the end of the good segment is declared, and a new segment starts. The implementation in ExposureBins, for example, ismask = (self.lo_edges[1:] != self.hi_edges[:-1])
There are cases when
self.lo_edges[1:]
andself.hi_edges[:-1]
are slightly different, usually by rounding/numerical precision limitations, especially on older files that use 32-bit floats. This causes an incorrect segmentation of the data. An improvement is to implement a tolerance:mask = np.abs(self.lo_edges[1:] - self.hi_edges[:-1]) > tol
where
tol
is the tolerance in seconds allowed. As an example,tol=1e-4
is sufficient for BATSE continuous data.The keyword option of
tol
could either be added as an option to the_calculate_good_segments()
method and passed via an option in the initializer, or have the initializer set a private tolerance variable and_calculate_good_segments()
uses that private variable.The text was updated successfully, but these errors were encountered: