function to recalculate scaledDepthSD