// Copyright (C) 1999-2019 // Smithsonian Astrophysical Observatory, Cambridge, MA, USA // For conditions of distribution and use, see copyright notice in "copyright" #include #include #include #include #include using namespace std; #include "convolve.h" double* boxcar(int k) { int kk = 2*k+1; int kk2 = kk*kk; double* kernel = new double[kk*kk]; memset(kernel, 0, kk*kk*sizeof(double)); for (int yy=-k; yy<=k; yy++) for (int xx=-k; xx<=k; xx++) kernel[(yy+k)*kk+(xx+k)] = 1; // normalize kernel for (int ii=0; ii