#pragma TextEncoding = "Windows-1252" #pragma rtGlobals=3 // Use modern global access method and strict wave access. function maskdata(data, lat, latmasklow, latmaskhigh, long, longmasklow, longmaskhigh) wave data, lat, long variable latmaskhigh, latmasklow, longmaskhigh, longmasklow variable index variable maskavg Make/o/d/n=(dimsize(data,0)) maskeddata=1 for (index=0; index= latmasklow && lat[index]<=latmaskhigh) if (lat[index]>= long[index]>=longmasklow && long[index]<=longmaskhigh) maskeddata[index] = data[index] else maskeddata[index]= nan endif else maskeddata[index]= nan endif endfor //wavestats maskeddata //maskavg = v_avg end