# innbvcw -- Interpolation using nearest neighbor pixel of input data window # # Description: # ------------ # This routine cal# lates the nearest neighbor in the input data window, # given the position of the output pixel in the reference frame of the # input array. # # Version Date Author Description # 27-JAN-1993 RAY WILLIAMSON Port to STSDAS # 2 1-AUG-1983 PAT MURPHY Add PDL and FORTRAN code # 1 1-AUG-1983 PAT MURPHY Prolog Generation procedure nnbvcw ( input, dim, coord, wndo, badpix,result) int dim,i # Size of input and local loop variable real input[dim] # The input vector real wndo[dim] # Window flag and mask real coord, badpix # Location in input and fill value real result # The result of the interpolation begin # Assume point is outside window result = badpix # Get nearest neighbor i = int( .5 + coord) if (i >= 1 && i <= dim) { if (wndo[i] == 0.0) result = input[i] } end