From 781e8afc968a846179b6cd303bb05ddbc7ed944f Mon Sep 17 00:00:00 2001 From: William Joye Date: Fri, 28 Sep 2018 13:05:22 -0400 Subject: minor tweaks --- ds9/library/array.tcl | 7 ++++--- ds9/library/contour.tcl | 6 +----- ds9/library/cube.tcl | 4 ---- ds9/library/envi.tcl | 6 ++++-- ds9/library/fits.tcl | 2 -- ds9/library/marker.tcl | 46 +++++++++++++++++++++++++++++++++--------- ds9/library/mecube.tcl | 2 -- ds9/library/mosaicimagewcs.tcl | 2 -- ds9/library/mosaicwcs.tcl | 2 -- ds9/library/nrrd.tcl | 7 ++++--- ds9/library/photo.tcl | 7 ++++--- ds9/library/rgbarray.tcl | 7 ++++--- ds9/library/rgbcube.tcl | 7 ++++--- ds9/library/rgbimage.tcl | 19 ++++++++--------- ds9/library/util.tcl | 2 +- 15 files changed, 72 insertions(+), 54 deletions(-) diff --git a/ds9/library/array.tcl b/ds9/library/array.tcl index 6b02983..d56a233 100644 --- a/ds9/library/array.tcl +++ b/ds9/library/array.tcl @@ -47,10 +47,12 @@ proc ImportArraySocket {sock fn layer} { proc ExportArrayFile {fn opt} { global current - if {$fn == {} || $current(frame) == {}} { + if {$fn == {}} { + return + } + if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } @@ -64,7 +66,6 @@ proc ExportArraySocket {sock opt} { if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } diff --git a/ds9/library/contour.tcl b/ds9/library/contour.tcl index 887e881..e742b80 100644 --- a/ds9/library/contour.tcl +++ b/ds9/library/contour.tcl @@ -61,7 +61,6 @@ proc UpdateContour {} { if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } @@ -850,10 +849,9 @@ proc UpdateContourMenu {} { puts stderr "UpdateContourMenu" } - if {($current(frame) == {})} { + if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } @@ -885,7 +883,6 @@ proc UpdateContourScale {} { if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } @@ -935,7 +932,6 @@ proc UpdateContourDialog {} { if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } diff --git a/ds9/library/cube.tcl b/ds9/library/cube.tcl index 73e504c..7a0ebf4 100644 --- a/ds9/library/cube.tcl +++ b/ds9/library/cube.tcl @@ -247,7 +247,6 @@ proc CubeApply {} { if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } @@ -279,7 +278,6 @@ proc CubeApplyWCS {} { if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } @@ -798,7 +796,6 @@ proc CubeCmd {ss} { if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } @@ -821,7 +818,6 @@ proc CubeCmdCoord {ss sys sky} { if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } diff --git a/ds9/library/envi.tcl b/ds9/library/envi.tcl index 1f3d755..4425500 100644 --- a/ds9/library/envi.tcl +++ b/ds9/library/envi.tcl @@ -20,10 +20,12 @@ proc ImportENVIFile {hdr fn} { proc ExportENVIFile {hdr fn opt} { global current - if {$fn == {} || $current(frame) == {}} { + if {$fn == {}} { + return + } + if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } diff --git a/ds9/library/fits.tcl b/ds9/library/fits.tcl index fc125b1..69dfa43 100644 --- a/ds9/library/fits.tcl +++ b/ds9/library/fits.tcl @@ -77,7 +77,6 @@ proc SaveFitsFile {which fn} { if {$fn == {} || $current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } @@ -91,7 +90,6 @@ proc SaveFitsSocket {which sock} { if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } diff --git a/ds9/library/marker.tcl b/ds9/library/marker.tcl index 23d23e7..a618fd3 100644 --- a/ds9/library/marker.tcl +++ b/ds9/library/marker.tcl @@ -1076,7 +1076,6 @@ proc MarkerLoad {} { if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } @@ -1454,7 +1453,10 @@ proc RegionCmdLoad {} { global current global parse - if {$current(frame) == {} || ![$current(frame) has fits]} { + if {$current(frame) == {}} { + return + } + if {![$current(frame) has fits]} { return } @@ -1489,7 +1491,10 @@ proc RegionCmdSave {fn} { global marker global current - if {$current(frame) == {} || ![$current(frame) has fits]} { + if {$current(frame) == {}} { + return + } + if {![$current(frame) has fits]} { return } @@ -1502,7 +1507,10 @@ proc RegionCmdList {} { global marker global current - if {$current(frame) == {} || ![$current(frame) has fits]} { + if {$current(frame) == {}} { + return + } + if {![$current(frame) has fits]} { return } @@ -1515,7 +1523,10 @@ proc RegionCmdGroup {cmd {val1 {}} {val2 {}}} { global current global marker - if {$current(frame) == {} || ![$current(frame) has fits]} { + if {$current(frame) == {}} { + return + } + if {![$current(frame) has fits]} { return } @@ -1527,7 +1538,10 @@ proc RegionCmdGroupNew {} { global current global marker - if {$current(frame) == {} || ![$current(frame) has fits]} { + if {$current(frame) == {}} { + return + } + if {![$current(frame) has fits]} { return } @@ -1543,7 +1557,10 @@ proc RegionCmdGroupUpdate {} { global current global marker - if {$current(frame) == {} || ![$current(frame) has fits]} { + if {$current(frame) == {}} { + return + } + if {![$current(frame) has fits]} { return } @@ -1555,7 +1572,10 @@ proc RegionCmdGroupFont {value} { global current global marker - if {$current(frame) == {} || ![$current(frame) has fits]} { + if {$current(frame) == {}} { + return + } + if {![$current(frame) has fits]} { return } @@ -1577,7 +1597,10 @@ proc RegionCmdTemplateSave {fn} { global marker global current - if {$current(frame) == {} || ![$current(frame) has fits]} { + if {$current(frame) == {}} { + return + } + if {![$current(frame) has fits]} { return } @@ -1589,7 +1612,10 @@ proc RegionCmdCommand {cmd} { global marker global current - if {$current(frame) == {} || ![$current(frame) has fits]} { + if {$current(frame) == {}} { + return + } + if {![$current(frame) has fits]} { return } diff --git a/ds9/library/mecube.tcl b/ds9/library/mecube.tcl index a052ab9..2c21cc2 100644 --- a/ds9/library/mecube.tcl +++ b/ds9/library/mecube.tcl @@ -55,7 +55,6 @@ proc SaveMECubeFile {fn} { if {$fn == {} || $current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } @@ -69,7 +68,6 @@ proc SaveMECubeSocket {sock} { if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } diff --git a/ds9/library/mosaicimagewcs.tcl b/ds9/library/mosaicimagewcs.tcl index a543fa8..a4e559d 100644 --- a/ds9/library/mosaicimagewcs.tcl +++ b/ds9/library/mosaicimagewcs.tcl @@ -49,7 +49,6 @@ proc SaveMosaicImageWCSFile {fn} { if {$fn == {} || $current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } @@ -63,7 +62,6 @@ proc SaveMosaicImageWCSSocket {sock} { if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } diff --git a/ds9/library/mosaicwcs.tcl b/ds9/library/mosaicwcs.tcl index d46b6dc..58ebf6d 100644 --- a/ds9/library/mosaicwcs.tcl +++ b/ds9/library/mosaicwcs.tcl @@ -49,7 +49,6 @@ proc SaveMosaicWCSFile {fn opt} { if {$fn == {} || $current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } @@ -67,7 +66,6 @@ proc SaveMosaicWCSSocket {sock opt} { if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } diff --git a/ds9/library/nrrd.tcl b/ds9/library/nrrd.tcl index 8307b53..e324647 100644 --- a/ds9/library/nrrd.tcl +++ b/ds9/library/nrrd.tcl @@ -55,10 +55,12 @@ proc ImportNRRDSocket {sock fn layer} { proc ExportNRRDFile {fn opt} { global current - if {$fn == {} || $current(frame) == {}} { + if {$fn == {}} { + return + } + if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } @@ -72,7 +74,6 @@ proc ExportNRRDSocket {sock opt} { if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } diff --git a/ds9/library/photo.tcl b/ds9/library/photo.tcl index ad3f7eb..aeb02f5 100644 --- a/ds9/library/photo.tcl +++ b/ds9/library/photo.tcl @@ -89,10 +89,12 @@ proc ExportPhotoFile {fn format opt} { global export global current - if {$fn == {} || $current(frame) == {}} { + if {$fn == {}} { + return + } + if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } @@ -132,7 +134,6 @@ proc ExportPhotoSocket {ch format opt} { if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } diff --git a/ds9/library/rgbarray.tcl b/ds9/library/rgbarray.tcl index 74239df..2f40d0a 100644 --- a/ds9/library/rgbarray.tcl +++ b/ds9/library/rgbarray.tcl @@ -98,10 +98,12 @@ proc ImportRGBArraySocket {sock fn} { proc ExportRGBArrayFile {fn opt} { global current - if {$fn == {} || $current(frame) == {}} { + if {$fn == {}} { + return + } + if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } @@ -115,7 +117,6 @@ proc ExportRGBArraySocket {sock opt} { if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } diff --git a/ds9/library/rgbcube.tcl b/ds9/library/rgbcube.tcl index 6bd3789..572bcc8 100644 --- a/ds9/library/rgbcube.tcl +++ b/ds9/library/rgbcube.tcl @@ -82,10 +82,12 @@ proc LoadRGBCubeSocket {sock fn} { proc SaveRGBCubeFile {fn} { global current - if {$fn == {} || $current(frame) == {}} { + if {$fn == {}} { + return + } + if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } @@ -99,7 +101,6 @@ proc SaveRGBCubeSocket {sock} { if {$current(frame) == {}} { return } - if {![$current(frame) has fits]} { return } diff --git a/ds9/library/rgbimage.tcl b/ds9/library/rgbimage.tcl index 460b556..d740985 100644 --- a/ds9/library/rgbimage.tcl +++ b/ds9/library/rgbimage.tcl @@ -82,7 +82,13 @@ proc LoadRGBImageSocket {sock fn} { proc SaveRGBImageFile {fn} { global current - if {$fn == {} || $current(frame) == {}} { + if {$fn == {}} { + return + } + if {$current(frame) == {}} { + return + } + if {![$current(frame) has fits]} { return } @@ -95,10 +101,6 @@ proc SaveRGBImageFile {fn} { rgb {} } - if {![$current(frame) has fits]} { - return - } - $current(frame) save fits rgb image file "\{$fn\}" } @@ -108,6 +110,9 @@ proc SaveRGBImageSocket {sock} { if {$current(frame) == {}} { return } + if {![$current(frame) has fits]} { + return + } switch -- [$current(frame) get type] { base - @@ -118,10 +123,6 @@ proc SaveRGBImageSocket {sock} { rgb {} } - if {![$current(frame) has fits]} { - return - } - $current(frame) save fits rgb image socket $sock } diff --git a/ds9/library/util.tcl b/ds9/library/util.tcl index 349aad3..b1af02c 100644 --- a/ds9/library/util.tcl +++ b/ds9/library/util.tcl @@ -393,7 +393,7 @@ proc ProcessSendCmdSend {ext cmd} { global parse global current - if {$current(frame) == {}} { + if {$current(frame) != {}} { ProcessSend $parse(proc) $parse(id) $parse(sock) $parse(fn) \ $ext [$current(frame) $cmd] } -- cgit v0.12