calibration (and other) updates
This includes a few updates for calibration.
- We attempt to address any issues associated with memory consumption by making sure we define arrays outside of loops instead of re-allocating memory with each epoch. It turns out that this was not the limitting factor in memory requirements.
- We also implement a DiscreteCalibrationMap, which makes different assumptions about the underlying distributions from which ranks are drawn. Fixes #85 (closed).
Summary of Changes
-
idq/calibration.py
- implemented DiscreteCalibrationMap and Discrete1DKDE, which assume the underlying distribution has support that is "a set of measure zero" (a weighted sum of delta functions). Should be useful for things like OVL
- Discrete1DKDE wraps around a few defaultdict's and exposes the same main methods as FixedBandwidth1DKDE. This means that DiscreteCalibrationMap can inherit most functions from CalibrationMap and we only have to overwrite a small subset.
- added a "coverage" method for KDE objects, which computes the nominal and observed cumulative distributions and returns them so the user can check for consistency
- declared many arrays outside of loops and re-use them within the loops to avoid re-allocating memory within each epoch
- a bit of misc cleanup
- implemented DiscreteCalibrationMap and Discrete1DKDE, which assume the underlying distribution has support that is "a set of measure zero" (a weighted sum of delta functions). Should be useful for things like OVL
-
idq/classifiers/base.py
- added a conditional so that classifiers can use either CalibrationMap or DiscreteCalibrationMap based on an INI option
-
idq/classifiers/ovl.py
- fixed an inconsistency in how DOVL.evaluate assigned ranks to vectors. This is now consistent with DOVL.timeseries and the "correct" thing to do (ie, use the "rank" column which is guaranteed to decrease monotonically as you iterate through the vetolist and therefore does tell you how you should order events according to the vetolist).
-
idq/io.py
- added calls to utils.segments_intersection within KW ClassifierData objects to make sure we only request triggers that are within the segments we care about.
- updated CalibrationMapReporter so it is smart enough to know how to read/write both CalibrationMap and DiscreteCalibrationMap
- some misc cleanup
-
idq/plots.py
- expanded an error statement to make it clearer what the issue was
- changed how calibration distributions are plotted to support DiscreteCalibrationMaps in addition to CalibrationMaps (could still be improve a bit, though).
Edited by Reed Essick