median Computes a median value from many samples

median.py

A Sat/XLink setup is associated with this module: median_setup.txt

The setup requires that one measurement be setup to collect samples from the sensor (e.g. every 5 seconds). It gets connected to the one_sample script function. It does not get logged. Instead, the samples get stored in temporary memory. A second measurement is setup to compute the median. It is a manual entry measurement (it does not sample the sensor). It should happen less frequently than the first measurement (e.g. every hour). It is logged and may be transmitted.

median.compute_median(numbers_list)

computes median on numbers in list

median.median_meas(ignored)

computes the median over the collected samples

median.one_sample(value)

adds a sample to the list for later computation

median.test_median()

test that the median is computed correctly