Routine to estimate sky value and sigma