Note
Go to the end to download the full example code
How to use acceptance test module¶
The following example shows how to use the acceptance_test
class
to retrieve the interest parameter for the acceptance tests procdure.
import km3compass as kc
import matplotlib.pyplot as plt
import pandas as pd
Get some calibrated data¶
This is done quickly. Please take a look at the proper examples if you want details about that.
filename = "../tests/DOM_0801.csk"
reader = kc.readerCSK(filename)
calib = kc.calib_DB(reader, 817302522)
File loaded, 2508 rows
1 module(s)
- 817302522
Number of measurements after removing duplicates : 252
Starting a new calibration DB agent ...
Done in 4 seconds
DOM mac address : 08:00:30:b7:0b:fa
Apply acceptance tests routine¶
This routine will first correct the data from a possible miss-alignment between the xy plane, by ensuring that acceleration is orthogonal to xy data plane. Then, it will agregate the measurements per cardinal points using DBSCAN clustering algorithm. When it is done, we should have 4 clusters. For each of these, the average position is computed and will be used later to determine the residual in a polar coordinate system.
accept = kc.acceptance_test(calib, 817302522)
DBSCAN : 4 clusters found
- noise : 11 points
- cluster 0 : 66 points
- cluster 1 : 58 points
- cluster 2 : 56 points
- cluster 3 : 61 points
Display results from the test¶
Here we are using pandas to do a nice formating of the output:
print(pd.DataFrame(accept.residuals, index=[817302522]))
yaw module ID res 0 res 1 res 2 res 3
817302522 0.08961 817302522 -2.833734 2.752839 2.645777 -2.564882
Draw summary plot¶
This summary plot shows the data used in acceptance_test
:
accept.plot_results()
plt.show()
Total running time of the script: (0 minutes 5.531 seconds)