From 31a570efb6179e84e2f79cc0ed838865e15c31ec Mon Sep 17 00:00:00 2001 From: William Joye Date: Thu, 23 Aug 2018 16:08:44 -0400 Subject: region plot2d now extends across mosaic boundries --- ds9/doc/release/r8.0.html | 1 + tksao/frame/frblt.C | 78 +++++++++++++++++++++++++---------------------- 2 files changed, 42 insertions(+), 37 deletions(-) diff --git a/ds9/doc/release/r8.0.html b/ds9/doc/release/r8.0.html index cb38e28..23e2ace 100644 --- a/ds9/doc/release/r8.0.html +++ b/ds9/doc/release/r8.0.html @@ -34,6 +34,7 @@
  • 08.22.2018 WCS: reimplemented all wcs support based on AST.
  • 08.22.2018 CUBE: plot3d current slice is coordinated with cube dialog box.
  • 08.22.2018 BIN: fixed a problem in the case of a RGB image has a binned layer, changing bin parameters in other layers caused cursor movement.
  • +
  • 08.22.2018 REGION: plot2d now extends across mosaic boundries.
  • 09.03.2018 RELEASE version 8.0rc
  • diff --git a/tksao/frame/frblt.C b/tksao/frame/frblt.C index 17361f4..2e99d5e 100644 --- a/tksao/frame/frblt.C +++ b/tksao/frame/frblt.C @@ -116,17 +116,10 @@ int Base::markerAnalysisPlot2d(Marker* pp, double** x, double** y, Coord::CoordSystem sys, Coord::SkyFrame sky, Marker::AnalysisMethod method) { - // does not extend across mosaic boundries - // uses currentContext - FitsImage* ptr = isInCFits(pp->getCenter(),Coord::REF,NULL); - if (!ptr) - ptr = currentContext->cfits; - - FitsBound* params = ptr->getDataParams(currentContext->secMode()); - - Vector vv = p2-p1; + Vector vv = p2-p1; int num = vv.length() +1; - Vector s = vv.normalize(); + Vector ss = vv.normalize(); + Vector uu = Vector(-ss[1],ss[0]); int cnt[num]; *x = (double*)malloc(num*sizeof(double)); @@ -134,52 +127,65 @@ int Base::markerAnalysisPlot2d(Marker* pp, double** x, double** y, *xc = (double*)malloc(num*sizeof(double)); *yc = (double*)malloc(num*sizeof(double)); + int mosaic = isMosaic(); + FitsImage* sptr = currentContext->cfits; + FitsBound* params = sptr->getDataParams(currentContext->secMode()); + + if (width==0) + width =1; + // main loop SETSIGBUS - for (long ii=0; iimapFromRef(t, sys, sky); - (*xc)[ii] = tv[0]; - (*yc)[ii] = tv[1]; + for (int jj=0; jjrefToData; - - if (z[0]>=params->xmin && z[0]xmax && - z[1]>=params->ymin && z[1]ymax) { - - // check for nan - double v = ptr->getValueDouble(z); - if (isfinite(v)) { - (*y)[ii] = v; - cnt[ii] = 1; + if (mosaic) { + sptr = currentContext->cfits; + params = sptr->getDataParams(currentContext->secMode()); } - Vector ss = Vector(-s[1],s[0]); - - for (long jj=1; jjrefToData; - + do { + Vector zz = tt * sptr->refToData; if (zz[0]>=params->xmin && zz[0]xmax && zz[1]>=params->ymin && zz[1]ymax) { - double vvalue = ptr->getValueDouble(zz); + if (!found) { + Vector tv = sptr->mapFromRef(tt, sys, sky); + (*xc)[ii] = tv[0]; + (*yc)[ii] = tv[1]; + found =1; + } + // check for nan - if (isfinite(vvalue)) { - (*y)[ii] += vvalue; + double dd = sptr->getValueDouble(zz); + if (isfinite(dd)) { + (*y)[ii] += dd; cnt[ii]++; } + break; + } + else { + if (mosaic) { + sptr = sptr->nextMosaic(); + if (sptr) + params = sptr->getDataParams(currentContext->secMode()); + } } } + while (mosaic && sptr); } } + CLEARSIGBUS // average if needed if (method == Marker::AVERAGE) @@ -187,8 +193,6 @@ int Base::markerAnalysisPlot2d(Marker* pp, double** x, double** y, if (isfinite((*y)[ii]) && cnt[ii]!=0) (*y)[ii] /= cnt[ii]; - CLEARSIGBUS - return num; } -- cgit v0.12