summaryrefslogtreecommitdiffstats
path: root/ds9
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2019-07-20 16:26:15 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2019-07-20 16:26:15 (GMT)
commitadb973c50dc205454719923e48eb6bd484d86847 (patch)
treeea4a27700c6e0fbb4a8b6b41c5528ca31f065328 /ds9
parenta1bd2ebf24593fca48a94a212e61bce0f19ebf63 (diff)
downloadblt-adb973c50dc205454719923e48eb6bd484d86847.zip
blt-adb973c50dc205454719923e48eb6bd484d86847.tar.gz
blt-adb973c50dc205454719923e48eb6bd484d86847.tar.bz2
support multiple graphs per plot
Diffstat (limited to 'ds9')
-rw-r--r--ds9/library/markeranalysisplot3d.tcl117
-rw-r--r--ds9/library/markeranalysisradial.tcl1
2 files changed, 62 insertions, 56 deletions
diff --git a/ds9/library/markeranalysisplot3d.tcl b/ds9/library/markeranalysisplot3d.tcl
index e854776..ea80c66 100644
--- a/ds9/library/markeranalysisplot3d.tcl
+++ b/ds9/library/markeranalysisplot3d.tcl
@@ -153,16 +153,20 @@ proc MarkerAnalysisPlot3dCB {frame id} {
set ydata ${vvarname}yy
global $xdata $ydata
- set ping [PlotPing $vvarname]
-
- if {!$ping} {
- set tt [string totitle [$frame get marker $id type]]
+ if {[info command $xdata] == {}} {
+ blt::vector create $xdata $ydata
+ }
+ $frame get marker $id analysis plot3d $xdata $ydata \
+ $vvar(system) $vvar(sky) $vvar(method)
+
+ if {![PlotPing $vvarname]} {
set vvar(bunit) [string trim [$frame get fits header keyword BUNIT]]
if {$vvar(bunit)=={}} {
set vvar(bunit) {Counts}
}
- PlotLineDialog $vvarname $tt
+ PlotLineDialog $vvarname [string totitle [$frame get marker $id type]]
PlotTitle $vvarname {} $vvar(system) $vvar(bunit)
+
MarkerAnalysisPlot3dXAxisTitle $vvarname
MarkerAnalysisPlot3dYAxisTitle $vvarname
@@ -178,51 +182,32 @@ proc MarkerAnalysisPlot3dCB {frame id} {
set vvar(graph,ds,xdata) $xdata
set vvar(graph,ds,ydata) $ydata
- blt::vector create $xdata $ydata
+ PlotExternal $vvarname xy
}
- $frame get marker $id analysis plot3d $xdata $ydata \
- $vvar(system) $vvar(sky) $vvar(method)
-
set vvar(slice) [$frame get fits slice from image $vvar(system) $vvar(sky)]
MarkerAnalysisPlot3dMarker $vvarname
- if {!$ping} {
- PlotExternal $vvarname xy
- }
-
PlotStats $vvarname
PlotList $vvarname
}
-proc MarkerAnalysisPlot3dMotion {vvarname xx yy} {
- upvar #0 $vvarname vvar
- global $vvarname
-
- if {$vvar(mode) != "pointer"} {
- return
- }
-
- set vvar(slice) [lindex [$vvar(graph) invtransform $xx $yy] 0]
- $vvar(frame) update fits slice $vvar(slice) $vvar(system) $vvar(sky)
- MarkerAnalysisPlot3dMarker $vvarname
+# hardcoded marker.C
+proc MarkerAnalysisPlot3dDeleteCB {frame id} {
+ # this routine could be called by the region
+ # after the dialog has been deleted
- # current frame only
- global current
- if {$vvar(frame) == $current(frame)} {
- UpdateCubeMotionDialog
- UpdateScaleDialog
- UpdateContourScale
- UpdateContourDialog
- }
-}
+ global imarker
-proc MarkerAnalysisPlot3dMarker {vvarname} {
+ set vvarname ${imarker(prefix,plot3d)}${id}${frame}
upvar #0 $vvarname vvar
global $vvarname
- $vvar(graph) marker configure $vvar(markerslice) \
- -coords "$vvar(slice) -Inf $vvar(slice) Inf"
+ # clear any errors
+ global errorInfo
+ set errorInfo {}
+
+ PlotDestroy $vvarname
}
# hardcoded marker.C
@@ -243,22 +228,40 @@ proc MarkerAnalysisPlot3dSliceCB {frame id} {
}
}
-# hardcoded marker.C
-proc MarkerAnalysisPlot3dDeleteCB {frame id} {
- # this routine could be called by the region
- # after the dialog has been deleted
+proc MarkerAnalysisPlot3dMotion {vvarname xx yy} {
+ upvar #0 $vvarname vvar
+ global $vvarname
- global imarker
+ if {$vvar(mode) != "pointer"} {
+ return
+ }
- set vvarname ${imarker(prefix,plot3d)}${id}${frame}
+ set cc 1
+ if {[info exists vvar($cc,graph)]} {
+ set vvar(slice) [lindex [$vvar($cc,graph) invtransform $xx $yy] 0]
+ $vvar(frame) update fits slice $vvar(slice) $vvar(system) $vvar(sky)
+ MarkerAnalysisPlot3dMarker $vvarname
+ }
+
+ # current frame only
+ global current
+ if {$vvar(frame) == $current(frame)} {
+ UpdateCubeMotionDialog
+ UpdateScaleDialog
+ UpdateContourScale
+ UpdateContourDialog
+ }
+}
+
+proc MarkerAnalysisPlot3dMarker {vvarname} {
upvar #0 $vvarname vvar
global $vvarname
- # clear any errors
- global errorInfo
- set errorInfo {}
-
- PlotDestroy $vvarname
+ set cc 1
+ if {[info exists vvar($cc,graph)]} {
+ $vvar($cc,graph) marker configure $vvar(markerslice) \
+ -coords "$vvar(slice) -Inf $vvar(slice) Inf"
+ }
}
proc MarkerAnalysisPlot3dXAxisTitle {vvarname} {
@@ -281,20 +284,22 @@ proc MarkerAnalysisPlot3dXAxisTitle {vvarname} {
}
}
- # set for plot code
- set vvar(graph,axis,x,title) $xtitle
-
- # update now (may not make it into plot code)
- $vvar(graph) xaxis configure -title $xtitle
+ set cc 1
+ if {[info exists vvar($cc,graph)]} {
+ set vvar($cc,axis,x,title) $xtitle
+ $vvar($cc,graph) xaxis configure -title $xtitle
+ }
}
proc MarkerAnalysisPlot3dYAxisTitle {vvarname} {
upvar #0 $vvarname vvar
global $vvarname
- # set for plot code
- set vvar(graph,axis,y,title) "$vvar(bunit) [string totitle $vvar(method)]"
+ set ytitle "$vvar(bunit) [string totitle $vvar(method)]"
- # update now (may not make it into plot code)
- $vvar(graph) yaxis configure -title $vvar(graph,axis,y,title)
+ set cc 1
+ if {[info exists vvar($cc,graph)]} {
+ set vvar($cc,axis,y,title) $ytitle
+ $vvar($cc,graph) yaxis configure -title $vvar(graph,axis,y,title)
+ }
}
diff --git a/ds9/library/markeranalysisradial.tcl b/ds9/library/markeranalysisradial.tcl
index 664250d..1c13a35 100644
--- a/ds9/library/markeranalysisradial.tcl
+++ b/ds9/library/markeranalysisradial.tcl
@@ -121,6 +121,7 @@ proc MarkerAnalysisRadialCB {frame id} {
PlotList $vvarname
}
+# hardcoded marker.C
proc MarkerAnalysisRadialDeleteCB {frame id} {
# this routine could be called by the region
# after the dialog has been deleted