# vcresw -- Performs Resampling on one-dimensional data # # Description: # ------------ # This subroutine accepts the resampling parameters and interpolation # options requested, as well as the data window parameters, and does # the appropriate resampling. The parameters are assumed to have been # set by the calling routine to suitable default values if the assoc- # iated resampling option is not requested. This version of the subroutine # is the one with the window checking in the inner loop (somewhat # transparent as the checking is done in the W-subroutines called). # # Version Date Author Description # 28-JAN-1993 Ray WILLIAMSON Converted to SPP # 1 31-JUL-1983 PAT MURPHY Prolog Generation procedure vcresw (input, dim, resopt, rflopt, d, deg, mask, badpix, output, outdim) int dim[2], outdim[2], deg # Size of input image int i, rsign, npts, numerr # Local variables real input[1] # Input array to be resampled real mask[1] # and an associated data mask real output[1] # The actual output array real badpix # The fill value for outside window real x, size # Local variables double d[2] # (I) Coordinate transform coefficients int resopt # Resampling (interp) option int rflopt # Reflection option string nnb "Warning! Neighbor interpolation used on %d points\n" begin numerr = 0 npts = outdim[1] if(rflopt != 1) { # rflopt options # 1=none # 2=vertical # Set the sign to negative # and add the size of the array rsign = -1 size = float(npts+ 1) do i = 1, npts { x = rsign * (float(i) - size) call nnbvcw (input, dim[1], x, mask, badpix, output[i]) } # Not simple reflection } else { # Start the calculation. See which interpolation option is wanted. # Polynomial interpolation if (resopt == 2) { # For each element in vector do i = 1, npts { x = d[1] + d[2] * float(i) # Input parameters call plyvcw (input, dim[1], x, deg, mask, badpix, numerr, output[i]) } # } else if (resopt == 3) { # cubic spline interp. # # do i = 1, npts { # For each element in vector # # x = d[1] + d[2] * float(i) # # call splvecw (input, dim[1], x, deg, # Input parameters # MASK, BADPIX, # Window parameters # output[i]) # and result # # } # Nearest Neighbor is default } else { # For each element in the row do i = 1, npts { x = d[1] + d[2] * float(i) call nnbvcw (input, dim[1], x, mask, badpix, output[i]) } } } if (numerr != 0) { call eprintf(nnb) call pargi (numerr) } end