added error cases for mass offset and resolution in calibrate.m