From f11ec933aa77ef7b53e584b4878438cd30a73bc4 Mon Sep 17 00:00:00 2001 From: William Joye Date: Thu, 14 Mar 2019 16:06:50 -0400 Subject: thread contour --- tksao/configure | 1 + tksao/configure.ac | 1 + tksao/frame/fitsanalysis.C | 112 +----------------------------------------- tksao/util/convolve.C | 118 +++++++++++++++++++++++++++++++++++++++++++++ tksao/util/convolve.h | 13 +++++ 5 files changed, 135 insertions(+), 110 deletions(-) create mode 100644 tksao/util/convolve.C create mode 100644 tksao/util/convolve.h diff --git a/tksao/configure b/tksao/configure index d9d5e50..59f3c04 100755 --- a/tksao/configure +++ b/tksao/configure @@ -5349,6 +5349,7 @@ panner/panner.C panner/pannertrue.C panner/parser.C util/attribute.C +util/convolve.C util/grf.C util/grf3d.C util/grid25dbase.C diff --git a/tksao/configure.ac b/tksao/configure.ac index a4735e4..507f7dd 100644 --- a/tksao/configure.ac +++ b/tksao/configure.ac @@ -252,6 +252,7 @@ panner/panner.C panner/pannertrue.C panner/parser.C util/attribute.C +util/convolve.C util/grf.C util/grf3d.C util/grid25dbase.C diff --git a/tksao/frame/fitsanalysis.C b/tksao/frame/fitsanalysis.C index 99e1e58..eb823b4 100644 --- a/tksao/frame/fitsanalysis.C +++ b/tksao/frame/fitsanalysis.C @@ -4,14 +4,11 @@ #include -#include "fitsimage.h" #include "analysis.h" +#include "fitsimage.h" #include "context.h" +#include "convolve.h" -static void boxcar(double* kernel, int r); -static void tophat(double* kernel, int r); -static void gaussian(double* kernel, int r, double sigma); -static void elliptic(double* kernel, int r, int m, double ss, double sm, double aa); static void* convolve(void* tt); void FitsImage::analysis(int which, pthread_t* thread, t_smooth_arg* targ) @@ -109,111 +106,6 @@ void FitsImage::smooth(pthread_t* thread, t_smooth_arg* targ) internalError("Unable to Create Thread"); } -static void boxcar(double* kernel, int k) -{ - int kk = 2*k+1; - int kk2 = kk*kk; - - 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 + +#include +#include +#include +using namespace std; + +#include "convolve.h" + +void boxcar(double* kernel, int k) +{ + int kk = 2*k+1; + int kk2 = kk*kk; + + 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