improved calibration header detection

"gray" area doesn't work very well with the calibration detection code