code needed for analysis of castor sensor data