summaryrefslogtreecommitdiffstats
path: root/tksao/frame
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-04-19 20:50:25 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-04-19 20:50:25 (GMT)
commit382abeffcc61ef20a0288c52b09142db3cf3585e (patch)
treefc95bb1fe410ab06e7b814ef5e12eb4940b4cb99 /tksao/frame
parent0b68ff6e5ae4dccbd9e2141ae65984b8271a5940 (diff)
downloadblt-382abeffcc61ef20a0288c52b09142db3cf3585e.zip
blt-382abeffcc61ef20a0288c52b09142db3cf3585e.tar.gz
blt-382abeffcc61ef20a0288c52b09142db3cf3585e.tar.bz2
enhance graphs
Diffstat (limited to 'tksao/frame')
-rw-r--r--tksao/frame/basecommand.C12
-rw-r--r--tksao/frame/frblt.C46
2 files changed, 35 insertions, 23 deletions
diff --git a/tksao/frame/basecommand.C b/tksao/frame/basecommand.C
index 8ba3aac..7fd1d6e 100644
--- a/tksao/frame/basecommand.C
+++ b/tksao/frame/basecommand.C
@@ -1855,11 +1855,7 @@ void Base::getHorzCutCmd(char* xx, char* yy, const Vector& vv,
Coord::InternalSystem ref,
int thick, Base::CutMethod method)
{
- Vector rr;
- if (isInCFits(vv, ref, &rr))
- bltCut(xx, yy, Coord::XX, rr, thick, method);
- else
- result = TCL_ERROR;
+ bltCut(xx, yy, Coord::XX, mapToRef(vv,ref), thick, method);
}
void Base::getInfoCmd(char* var)
@@ -2205,11 +2201,7 @@ void Base::getVertCutCmd(char* xx, char* yy, const Vector& vv,
Coord::InternalSystem ref,
int thick, Base::CutMethod method)
{
- Vector rr;
- if (isInCFits(vv, ref, &rr))
- bltCut(xx, yy, Coord::YY, rr, thick, method);
- else
- result = TCL_ERROR;
+ bltCut(xx, yy, Coord::YY, mapToRef(vv,ref), thick, method);
}
void Base::getWCSCmd()
diff --git a/tksao/frame/frblt.C b/tksao/frame/frblt.C
index 628c6ab..3a5f541 100644
--- a/tksao/frame/frblt.C
+++ b/tksao/frame/frblt.C
@@ -970,8 +970,11 @@ void Base::bltCutFits(double* xx, double* yy, int size, Coord::Orientation axis,
const Vector& r, int thick, Base::CutMethod method)
{
Vector rr = r * refToWidget;
- FitsImage* ptr = currentContext->cfits;
- FitsBound* params = ptr->getDataParams(currentContext->secMode());
+
+ FitsImage* sptr = currentContext->cfits;
+ FitsBound* params = sptr->getDataParams(currentContext->secMode());
+
+ int mosaic = isMosaic();
double prev = currentContext->low();
// main loop
@@ -982,22 +985,39 @@ void Base::bltCutFits(double* xx, double* yy, int size, Coord::Orientation axis,
int cnt =0;
Vector img;
+ int ww = thick/2;
for (int jj=0; jj<thick; jj++) {
- int ww = jj/2;
- if (axis == Coord::XX)
- img = Vector(1+ii,rr[1]-ww+jj) * ptr->widgetToData;
- else
- img = Vector(rr[0]-ww+jj,1+ii) * ptr->widgetToData;
- if (img[0]>=params->xmin && img[0]<params->xmax &&
- img[1]>=params->ymin && img[1]<params->ymax) {
- double value = ptr->getValueDouble(img);
+ if (mosaic) {
+ sptr = currentContext->cfits;
+ params = sptr->getDataParams(currentContext->secMode());
+ }
+
+ do {
+ if (axis == Coord::XX)
+ img = Vector(1+ii,rr[1]-ww+jj) * sptr->widgetToData;
+ else
+ img = Vector(rr[0]-ww+jj,1+ii) * sptr->widgetToData;
+
+ if (img[0]>=params->xmin && img[0]<params->xmax &&
+ img[1]>=params->ymin && img[1]<params->ymax) {
+ double value = sptr->getValueDouble(img);
- if (isfinite(value)) {
- vv += value;
- cnt +=1;
+ if (isfinite(value)) {
+ vv += value;
+ cnt +=1;
+ }
+ break;
+ }
+ else {
+ if (mosaic) {
+ sptr = sptr->nextMosaic();
+ if (sptr)
+ params = sptr->getDataParams(currentContext->secMode());
+ }
}
}
+ while (mosaic && sptr);
}
xx[2*ii] = ii;