Calibration code for Timepix assemblies