From 499d228444970179b790227345477a4992f7b2bc Mon Sep 17 00:00:00 2001 From: William Joye Date: Tue, 17 Oct 2017 13:24:25 -0400 Subject: Catalog: match sometimes failed to find proper catalogs --- ds9/doc/ref/command.html | 54 +++++++++++++++++++++++++++++++--- ds9/doc/ref/samp.html | 75 ++++++++++++++++++++++++++++++++++++++++++++--- ds9/doc/ref/xpa.html | 75 ++++++++++++++++++++++++++++++++++++++++++++--- ds9/doc/release/r7.6.html | 1 + ds9/library/cat.tcl | 35 +++++++++++++++++++--- ds9/library/catmatch.tcl | 12 ++++++++ 6 files changed, 236 insertions(+), 16 deletions(-) diff --git a/ds9/doc/ref/command.html b/ds9/doc/ref/command.html index b4fb8cd..7266187 100644 --- a/ds9/doc/ref/command.html +++ b/ds9/doc/ref/command.html @@ -513,6 +513,7 @@ + [crosshair]
        [<ref>] [dec <col>]
@@ -529,9 +530,12 @@         [<ref>] [hide]
        [<ref>] [location <code>]
-         [<ref>] - [match <ref> <ref>]
-        
[<ref>] +         [<ref>] + [match <ref> <ref>]
+
        + [<ref>] [match]
+
       
[<ref>] + @@ -710,6 +714,7 @@ + [match function 1and2|1not2|2not1]
        [<ref>] @@ -800,6 +805,7 @@ + [match return 1and2|1only|2only]
        [<ref>] @@ -890,6 +896,7 @@ + [match unique yes|no]
        [<ref>] [maxrows <number>]
@@ -1036,6 +1043,7 @@ + [update]

        [<ref>] [x <col>]
@@ -1070,7 +1078,8 @@ $ds9 -catalog match function 1and2
$ds9 -catalog match unique no
$ds9 -catalog match return 1only
- $ds9 -catalog match 2mass csc
+ $ds9 -catalog match # last two catalogs loaded
+
$ds9 -catalog match 2mass csc
$ds9 -catalog maxrows 2000
$ds9 -catalog name m51
$ds9 -catalog panto no
@@ -1423,6 +1432,7 @@ + [match <coordsys>]
           [lock <coordsys>|none]

@@ -2309,6 +2319,7 @@ + [pan]
            @@ -2442,6 +2453,7 @@ + [crosshair]
            @@ -2575,6 +2587,7 @@ + [open|close]
 
Example:
@@ -2811,6 +2824,7 @@ + [yes|open]
            [no|close]
@@ -2914,6 +2928,7 @@ + duplicate
   @@ -2979,6 +2994,7 @@ +    [<plotname>] stats
     
[<plotname>] @@ -3044,6 +3060,7 @@ + list
     
[<plotname>] @@ -3109,6 +3126,7 @@ + loadconfig <filename>
      [<plotname>] saveconfig <filename>
@@ -3181,6 +3199,7 @@ +    [<plotname>] print
      [<plotname>] print destination [printer|file]
@@ -3255,6 +3274,7 @@ + mode [pointer|zoom]

# configure graph
@@ -3356,6 +3376,7 @@ + shape [circle|square|diamond|plus|splus|scross|triangle|arrow]

      [<plotname>] @@ -3422,6 +3443,7 @@ + shape fill [yes|no]
      [<plotname>] @@ -3490,6 +3512,7 @@ +     [<plotname>] @@ -3554,6 +3577,7 @@ + smooth [step|linear|cubic|quadratic|catrom]
   @@ -3620,6 +3644,7 @@ +    [<plotname>] @@ -3685,6 +3710,7 @@ + color <value>
    @@ -3751,6 +3777,7 @@ +   [<plotname>] @@ -3815,6 +3842,7 @@ + width <value>
  @@ -3881,6 +3909,7 @@ +     @@ -3946,6 +3975,7 @@ + [<plotname>] @@ -4010,6 +4040,7 @@ + dash [yes|no]
   @@ -4075,6 +4106,7 @@ +    [<plotname>] @@ -4140,6 +4172,7 @@ + error [yes|no]
  @@ -4205,6 +4238,7 @@ +     [<plotname>] @@ -4270,6 +4304,7 @@ + error color <value>
   @@ -4336,6 +4371,7 @@ +    [<plotname>] @@ -4401,6 +4437,7 @@ + error width <value>
    @@ -4467,6 +4504,7 @@ +   [<plotname>] @@ -4531,6 +4569,7 @@ + name <string>
# select current dataset
@@ -5028,6 +5067,7 @@ + <filename> [image|table|slice]

 
Example:
@@ -5268,21 +5308,25 @@ + [sigma <value>]
        + [sigmaminor <value>]
        + [angle <value>]
        + [match]
        [lock [yes|no]]
        @@ -5298,11 +5342,13 @@ $ds9 + -smooth sigmaminor 2.0
$ds9 + -smooth angle 45
$ds9 -smooth match
diff --git a/ds9/doc/ref/samp.html b/ds9/doc/ref/samp.html index 8de3caf..d73a7ed 100644 --- a/ds9/doc/ref/samp.html +++ b/ds9/doc/ref/samp.html @@ -565,6 +565,7 @@ + [crosshair]

        [<ref>] [dec <col>]
@@ -581,9 +582,12 @@         [<ref>] [hide]
        [<ref>] [location <code>]
-         [<ref>] - [match <ref> <ref>]
-        
[<ref>] +         [<ref>] + [match]
+
        + [<ref>] [match <ref> <ref>]
+
       
[<ref>] + @@ -758,6 +762,7 @@ + [match function 1and2|1not2|2not1]
        [<ref>] @@ -846,6 +851,7 @@ + [match return 1and2|1only|2only]
        [<ref>] @@ -934,6 +940,7 @@ + [match unique yes|no]
        [<ref>] [maxrows <number>]
@@ -1077,6 +1084,7 @@ + [update]

        [<ref>] [x <col>]
@@ -1116,7 +1124,8 @@ catalog match function 1and2
catalog match unique no
catalog match return 1only
- catalog match 2mass csc
+ catalog match # last two catalogs loaded
+
catalog match 2mass csc
catalog maxrows 2000
catalog name m51
catalog panto no
@@ -2120,6 +2129,7 @@ + Macros for more information.

Syntax:
iexam []
@@ -2233,6 +2243,7 @@ +
quality (1-100)

Syntax:
jpeg [new|slice] [<filename>] [1-100]
@@ -2739,6 +2750,7 @@ + # title, title xaxis, title yaxis, dimension on line 1
     [new [name <plotname>] [line|bar|scatter] <title> <xaxis label> <yaxis @@ -2814,6 +2826,7 @@ + duplicate
     @@ -2878,6 +2891,7 @@ + [<plotname>] stats
    
[<plotname>] @@ -2941,6 +2955,7 @@ + list
    
[<plotname>] @@ -3004,6 +3019,7 @@ + loadconfig <filename>
     [<plotname>] saveconfig <filename>
@@ -3069,6 +3085,7 @@ + [<plotname>] pagesetup orient [portrait|landscape]
     [<plotname>] pagesetup size [letter|legal|tabloid|poster|a4]

@@ -3134,6 +3151,7 @@ + [<plotname>] print
     [<plotname>] print destination [printer|file]
@@ -3221,6 +3239,7 @@ + legend [yes|no]
     [<plotname>] legend position [right|left|top|bottom]

@@ -3303,6 +3322,7 @@ + shape [circle|square|diamond|plus|splus|scross|triangle|arrow]

     [<plotname>] @@ -3367,6 +3387,7 @@ + shape fill [yes|no]
     [<plotname>] @@ -3434,6 +3455,7 @@ + [<plotname>] @@ -3496,6 +3518,7 @@ + smooth [step|linear|cubic|quadratic|catrom]
     @@ -3561,6 +3584,7 @@ + [<plotname>] @@ -3623,6 +3647,7 @@ + color <value>
     @@ -3688,6 +3713,7 @@ + [<plotname>] @@ -3750,6 +3776,7 @@ + width <value>
     @@ -3815,6 +3842,7 @@ + [<plotname>] @@ -3877,6 +3905,7 @@ + dash [yes|no]
     @@ -3941,6 +3970,7 @@ + [<plotname>] @@ -4003,6 +4033,7 @@ + error [yes|no]
     @@ -4067,6 +4098,7 @@ + [<plotname>] @@ -4129,6 +4161,7 @@ + error color <value>
     @@ -4194,6 +4227,7 @@ + [<plotname>] @@ -4256,6 +4290,7 @@ + color <value>
     @@ -4321,6 +4356,7 @@ + [<plotname>] @@ -4383,6 +4419,7 @@ + error width <value>
     @@ -4448,6 +4485,7 @@ + [<plotname>] @@ -4510,6 +4548,7 @@ + name <string>

@@ -4599,6 +4638,7 @@ + value = ds9.get(string cmd)
plot stats
@@ -4692,6 +4732,7 @@ + axis x auto
plot @@ -4751,6 +4792,7 @@ + axis x min
plot @@ -4810,6 +4852,7 @@ + axis x max
plot @@ -4869,6 +4912,7 @@ + axis x format
plot @@ -4928,6 +4972,7 @@ + legend
plot legend position
@@ -4995,6 +5040,7 @@ + font numbers size
plot @@ -5058,6 +5104,7 @@ + font numbers weight
plot @@ -5121,6 +5168,7 @@ + font numbers slant
plot @@ -5184,6 +5232,7 @@ + title
plot @@ -5247,6 +5296,7 @@ + title x
plot barmode
@@ -5342,6 +5392,7 @@ + dash
plot @@ -5405,6 +5456,7 @@ + error
plot @@ -5468,6 +5520,7 @@ + error color
plot @@ -5531,6 +5584,7 @@ + error width
plot @@ -5594,6 +5648,7 @@ + name
ds9.set(string @@ -5657,6 +5712,7 @@ + cmd)
plot show yes
plot shape circle
@@ -6305,6 +6361,7 @@ + [crosshair]

        [<ref>] [export sb|tsv <filename>]
@@ -6410,6 +6467,7 @@ + [update]

 
Example:
@@ -6519,20 +6577,24 @@
       + [sigma <value>]
       + [sigmaminor <value>]
       + [angle <value>]
       + [match]
       [lock [yes|no]]

       [open|close]
@@ -6557,21 +6619,25 @@ + sigma 2.0
smooth + sigmaminor 2.0
smooth + angle 45
smooth + open
smooth close
smooth match
@@ -6686,6 +6752,7 @@ +
compression method.

Syntax:
tiff [new|slice] [<filename>] [none|jpeg|packbits|deflate]
diff --git a/ds9/doc/ref/xpa.html b/ds9/doc/ref/xpa.html index 7612733..63c3e09 100644 --- a/ds9/doc/ref/xpa.html +++ b/ds9/doc/ref/xpa.html @@ -204,11 +204,13 @@ compass color red

$xpaset + -p ds9 3d match
$xpaset -p ds9 3d lock yes
$xpaset + -p ds9 3d open
$xpaset -p ds9 3d close
@@ -532,6 +534,7 @@ + [crosshair]
        [<ref>] [dec <col>]
@@ -548,9 +551,12 @@         [<ref>] [hide]
        [<ref>] [location <code>]
-         [<ref>] - [match <ref> <ref>]
-        
[<ref>] +         [<ref>] + [match]
+
        + [<ref>] [match <ref> <ref>]
+
       
[<ref>] + @@ -733,6 +739,7 @@ + [match function 1and2|1not2|2not1]
        [<ref>] @@ -825,6 +832,7 @@ + [match return 1and2|1only|2only]
        [<ref>] @@ -917,6 +925,7 @@ + [match unique yes|no]
        [<ref>] [maxrows <number>]
@@ -1062,6 +1071,7 @@ + [update]

        [<ref>] [x <col>]
@@ -1099,7 +1109,8 @@ $xpaset -p ds9 catalog match function 1and2
$xpaset -p ds9 catalog match unique no
$xpaset -p ds9 catalog match return 1only
- $xpaset -p ds9 catalog match 2mass csc
+ $xpaset -p ds9 catalog match # last two catalogs loaded
+
$xpaset -p ds9 catalog match 2mass csc
$xpaset -p ds9 catalog maxrows 2000
$xpaset -p ds9 catalog name m51
$xpaset -p ds9 catalog panto no
@@ -1642,6 +1653,7 @@ + -p ds9 export envi foo.hdr foo.bsq little

$xpaset -p ds9 export tiff foo.tiff jpeg
@@ -2156,6 +2168,7 @@ + quality (1-100)

Syntax:
jpeg [new|slice] [<filename>] [1-100]
@@ -2637,6 +2650,7 @@ + # title, title xaxis, title yaxis, dimension on line 1
     [new [name <plotname>] [line|bar|scatter] <title> <xaxis label> <yaxis @@ -2713,6 +2727,7 @@ + duplicate
     @@ -2778,6 +2793,7 @@ + [<plotname>] stats
    
[<plotname>] @@ -2842,6 +2858,7 @@ + list
    
[<plotname>] @@ -2906,6 +2923,7 @@ + loadconfig <filename>
     [<plotname>] saveconfig <filename>
@@ -2972,6 +2990,7 @@ + [<plotname>] pagesetup orient [portrait|landscape]
     [<plotname>] pagesetup size [letter|legal|tabloid|poster|a4]

@@ -3038,6 +3057,7 @@ + [<plotname>] print
     [<plotname>] print destination [printer|file]
@@ -3126,6 +3146,7 @@ + legend [yes|no]
     [<plotname>] legend position [right|left|top|bottom]

@@ -3201,6 +3222,7 @@ + barmode [normal|stacked|aligned|overlap]

# configure current dataset
@@ -3268,6 +3290,7 @@ + shape [circle|square|diamond|plus|splus|scross|triangle|arrow]

     [<plotname>] @@ -3333,6 +3356,7 @@ + shape fill [yes|no]
     [<plotname>] @@ -3401,6 +3425,7 @@ + [<plotname>] @@ -3464,6 +3489,7 @@ + smooth [step|linear|cubic|quadratic|catrom]
     @@ -3530,6 +3556,7 @@ + [<plotname>] @@ -3593,6 +3620,7 @@ + color <value>
     @@ -3659,6 +3687,7 @@ + [<plotname>] @@ -3722,6 +3751,7 @@ + width <value>
     @@ -3788,6 +3818,7 @@ + [<plotname>] @@ -3851,6 +3882,7 @@ + dash [yes|no]
     @@ -3916,6 +3948,7 @@ + [<plotname>] @@ -3979,6 +4012,7 @@ + error [yes|no]
     @@ -4044,6 +4078,7 @@ + [<plotname>] @@ -4107,6 +4142,7 @@ + error color <value>
     @@ -4173,6 +4209,7 @@ + [<plotname>] @@ -4236,6 +4273,7 @@ + color <value>
     @@ -4302,6 +4340,7 @@ + [<plotname>] @@ -4365,6 +4404,7 @@ + error width <value>
     @@ -4431,6 +4471,7 @@ + [<plotname>] @@ -4494,6 +4535,7 @@ + name <string>

@@ -4620,6 +4662,7 @@ + ds9 plot axis x min
$xpaget @@ -4684,6 +4727,7 @@ + ds9 plot axis x max
$xpaget ds9 plot axis x format
$xpaget @@ -4745,6 +4789,7 @@ + ds9 plot legend
$xpaget ds9 plot legend position
@@ -4813,6 +4858,7 @@ + ds9 plot font numbers size
$xpaget @@ -4877,6 +4923,7 @@ + ds9 plot font numbers weight
$xpaget @@ -4941,6 +4988,7 @@ + ds9 plot font numbers slant
$xpaget @@ -5005,6 +5053,7 @@ + ds9 plot title
$xpaget @@ -5069,6 +5118,7 @@ + ds9 plot title x
$xpaget ds9 plot barmode
@@ -5162,6 +5212,7 @@ + ds9 plot dash
$xpaget @@ -5226,6 +5277,7 @@ + ds9 plot error
$xpaget @@ -5290,6 +5342,7 @@ + ds9 plot error color
$xpaget @@ -5355,6 +5408,7 @@ + ds9 plot error width
$xpaget @@ -5420,6 +5474,7 @@ + ds9 plot name
$xpaset @@ -5484,6 +5539,7 @@ + -p ds9 plot show yes
$xpaset -p ds9 plot shape circle
$xpaset -p ds9 plot shape fill no
@@ -6000,6 +6056,7 @@ + method.

Syntax:
saveimage
[fits|eps|gif|tiff|jpeg|png] <filename>
@@ -6226,21 +6283,25 @@ + [sigma <value>]
       + [sigmaminor <value>]
       + [angle <value>]
    +    [match]
       [lock [yes|no]]

       [open|close]
@@ -6254,6 +6315,7 @@
$xpaget + ds9 smooth sigmaminor
$xpaget ds9 smooth lock
@@ -6267,21 +6329,25 @@ + -p ds9 smooth sigma 2.0
$xpaset + -p ds9 smooth sigmaminor 2.0
$xpaset + -p ds9 smooth angle 45
$xpaset + -p ds9 smooth match
$xpaset -p ds9 smooth lock yes

$xpaset -p ds9 smooth open
@@ -6395,6 +6461,7 @@ +
compression method.

Syntax:
tiff [new|slice] [<filename>] [none|jpeg|packbits|deflate]
diff --git a/ds9/doc/release/r7.6.html b/ds9/doc/release/r7.6.html index 0352b46..eade030 100644 --- a/ds9/doc/release/r7.6.html +++ b/ds9/doc/release/r7.6.html @@ -148,6 +148,7 @@
  • 10.04.2017 FITSY++: FITS compresssion- fixed a problem with ZNAXIS3=0 keyword issue.
  • 10.16.2017 PREFS: Add preferences for default dislay size at startup.
  • 10.16.2017 CATALOG: cat plot line command incorrectly finds 'Xerr' and 'Yerr' columns.
  • +
  • 10.16.2017 CATALOG: match sometimes failed to find proper catalogs.
  • xx.xx.2017 RELEASE version 7.6b7
  • diff --git a/ds9/library/cat.tcl b/ds9/library/cat.tcl index e4704b9..6535884 100644 --- a/ds9/library/cat.tcl +++ b/ds9/library/cat.tcl @@ -1614,10 +1614,37 @@ proc ProcessCatalog {varname iname cvarname} { unique {incr i; set icat(unique) [FromYesNo [lindex $var $i]]} return {incr i; set icat(return) [lindex $var $i]} default { - set icat(match1) "cat[lindex $var $i]" - incr i - set icat(match2) "cat[lindex $var $i]" - CATMatch $current(frame) $icat(match1) $icat(match2) + set icat(match1) {} + set icat(match2) {} + set m1 [lindex $var $i] + set m2 [lindex $var [expr $i+1]] + if {$m1 != {}} { + if {[string range $m1 0 0] != {-}} { + if {$m2 != {}} { + if {[string range $m2 0 0] != {-}} { + incr i + set icat(match1) "cat$m1" + set icat(match2) "cat$m2" + CATMatch $current(frame) \ + $icat(match1) $icat(match2) + return + } + } else { + # error + return + } + } + } + incr i -1 + # find them + set ll [llength $icat(cats)] + if {$ll>1} { + set icat(match1) [lindex $icat(cats) [expr $ll-2]] + set icat(match2) [lindex $icat(cats) [expr $ll-1]] + CATMatch $current(frame) $icat(match1) $icat(match2) + } else { + # error + } } } } diff --git a/ds9/library/catmatch.tcl b/ds9/library/catmatch.tcl index 8382a48..ed63d78 100644 --- a/ds9/library/catmatch.tcl +++ b/ds9/library/catmatch.tcl @@ -228,14 +228,26 @@ proc CATMatch {frame varname1 varname2} { puts stderr "CATMatch $frame $varname1 $varname2" } + if {$varname1 == {} || $varname2 == {}} { + return + } + upvar #0 $varname1 var1 global $varname1 + if {![info exists var1(tbldb)]} { + # error + return + } global $var1(tbldb) set t1 $var1(tbldb) upvar #0 $t1 T1 upvar #0 $varname2 var2 global $varname2 + if {![info exists var2(tbldb)]} { + # error + return + } global $var2(tbldb) set t2 $var2(tbldb) upvar #0 $t2 T2 -- cgit v0.12