sectionmask
Purpose : construct the mask for the input data for use by rgdlength
Usage : amskin = mask(dataIn, positionIn, maskIn, missingValueIn, missingValueOut, flag2D)