diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-03-16 22:13:26 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-03-16 22:13:26 (GMT) |
commit | 4b906e8fc8b90fef6800ed700fbf4d6c9ea0dd7c (patch) | |
tree | ee8c1433f6f3b7baf0a94af6a65a8d24596c35b8 | |
parent | f6362e12a6c080c84c2f102ad5dc44e2fb63357a (diff) | |
download | blt-4b906e8fc8b90fef6800ed700fbf4d6c9ea0dd7c.zip blt-4b906e8fc8b90fef6800ed700fbf4d6c9ea0dd7c.tar.gz blt-4b906e8fc8b90fef6800ed700fbf4d6c9ea0dd7c.tar.bz2 |
update ds9 contour parser
-rw-r--r-- | ds9/library/contour.tcl | 42 | ||||
-rw-r--r-- | ds9/parsers/contourparser.tac | 24 |
2 files changed, 56 insertions, 10 deletions
diff --git a/ds9/library/contour.tcl b/ds9/library/contour.tcl index b4851f7..0ef7cd9 100644 --- a/ds9/library/contour.tcl +++ b/ds9/library/contour.tcl @@ -486,8 +486,8 @@ proc ContourCPasteDialog {} { ttk::separator $w.sep -orient horizontal ttk::separator $w.sep2 -orient horizontal pack $w.buttons $w.sep -side bottom -fill x -# pack $w.param1 $w.sep2 $w.param2 -side top -fill both -expand true - pack $w.param -side top -fill both -expand true + pack $w.param1 $w.sep2 $w.param -side top -fill both -expand true +# pack $w.param -side top -fill both -expand true DialogCenter $w DialogWait $w ed(ok) @@ -1158,7 +1158,7 @@ proc ProcessContourCmd {varname iname} { set dash [lindex $var $i] incr i [ProcessContourFix sys sky color width dash] - ContourCmdPaste $sys $sky $color $width $dash + ContourCmdPasteOrg $sys $sky $color $width $dash } color { incr i @@ -1243,7 +1243,41 @@ proc ProcessContourCmd {varname iname} { } } -proc ContourCmdPaste {sys sky color width dash} { +proc ContourCmdLoad {fn} { + global current + + if {$current(frame) != {}} { + $current(frame) contour load $fn + } +} + +proc ContourCmdLoadParam {fn color width dash} { + global current + + if {$current(frame) != {}} { + $current(frame) contour load $fn $color $width $dash + } +} + +proc ContourCmdLoadOrg {fn sys sky color width dash} { + global current + + if {$current(frame) != {}} { + $current(frame) contour load $color $width $dash $fn $sys $sky + } +} + +proc ContourCmdPaste {} { + global current + global contour + + if {$current(frame) != {} && $contour(copy) != {}} { + set cc [$contour(copy) get contour $sys $sky] + $current(frame) contour paste cc + } +} + +proc ContourCmdPasteOrg {sys sky color width dash} { global current global contour diff --git a/ds9/parsers/contourparser.tac b/ds9/parsers/contourparser.tac index 23c6df4..55519b9 100644 --- a/ds9/parsers/contourparser.tac +++ b/ds9/parsers/contourparser.tac @@ -62,8 +62,8 @@ contour : yesno {global contour; set contour(view) $1; UpdateContour} | OPEN_ {ContourDialog} | CLOSE_ {ContourDestroyDialog} | CLEAR_ {ContourOffDialog} - | LOAD_ - | SAVE_ + | LOAD_ load + | SAVE_ save | CONVERT_ {Contour2Polygons} | LOADLEVELS_ | SAVELEVELS_ @@ -84,10 +84,22 @@ contour : yesno {global contour; set contour(view) $1; UpdateContour} | GENERATE_ {ContourCmdGenerate} ; -paste : coordsys STRING_ INT_ yesno - | wcssys STRING_ INT_ yesno - | skyframe STRING_ INT_ yesno - | wcssys skyframe STRING_ INT_ yesno +load : STRING_ {ContourCmdLoad $1} + | STRING_ STRING_ INT_ yesno {ContourCmdLoadOpt $1 $2 $3 $4} + | STRING_ coordsys STRING_ INT_ yesno {ContourCmdLoadOrg $1 $2 fk5 $3 $4 $5} + | STRING_ wcssys STRING_ INT_ yesno {ContourCmdLoadOrg $1 $2 fk5 $3 $4 $5} + | STRING_ skyframe STRING_ INT_ yesno {ContourCmdLoadOrg $1 wcs $2 $3 $4 $5} + | STRING_ wcssys skyframe STRING_ INT_ yesno {ContourCmdLoadOrg $1 $2 $3 $4 $5 $6} + ; + +save : STRING_ + ; + +paste : {ContourCmdPaste} + | coordsys STRING_ INT_ yesno {ContourCmdPasteOrg $1 fk5 $2 $3 $4} + | wcssys STRING_ INT_ yesno {ContourCmdPasteOrg $1 fk5 $2 $3 $4} + | skyframe STRING_ INT_ yesno {ContourCmdPasteOrg wcs $1 $2 $3 $4} + | wcssys skyframe STRING_ INT_ yesno {ContourCmdPasteOrg $1 $2 $3 $4 $5} ; method : BLOCK_ {set _ block} |