diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2019-03-18 20:44:25 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2019-03-18 20:44:25 (GMT) |
commit | 67cd33932c3e3b4318b96b2901fd9e981852ca6b (patch) | |
tree | ac555bdd70db902405523445b9fcd4622d42dda3 /tksao/frame | |
parent | f46e1dda3f978677260638a056a6ad263e7260e3 (diff) | |
download | blt-67cd33932c3e3b4318b96b2901fd9e981852ca6b.zip blt-67cd33932c3e3b4318b96b2901fd9e981852ca6b.tar.gz blt-67cd33932c3e3b4318b96b2901fd9e981852ca6b.tar.bz2 |
thread contour
Diffstat (limited to 'tksao/frame')
-rw-r--r-- | tksao/frame/context.C | 6 | ||||
-rw-r--r-- | tksao/frame/fvcontour.C | 18 | ||||
-rw-r--r-- | tksao/frame/fvcontour.h | 2 |
3 files changed, 12 insertions, 14 deletions
diff --git a/tksao/frame/context.C b/tksao/frame/context.C index 4dc7abf..49fbc1c 100644 --- a/tksao/frame/context.C +++ b/tksao/frame/context.C @@ -408,8 +408,6 @@ void Context::contourCreateFV(const char* color, int width, int dash, if (targ[ii].lcl) delete targ[ii].lcl; - if (targ[ii].kernel) - delete [] targ[ii].kernel; if (targ[ii].src) delete [] targ[ii].src; if (targ[ii].dest) @@ -431,8 +429,6 @@ void Context::contourCreateFV(const char* color, int width, int dash, if (targ[ii].lcl) delete targ[ii].lcl; - if (targ[ii].kernel) - delete [] targ[ii].kernel; if (targ[ii].src) delete [] targ[ii].src; if (targ[ii].dest) @@ -2703,8 +2699,6 @@ void Context::updateContours() if (targ[0].lcl) delete targ[0].lcl; - if (targ[0].kernel) - delete [] targ[0].kernel; if (targ[0].src) delete [] targ[0].src; if (targ[0].dest) diff --git a/tksao/frame/fvcontour.C b/tksao/frame/fvcontour.C index e266f74..ab09d53 100644 --- a/tksao/frame/fvcontour.C +++ b/tksao/frame/fvcontour.C @@ -52,6 +52,7 @@ FVContour::FVContour() level_ =NULL; scale_ =NULL; + kernel_ =NULL; } FVContour::~FVContour() @@ -64,6 +65,9 @@ FVContour::~FVContour() if (scale_) delete scale_; + + if (kernel_) + delete [] kernel_; } void FVContour::create(Base* pp, FitsImage* fits, FrScale* fr, @@ -82,7 +86,6 @@ void FVContour::create(Base* pp, FitsImage* fits, FrScale* fr, method_ = mm; smooth_ = rr; numLevel_ = nn; - frScale_ = *fr; level_ = dupstr(ll); @@ -100,6 +103,11 @@ void FVContour::create(Base* pp, FitsImage* fits, FrScale* fr, } else buildScale(fits); + + // generate kernel + if (kernel_) + delete [] kernel_; + kernel_ = gaussian(smooth_-1, (smooth_-1)/2.); } void FVContour::buildScale(FitsImage* fits) @@ -289,13 +297,9 @@ void FVContour::smooth(FitsImage* fits, pthread_t* thread, void* targ) } CLEARSIGBUS - // generate kernel - int r = smooth_-1; - double* kernel = ::gaussian(r, r/2.); - // convolve t_fvcontour_arg* tt = (t_fvcontour_arg*)targ; - tt->kernel = kernel; + tt->kernel = kernel_; tt->src = src; tt->dest = dest; tt->xmin = params->xmin; @@ -304,7 +308,7 @@ void FVContour::smooth(FitsImage* fits, pthread_t* thread, void* targ) tt->ymax = params->ymax; tt->width = width; tt->height = height; - tt->r = r; + tt->r = smooth_-1; tt->mm = mm; tt->fv = this; tt->lcl = new List<ContourLevel>; diff --git a/tksao/frame/fvcontour.h b/tksao/frame/fvcontour.h index dcd6897..ff8555b 100644 --- a/tksao/frame/fvcontour.h +++ b/tksao/frame/fvcontour.h @@ -49,6 +49,7 @@ class FVContour { char* level_; InverseScale* scale_; + double* kernel_; void buildScale(FitsImage* fits); void unity(FitsImage*, pthread_t* thread, void* targ); @@ -59,7 +60,6 @@ public: FVContour(); ~FVContour(); - void create(Base*, FitsImage*, FrScale*, const char*, int, int, Method, int, int, |