diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-06-26 21:39:11 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-06-26 21:39:11 (GMT) |
commit | 327a5fa88f1a804b1d6febd300035c59e2b89826 (patch) | |
tree | 64f540b4ebad1d12a2afaa68b36ef72ffdb3c148 | |
parent | a5079a3966b735b970dd9b749ede013c1412ac48 (diff) | |
download | blt-327a5fa88f1a804b1d6febd300035c59e2b89826.zip blt-327a5fa88f1a804b1d6febd300035c59e2b89826.tar.gz blt-327a5fa88f1a804b1d6febd300035c59e2b89826.tar.bz2 |
more load regions logic
-rw-r--r-- | ds9/library/marker.tcl | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/ds9/library/marker.tcl b/ds9/library/marker.tcl index 317a1a7..519c937 100644 --- a/ds9/library/marker.tcl +++ b/ds9/library/marker.tcl @@ -1136,7 +1136,7 @@ proc MarkerLoadFile {filename which format sys sky} { set srcfilename $filename set filename [tmpnam [file ext [file rootname $filename]]] if {[catch {exec $app < $srcfilename > $filename} rr]} { - Error "[msgcat::mc {Unable to load compressed region file}]\n$rr" + Error "[msgcat::mc {Unable to load compressed region file}] $srcfilename\n$rr" return -code error } } @@ -1150,7 +1150,7 @@ proc MarkerLoadFile {filename which format sys sky} { } if {[catch {open $base} fd]} { - Error [msgcat::mc {Unable to load region file}] + Error "[msgcat::mc {Unable to load region file}] $filename" return -code error } @@ -1159,32 +1159,33 @@ proc MarkerLoadFile {filename which format sys sky} { # is it a fits file? if {$ll == "SIMPLE ="} { - # see if we need to add an extension - if {$ext == {}} { - set regfilename "$base\[REGION\]" - } + # ok, its fits + # try filename first + if {[catch {$which marker load fits "\{$filename\}" $marker(color) $marker(dashlist) $marker(width) "\{$marker(font) $marker(font,size) $marker(font,weight) $marker(font,slant)\}"}]} { - # open it - if {[catch {$which marker load fits "\{$regfilename\}" $marker(color) $marker(dashlist) $marker(width) "\{$marker(font) $marker(font,size) $marker(font,weight) $marker(font,slant)\}"}]} { + # see if we need to add an extension + # try [REGION] extension if {$ext == {}} { - # ok now try the first extension - set regfilename "$base\[1\]" + set regfilename "$base\[REGION\]" + if {[catch {$which marker load fits "\{$regfilename\}" $marker(color) $marker(dashlist) $marker(width) "\{$marker(font) $marker(font,size) $marker(font,weight) $marker(font,slant)\}"}]} { - Error [msgcat::mc {Unable to load region file}] - return -code error - } - # reset errors, we don't want to hear about it - InitError tcl + # ok now try the first extension + set regfilename "$base\[1\]" + if {[catch {$which marker load fits "\{$regfilename\}" $marker(color) $marker(dashlist) $marker(width) "\{$marker(font) $marker(font,size) $marker(font,weight) $marker(font,slant)\}"}]} { + Error "[msgcat::mc {Unable to load region file}] $filename" + return -code error + } + } } else { - Error [msgcat::mc {Unable to load region file}] + Error "[msgcat::mc {Unable to load region file}] $filename" return -code error } } } else { # no, its ascii if {[catch {$which marker load $format "\{$filename\}" $sys $sky}]} { - Error [msgcat::mc {Unable to load region file}] + Error "[msgcat::mc {Unable to load region file}] $filename" return -code error } } |