nobs = 0
nobs = nobs + int(bpmask(i,j,bi,bj))
integer nobs
nobs = nobs + int(scatxmask(i,j,bi,bj))
if (nobs .gt. 0) then
vartile = vartile/float(nobs)
nobs = nobs + int(scatymask(i,j,bi,bj))