adapt callSGBM.sh and rectification_std to handle images with nans