From 90dbf7a5bbaa0e19e600b043a35dc2e9d0285706 Mon Sep 17 00:00:00 2001 From: William Joye Date: Fri, 4 Aug 2017 14:32:30 -0400 Subject: clean smooth --- tksao/frame/context.C | 4 +- tksao/frame/fitsanalysis.C | 112 ++++++++++++++++++++++++++++++++++++++++++- tksao/frame/fitsimage.h | 2 - tksao/util/smooth.C | 117 --------------------------------------------- tksao/util/smooth.h | 13 ----- 5 files changed, 112 insertions(+), 136 deletions(-) delete mode 100644 tksao/util/smooth.C delete mode 100644 tksao/util/smooth.h diff --git a/tksao/frame/context.C b/tksao/frame/context.C index 6dc234f..c7736c5 100644 --- a/tksao/frame/context.C +++ b/tksao/frame/context.C @@ -92,8 +92,8 @@ Context::Context() smoothFunction_ =GAUSSIAN; smoothRadius_ =3; smoothRadiusMinor_ =3; - smoothSigma_ =1; - smoothSigmaMinor_ =1; + smoothSigma_ =1.5; + smoothSigmaMinor_ =1.5; smoothAngle_ =0; thread_ =NULL; diff --git a/tksao/frame/fitsanalysis.C b/tksao/frame/fitsanalysis.C index b9c73e7..e895d9b 100644 --- a/tksao/frame/fitsanalysis.C +++ b/tksao/frame/fitsanalysis.C @@ -6,10 +6,13 @@ #include "fitsimage.h" #include "analysis.h" -#include "smooth.h" #include "context.h" -void* convolve(void* tt); +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) { @@ -106,6 +109,111 @@ 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 -using namespace std; - -#include - -#include "smooth.h" - -static void dumpKernel(double* kernel, int k); - -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