diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-08-09 19:56:06 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-08-09 19:56:06 (GMT) |
commit | 3325fa297dd7950589cf0b396eefc1ec18f8d6bb (patch) | |
tree | eb0aa8f45d21673896cfff91cfb22cd02ae695ab /ds9/library | |
parent | 542357f25773a2dcc869a236b9f86d7fb18692b2 (diff) | |
download | blt-3325fa297dd7950589cf0b396eefc1ec18f8d6bb.zip blt-3325fa297dd7950589cf0b396eefc1ec18f8d6bb.tar.gz blt-3325fa297dd7950589cf0b396eefc1ec18f8d6bb.tar.bz2 |
simplify wcs code
Diffstat (limited to 'ds9/library')
-rw-r--r-- | ds9/library/coord.tcl | 34 | ||||
-rw-r--r-- | ds9/library/info.tcl | 51 |
2 files changed, 40 insertions, 45 deletions
diff --git a/ds9/library/coord.tcl b/ds9/library/coord.tcl index 7e569c9..2d40cc0 100644 --- a/ds9/library/coord.tcl +++ b/ds9/library/coord.tcl @@ -108,51 +108,49 @@ proc DisplayCoordDialog {which x y} { global pcoord global wcs - set r {} + set rr {} if {$pcoord(filename)} { - append r "[$which get fits file name full]" + append rr "[$which get fits file name full]" } - foreach l {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { - if {"$pcoord(wcs$l)" && [$which has wcs "wcs$l"]} { - set cd "[$which get coordinates $x $y wcs$l $wcs(sky) $wcs(skyformat)]" - puts ":$cd:" - - if {[$which has wcs celestial "wcs$l"]} { - append r " [lindex $cd 0] [lindex $cd 1] $wcs(sky)" + foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { + if {"$pcoord(wcs$ll)" && [$which has wcs "wcs$ll"]} { + append rr " [$which get coordinates $x $y wcs$ll $wcs(sky) $wcs(skyformat)]" + if {[$which has wcs celestial "wcs$ll"]} { + append rr " $wcs(sky)" } else { - set name [$which get wcs name "wcs$l"] + set name [$which get wcs name "wcs$ll"] if {$name != {}} { - append r " [lindex $cd 0] [lindex $cd 1] $name" + append rr " $name" } else { - append r " [lindex $cd 0] [lindex $cd 1] [lindex $cd 3]" + append rr " wcs$ll" } } } } if {$pcoord(detector) && [$which has detector]} { - append r " [$which get coordinates $x $y detector] detector" + append rr " [$which get coordinates $x $y detector] detector" } if {$pcoord(amplifier) && [$which has amplifier]} { - append r " [$which get coordinates $x $y amplifier] amplifier" + append rr " [$which get coordinates $x $y amplifier] amplifier" } if {$pcoord(physical) && [$which has physical]} { - append r " [$which get coordinates $x $y physical] physical" + append rr " [$which get coordinates $x $y physical] physical" } if {$pcoord(image)} { - append r " [$which get coordinates $x $y image]" + append rr " [$which get coordinates $x $y image]" } if {$pcoord(value)} { - append r " [$which get value canvas $x $y]" + append rr " [$which get value canvas $x $y]" } - append r " \n" + append rr " \n" SimpleTextDialog coordtxt [msgcat::mc {Coordinates}] \ 80 20 append bottom "$r" diff --git a/ds9/library/info.tcl b/ds9/library/info.tcl index d44686a..405b13e 100644 --- a/ds9/library/info.tcl +++ b/ds9/library/info.tcl @@ -536,6 +536,7 @@ proc UpdateInfoBox {which x y sys} { global view $which get info $sys $x $y infobox + set infobox(bunit) [$which get fits header keyword BUNIT] if {$view(info,keyvalue) != ""} { set infobox(keyvalue) \ @@ -553,41 +554,37 @@ proc UpdateInfoBox {which x y sys} { foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} { if {$view(info,wcs$ll)} { - if {![$which has fits]} { - set infobox(wcs$ll,sys) "WCS $ll" - $infobox(wcs$ll,x,nm) configure -text {} - $infobox(wcs$ll,y,nm) configure -text {} - } elseif {[$which has wcs celestial wcs$ll]} { - switch -- $infobox(wcs$ll,sys) { - fk4 - - fk5 - - icrs { - $infobox(wcs$ll,x,nm) configure -text "\u03b1" \ + foreach aa {x y z} { + switch $infobox(wcs$ll,$aa,sys) { + RA { + $infobox(wcs$ll,$aa,nm) configure -text "\u03b1" \ -font "$ds9(times) $fsz" - $infobox(wcs$ll,y,nm) configure -text "\u03b4" \ + } + Dec { + $infobox(wcs$ll,$aa,nm) configure -text "\u03b4" \ -font "$ds9(times) $fsz" } - galactic { - $infobox(wcs$ll,x,nm) configure -text {l} \ - -font "{$ds9(times)} $pds9(font,size) normal italic" - $infobox(wcs$ll,y,nm) configure -text {b} \ - -font "{$ds9(times)} $pds9(font,size) normal italic" + l { + $infobox(wcs$ll,$aa,nm) configure -text {l} -font \ + "{$ds9(times)} $pds9(font,size) normal italic" + } + b { + $infobox(wcs$ll,$aa,nm) configure -text {b} -font \ + "{$ds9(times)} $pds9(font,size) normal italic" } - ecliptic { - $infobox(wcs$ll,x,nm) configure -text "\u03bb" \ + Lambda { + $infobox(wcs$ll,$aa,nm) configure -text "\u03bb" \ -font "$ds9(times) $fsz" - $infobox(wcs$ll,y,nm) configure -text "\u03b2" \ + } + Beta { + $infobox(wcs$ll,$aa,nm) configure -text "\u03b2" \ -font "$ds9(times) $fsz" } + default { + $infobox(wcs$ll,$aa,nm) configure \ + -text [string range $infobox(wcs$ll,$aa,sys) 0 0] + } } - } else { - if {$infobox(wcs$ll,sys) == {}} { - set infobox(wcs$ll,sys) "WCS $ll" - } - $infobox(wcs$ll,x,nm) configure -text {x} \ - -font "{$ds9(times)} $pds9(font,size) normal italic" - $infobox(wcs$ll,y,nm) configure -text {y} \ - -font "{$ds9(times)} $pds9(font,size) normal italic" } } } |