From 3f1ae1680574d28ef25414c21cde23d1ec78e4a3 Mon Sep 17 00:00:00 2001 From: William Joye Date: Tue, 12 Jun 2018 17:42:17 -0400 Subject: SIA: use cone search radius instead of width/height --- ds9/doc/ref/command.html | 57 ++++++++++++++++++++-- ds9/doc/ref/samp.html | 89 ++++++++++++++++++++++++++++++++-- ds9/doc/ref/xpa.html | 85 +++++++++++++++++++++++++++++++-- ds9/doc/release/r8.0.html | 1 + ds9/library/catdialog.tcl | 2 +- ds9/library/sia.tcl | 8 ++-- ds9/library/siadialog.tcl | 119 +++++++++++++++++++++++++++++++++++++--------- ds9/parsers/sialex.fcl | 1 + ds9/parsers/siaparser.tac | 5 +- 9 files changed, 329 insertions(+), 38 deletions(-) diff --git a/ds9/doc/ref/command.html b/ds9/doc/ref/command.html index 735507f..c8e42e5 100644 --- a/ds9/doc/ref/command.html +++ b/ds9/doc/ref/command.html @@ -527,6 +527,7 @@ + [crosshair]
        [<ref>] [dec <col>]
@@ -645,6 +646,7 @@ + [match error <value> degrees|arcmin|arcsec]
        [<ref>] @@ -745,6 +747,7 @@ + [match function 1and2|1not2|2not1]
        [<ref>] @@ -845,6 +848,7 @@ + [match return 1and2|1only|2only]
        [<ref>] @@ -945,6 +949,7 @@ + [match unique yes|no]
        [<ref>] [maxrows <number>]
@@ -1000,18 +1005,21 @@ + [symbol shape circle + point|box point|diamond point|cross + point|x point|arrow point|boxcircle point]
        [<ref>] [symbol add| [#] remove]
@@ -1118,6 +1126,7 @@ + [update]

        [<ref>] [x <col>]
@@ -1251,6 +1260,7 @@ + [match]
          [lock [yes|no]]
@@ -1519,6 +1529,7 @@ + [match <coordsys>]
           [lock <coordsys>|none]
@@ -1686,6 +1697,7 @@ + -envi foo.hdr foo.bsq

exit
@@ -2436,6 +2448,7 @@ + [pan]
            @@ -2579,6 +2592,7 @@ + [crosshair]
            @@ -2722,6 +2736,7 @@ + [open|close]
 
Example:
@@ -2969,6 +2984,7 @@ + [yes|open]
            [no|close]
@@ -3075,12 +3091,14 @@ + duplicate [#]]
   +    [[<plotname>] stats yes|no]
     
[[<plotname>] @@ -3156,6 +3174,7 @@ + list yes|no]
     
[[<plotname>] @@ -3230,6 +3249,7 @@ + loadconfig <filename>]
      [[<plotname>] saveconfig <filename>]
@@ -3336,6 +3356,7 @@ + legend yes|no]
      [[<plotname>] legend position right|left|top|bottom]

@@ -3421,6 +3442,7 @@ + barmode normal|stacked|aligned|overlap]

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

      [[<plotname>] @@ -3573,6 +3596,7 @@ + shape fill yes|no]
      [[<plotname>] shape @@ -3582,6 +3606,7 @@ + [[<plotname>] @@ -3655,6 +3680,7 @@ + smooth step|linear|cubic|quadratic|catrom]
      @@ -3662,6 +3688,7 @@ + [[<plotname>] @@ -3735,6 +3762,7 @@ + color <value>]
      @@ -3742,6 +3770,7 @@ + [[<plotname>] @@ -3815,6 +3844,7 @@ + width <value>]
      @@ -3890,6 +3920,7 @@ + [[<plotname>] @@ -3963,6 +3994,7 @@ + dash yes|no]
      @@ -4038,6 +4070,7 @@ + [[<plotname>] @@ -4111,6 +4144,7 @@ + error yes|no]
      @@ -4186,6 +4220,7 @@ + [[<plotname>] @@ -4259,6 +4294,7 @@ + error color <value>]
      @@ -4335,6 +4371,7 @@ + [[<plotname>] @@ -4408,6 +4445,7 @@ + color <value>]
      @@ -4484,6 +4522,7 @@ + [[<plotname>] @@ -4557,6 +4596,7 @@ + error width <value>]
      @@ -4633,6 +4673,7 @@ + [[<plotname>] @@ -4706,6 +4747,7 @@ + name <string>]

@@ -4760,6 +4802,7 @@ + -plot title 'This is a Title'
$ds9 -plot title x 'X Axis'
$ds9 -plot title y 'Y Axis'
@@ -4831,6 +4874,7 @@ +
<dms> <arcmin> <arcsec>

@@ -5234,6 +5278,7 @@ + <filename> [image|table|slice]

 
Example:
@@ -5355,8 +5400,8 @@      [<ref>] [retrieve]
     [<ref>] [save <filename>]
-      [<ref>] [size <width> - <height> degrees|arcmin|arcsec]
+      [<ref>] [radius <value> + degrees|arcmin|arcsec]
     [<ref>] [sky <skyframe>]
     [<ref>] [skyformat @@ -5377,7 +5422,7 @@ $ds9 -sia print
$ds9 -sia retrieve
$ds9 -sia save foo.xml
-
$ds9 -sia size 1 1 degrees
+
$ds9 -sia radius 1 degrees
$ds9 -sia sky fk5
$ds9 -sia skyformat degrees
$ds9 -sia system wcs
@@ -5482,6 +5527,7 @@ + [sigma <value>]
        @@ -5497,6 +5543,7 @@ + [sigmaminor <value>]
        @@ -5512,6 +5559,7 @@ + [angle <value>]
        @@ -5527,6 +5575,7 @@ + [match]
        [lock [yes|no]]
        @@ -5552,6 +5601,7 @@ + -smooth sigmaminor 2.0
$ds9 @@ -5567,6 +5617,7 @@ + -smooth angle 45
$ds9 -smooth match
diff --git a/ds9/doc/ref/samp.html b/ds9/doc/ref/samp.html index 30b2348..82c25c4 100644 --- a/ds9/doc/ref/samp.html +++ b/ds9/doc/ref/samp.html @@ -580,6 +580,7 @@ + [crosshair]

        [<ref>] [dec <col>]
@@ -696,6 +697,7 @@ + [match error <value> degrees|arcmin|arcsec]
        [<ref>] @@ -794,6 +796,7 @@ + [match function 1and2|1not2|2not1]
        [<ref>] @@ -892,6 +895,7 @@ + [match return 1and2|1only|2only]
        [<ref>] @@ -990,6 +994,7 @@ + [match unique yes|no]
        [<ref>] [maxrows <number>]
@@ -1044,18 +1049,21 @@ + [symbol shape circle + point|box point|diamond point|cross + point|x point|arrow point|boxcircle point]
        [<ref>] [symbol add| [#] remove]
@@ -1160,6 +1168,7 @@ + [update]

        [<ref>] [x <col>]
@@ -2228,6 +2237,7 @@ + Macros for more information.

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

Syntax:
jpeg [new|slice] [<filename>] [1-100]
@@ -2798,6 +2809,7 @@ + [new name <plotname> line|bar|scatter]


# load data into existing plot from @@ -2883,6 +2895,7 @@ + duplicate [#]]
     @@ -2958,6 +2971,7 @@ + [[<plotname>] stats yes|no]
    
[[<plotname>] @@ -3032,6 +3046,7 @@ + list yes|no]
    
[[<plotname>] @@ -3106,6 +3121,7 @@ + loadconfig <filename>]
     [[<plotname>] saveconfig <filename>]
@@ -3182,6 +3198,7 @@ + [[<plotname>] pagesetup orient portrait|landscape]
     [[<plotname>] pagesetup size letter|legal|tabloid|poster|a4]

@@ -3258,6 +3275,7 @@ + [[<plotname>] print]
     [[<plotname>] print destination printer|file]
@@ -3356,6 +3374,7 @@ + legend yes|no]
     [[<plotname>] legend position right|left|top|bottom]

@@ -3441,6 +3460,7 @@ + barmode normal|stacked|aligned|overlap]

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

     [[<plotname>] @@ -3593,6 +3614,7 @@ + shape fill yes|no]
     [[<plotname>] @@ -3671,6 +3693,7 @@ + [[<plotname>] @@ -3744,6 +3767,7 @@ + smooth step|linear|cubic|quadratic|catrom]
     @@ -3820,6 +3844,7 @@ + [[<plotname>] @@ -3893,6 +3918,7 @@ + color <value>]
     @@ -3969,6 +3995,7 @@ + [[<plotname>] @@ -4042,6 +4069,7 @@ + width <value>]
     @@ -4118,6 +4146,7 @@ + [[<plotname>] @@ -4191,6 +4220,7 @@ + dash yes|no]
     @@ -4266,6 +4296,7 @@ + [[<plotname>] @@ -4339,6 +4370,7 @@ + error yes|no]
     @@ -4414,6 +4446,7 @@ + [[<plotname>] @@ -4487,6 +4520,7 @@ + error color <value>]
     @@ -4563,6 +4597,7 @@ + [[<plotname>] @@ -4636,6 +4671,7 @@ + color <value>]
     @@ -4712,6 +4748,7 @@ + [[<plotname>] @@ -4785,6 +4822,7 @@ + error width <value>]
     @@ -4861,6 +4899,7 @@ + [[<plotname>] @@ -4934,6 +4973,7 @@ + name <string>]

@@ -5027,6 +5067,7 @@ + value = ds9.get(string cmd)
plot stats
@@ -5128,6 +5169,7 @@ + axis x auto
plot @@ -5197,6 +5239,7 @@ + axis x min
plot @@ -5266,6 +5309,7 @@ + axis x max
plot @@ -5335,6 +5379,7 @@ + axis x format
plot @@ -5404,6 +5449,7 @@ + legend
plot legend position
@@ -5481,6 +5527,7 @@ + font numbers size
plot @@ -5554,6 +5601,7 @@ + font numbers weight
plot @@ -5627,6 +5675,7 @@ + font numbers slant
plot @@ -5700,6 +5749,7 @@ + title
plot @@ -5773,6 +5823,7 @@ + title x
plot barmode
@@ -5796,6 +5847,7 @@ + cmd)
plot legend yes
plot legend position left
@@ -5805,6 +5857,7 @@ + value = ds9.get(string cmd)
plot font numbers font
@@ -5813,24 +5866,28 @@ + font numbers size
plot + font numbers weight
plot + font numbers slant
ds9.set(string + cmd)
plot font numbers font times
plot font numbers size 12
@@ -5842,6 +5899,7 @@ + value = ds9.get(string cmd)
plot @@ -5849,24 +5907,28 @@ + title
plot + title xaxis
plot + title yaxis
ds9.set(string + cmd)
plot title "This is a Title"
plot title x "X Axis"
@@ -5878,6 +5940,7 @@ + value = ds9.get(string cmd)
@@ -5886,6 +5949,7 @@ + barmode
ds9.set(string @@ -5893,6 +5957,7 @@ + cmd)
plot barmode aligned

@@ -5979,6 +6044,7 @@ + dash
plot @@ -6052,6 +6118,7 @@ + error
plot @@ -6125,6 +6192,7 @@ + error color
plot @@ -6198,6 +6266,7 @@ + error width
plot @@ -6271,6 +6340,7 @@ + name
ds9.set(string @@ -6344,6 +6414,7 @@ + cmd)
plot show yes
plot shape circle
@@ -6392,6 +6463,7 @@ +
<dms> <arcmin> <arcsec>

@@ -7011,6 +7083,7 @@ + [crosshair]

        [<ref>] [export sb|tsv <filename>]
@@ -7021,8 +7094,8 @@ [retrieve]

        [<ref>] [save <filename>]
-         [<ref>] [size - <width> <height> degrees|arcmin|arcsec]
+         [<ref>] [radius + <value> degrees|arcmin|arcsec]
        [<ref>] [sky <skyframe>]
        [<ref>] @@ -7126,6 +7199,7 @@ + [update]
 
Example:
@@ -7144,7 +7218,7 @@ sia
print
sia retrieve
sia
save foo.xml
- sia
size 1 1 degrees
+ sia
radius 1degrees
sia sky fk5
sia skyformat degrees
sia
system wcs
@@ -7247,6 +7321,7 @@ + [sigma <value>]
       @@ -7261,6 +7336,7 @@ + [sigmaminor <value>]
       @@ -7276,6 +7352,7 @@ + [angle <value>]
       @@ -7291,6 +7368,7 @@ + [match]
       [lock [yes|no]]

       [open|close]
@@ -7325,6 +7403,7 @@ + sigma 2.0
smooth @@ -7340,6 +7419,7 @@ + sigmaminor 2.0
smooth @@ -7355,6 +7435,7 @@ + angle 45
smooth @@ -7370,6 +7451,7 @@ + open
smooth close
smooth match
@@ -7494,6 +7576,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 e28ea2e..af2de5e 100644 --- a/ds9/doc/ref/xpa.html +++ b/ds9/doc/ref/xpa.html @@ -217,6 +217,7 @@ + -p ds9 3d match

$xpaset -p ds9 3d lock yes
@@ -233,6 +234,7 @@ + -p ds9 3d open
$xpaset -p ds9 3d close
@@ -569,6 +571,7 @@ + [crosshair]

        [<ref>] [dec <col>]
@@ -690,6 +693,7 @@ + [match error <value> degrees|arcmin|arcsec]

        [<ref>] @@ -793,6 +797,7 @@ + [match function 1and2|1not2|2not1]
        [<ref>] @@ -896,6 +901,7 @@ + [match return 1and2|1only|2only]
        [<ref>] @@ -999,6 +1005,7 @@ + [match unique yes|no]
        [<ref>] [maxrows <number>]
@@ -1052,6 +1059,7 @@ + [symbol shape
circle point|box point|diamond point|cross point|x point|arrow point|boxcircle point]
@@ -1163,6 +1171,7 @@ + [update]

        [<ref>] [x <col>]
@@ -1755,6 +1764,7 @@ + -p ds9 export envi foo.hdr foo.bsq little

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

Syntax:
jpeg [new|slice] [<filename>] [1-100]
@@ -2715,6 +2726,7 @@ + [new name <plotname> line|bar|scatter]


# create new plot with data from stdin
@@ -2724,6 +2736,7 @@ +
[new <title> <xaxis label> <yaxis label> xy|xyex|xyey|xyexey]
@@ -2738,18 +2751,21 @@ +
[new name + <plotname> <title> + <xaxis label> <yaxis label> xy|xyex|xyey|xyexey]
    
[new name @@ -2757,12 +2773,14 @@ + <plotname> line|bar|scatter + <title> <xaxis label> <yaxis label> xy|xyex|xyey|xyexey]

@@ -2776,12 +2794,14 @@ +
[line|bar|scatter] + stdin]
     @@ -2790,6 +2810,7 @@ + [new name <plotname> stdin]
     @@ -2799,6 +2820,7 @@ + stdin]

# load data into existing plot from @@ -2885,6 +2907,7 @@ + duplicate [#]]
     @@ -2961,6 +2984,7 @@ + [[<plotname>] stats yes|no]
    
[[<plotname>] @@ -3036,6 +3060,7 @@ + list yes|no]
    
[[<plotname>] @@ -3111,6 +3136,7 @@ + loadconfig <filename>]
     [[<plotname>] saveconfig <filename>]
@@ -3188,6 +3214,7 @@ + [[<plotname>] pagesetup orient portrait|landscape]
     [[<plotname>] pagesetup size letter|legal|tabloid|poster|a4]

@@ -3265,6 +3292,7 @@ + [[<plotname>] print]
     [[<plotname>] print destination printer|file]
@@ -3364,6 +3392,7 @@ + legend yes|no]
     [[<plotname>] legend position right|left|top|bottom]

@@ -3450,6 +3479,7 @@ + barmode normal|stacked|aligned|overlap]

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

     [[<plotname>] @@ -3604,6 +3635,7 @@ + shape fill yes|no]
     [[<plotname>] @@ -3683,6 +3715,7 @@ + [[<plotname>] @@ -3757,6 +3790,7 @@ + smooth step|linear|cubic|quadratic|catrom]
     @@ -3834,6 +3868,7 @@ + [[<plotname>] @@ -3908,6 +3943,7 @@ + color <value>]
     @@ -3985,6 +4021,7 @@ + [[<plotname>] @@ -4059,6 +4096,7 @@ + width <value>]
     @@ -4136,6 +4174,7 @@ + [[<plotname>] @@ -4210,6 +4249,7 @@ + dash yes|no]
     @@ -4286,6 +4326,7 @@ + [[<plotname>] @@ -4360,6 +4401,7 @@ + error yes|no]
     @@ -4436,6 +4478,7 @@ + [[<plotname>] @@ -4510,6 +4553,7 @@ + error color <value>]
     @@ -4587,6 +4631,7 @@ + [[<plotname>] @@ -4661,6 +4706,7 @@ + color <value>]
     @@ -4738,6 +4784,7 @@ + [[<plotname>] @@ -4812,6 +4859,7 @@ + error width <value>]
     @@ -4889,6 +4937,7 @@ + [[<plotname>] @@ -4963,6 +5012,7 @@ + name <string>]

@@ -5007,6 +5057,7 @@ + data into existing plot from stdin

$cat xy.dat | xpaset ds9 plot data xy
$cat xy.dat | xpaset ds9 plot foo data xy
@@ -5115,6 +5166,7 @@ + ds9 plot axis x min
$xpaget @@ -5190,6 +5242,7 @@ + ds9 plot axis x max
$xpaget ds9 plot axis x format
$xpaset @@ -5198,6 +5251,7 @@ + -p ds9 plot axis x grid yes
$xpaset -p ds9 plot axis x log yes

$xpaset -p ds9 plot axis x flip yes
@@ -5288,6 +5342,7 @@ + ds9 plot font numbers size
$xpaget @@ -5363,6 +5418,7 @@ + ds9 plot font numbers weight
$xpaget @@ -5438,6 +5494,7 @@ + ds9 plot font numbers slant
$xpaset @@ -5445,6 +5502,7 @@ + -p ds9 plot font numbers font times
$xpaset -p ds9 plot font numbers size 12
$xpaset -p ds9 plot font numbers weight bold
@@ -5525,6 +5583,7 @@ + ds9 plot title xaxis
$xpaget @@ -5600,6 +5659,7 @@ + ds9 plot title yaxis
$xpaset @@ -5607,6 +5667,7 @@ + -p ds9 plot title {This is a Title}
$xpaset -p ds9 plot title x {X Axis}
$xpaset -p ds9 plot title y {Y Axis}
@@ -5701,6 +5762,7 @@ + ds9 plot dash
$xpaget @@ -5776,6 +5838,7 @@ + ds9 plot error
$xpaget @@ -5851,6 +5914,7 @@ + ds9 plot error color
$xpaget @@ -5927,6 +5991,7 @@ + ds9 plot error width
$xpaget @@ -6003,6 +6068,7 @@ + ds9 plot name
$xpaset @@ -6078,6 +6144,7 @@ + -p ds9 plot show yes
$xpaset -p ds9 plot shape circle
$xpaset -p ds9 plot shape fill no
@@ -6124,6 +6191,7 @@ +
<dms> <arcmin> <arcsec>

@@ -6620,6 +6688,7 @@ + method.

Syntax:
saveimage
[fits|eps|gif|tiff|jpeg|png] <filename>
@@ -6729,8 +6798,8 @@     [<ref>] [retrieve]
    [<ref>] [save <filename>]
-     [<ref>] [size <width> - <height> degrees|arcmin|arcsec]
+     [<ref>] [radius <value> + degrees|arcmin|arcsec]
    [<ref>] [sky <skyframe>]
    [<ref>] [skyformat @@ -6753,7 +6822,7 @@ $xpaset -p ds9 sia print
$xpaset -p ds9 sia retrieve
$xpaset -p ds9 sia save foo.xml
-
$xpaset -p ds9 sia size 1 1 degrees
+
$xpaset -p ds9 sia radius 1 degrees
$xpaset -p ds9 sia sky fk5
$xpaset -p ds9 sia skyformat degrees
$xpaset -p ds9 sia system wcs
@@ -6852,6 +6921,7 @@ + [sigma <value>]
       @@ -6868,6 +6938,7 @@ + [sigmaminor <value>]
       @@ -6884,6 +6955,7 @@ + [angle <value>]
    @@ -6900,6 +6972,7 @@ +    [match]
       [lock [yes|no]]

       [open|close]
@@ -6924,6 +6997,7 @@ + ds9 smooth sigmaminor
$xpaget ds9 smooth lock
@@ -6948,6 +7022,7 @@ + -p ds9 smooth sigma 2.0
$xpaset @@ -6964,6 +7039,7 @@ + -p ds9 smooth sigmaminor 2.0
$xpaset @@ -6980,6 +7056,7 @@ + -p ds9 smooth angle 45
$xpaset @@ -6996,6 +7073,7 @@ + -p ds9 smooth match
$xpaset -p ds9 smooth lock yes

$xpaset -p ds9 smooth open
@@ -7120,6 +7198,7 @@ +
compression method.

Syntax:
tiff [new|slice] [<filename>] [none|jpeg|packbits|deflate]
diff --git a/ds9/doc/release/r8.0.html b/ds9/doc/release/r8.0.html index 24a310c..8b0bb87 100644 --- a/ds9/doc/release/r8.0.html +++ b/ds9/doc/release/r8.0.html @@ -16,6 +16,7 @@
  • 04.18.2018 GUI: fixed an issue with loading gzipped multiple extension fits files with the -multiframe option.
  • 05.25.2018 MMT: updated Binospec template.
  • 06.12.2018 CATALOG: GUI now uses a conesearch radius for query.
  • +
  • 06.12.2018 SIA: GUI now uses a conesearch radius for query.
  • xx.xx.2018 RELEASE version 8.0b1
  • diff --git a/ds9/library/catdialog.tcl b/ds9/library/catdialog.tcl index 3a7d585..6bb650a 100644 --- a/ds9/library/catdialog.tcl +++ b/ds9/library/catdialog.tcl @@ -960,7 +960,7 @@ proc CATServer {varname} { simbad {CATSIMBAD $varname} } } else { - ARError $varname [msgcat::mc {Please specify width, height, and either name or (ra,dec)}] + ARError $varname [msgcat::mc {Please specify radius and either name or (ra,dec)}] } } diff --git a/ds9/library/sia.tcl b/ds9/library/sia.tcl index bad13cc..05cf160 100644 --- a/ds9/library/sia.tcl +++ b/ds9/library/sia.tcl @@ -13,8 +13,7 @@ proc SIADef {} { set isia(sias) {} set isia(rformat) arcmin - set isia(width) 15 - set isia(height) 15 + set isia(radius) 15 set isia(minrows) 20 set isia(mincols) 10 @@ -432,12 +431,11 @@ proc SIACmdSave {fn writer} { } } -proc SIACmdSize {width height rformat} { +proc SIACmdSize {radius rformat} { global cvarname upvar #0 $cvarname cvar - set cvar(width) $width - set cvar(height) $height + set cvar(radius) $radius set cvar(rformat) $rformat set cvar(rformat,msg) $rformat } diff --git a/ds9/library/siadialog.tcl b/ds9/library/siadialog.tcl index 6821639..0571ae4 100644 --- a/ds9/library/siadialog.tcl +++ b/ds9/library/siadialog.tcl @@ -36,7 +36,7 @@ proc SIADialog {varname title url opts method action} { } # AR variables - ARInit $varname IMGSVRServer + ARInit $varname SIAServer # IMG variables set var(proc,done) SIADone @@ -52,8 +52,7 @@ proc SIADialog {varname title url opts method action} { set var(sky) $wcs(sky) set var(skyformat) $wcs(skyformat) set var(rformat) $isia(rformat) - set var(width) $isia(width) - set var(height) $isia(height) + set var(radius) $isia(radius) set var(save) $isia(save) set var(mode) $isia(mode) @@ -92,10 +91,10 @@ proc SIADialog {varname title url opts method action} { -command [list SIAOff $varname] $mb.file add separator $mb.file add command -label [msgcat::mc {Update from Current Frame}] \ - -command [list IMGSVRUpdate $varname] + -command [list SIAUpdate $varname] $mb.file add command \ -label [msgcat::mc {Update from Current Crosshair}] \ - -command [list IMGSVRCrosshair $varname] + -command [list SIACrosshair $varname] $mb.file add separator $mb.file add command -label "[msgcat::mc {Print}]..." \ -command [list CATPrint $varname] @@ -147,16 +146,14 @@ proc SIADialog {varname title url opts method action} { [list SIAWCSMenuUpdate $varname] CoordMenuEnable $f.coord.menu $varname system 0 sky skyformat - ttk::label $f.wtitle -text [msgcat::mc {Width}] - ttk::entry $f.w -textvariable ${varname}(width) -width 14 - ttk::label $f.htitle -text [msgcat::mc {Height}] - ttk::entry $f.h -textvariable ${varname}(height) -width 14 + ttk::label $f.rtitle -text [msgcat::mc {Radius}] + ttk::entry $f.r -textvariable ${varname}(radius) -width 14 ARRFormat $f.rformat $varname grid $f.nametitle $f.name - - - - -padx 2 -pady 2 -sticky w grid $f.xtitle $f.x $f.ytitle $f.y $f.coord -padx 2 -pady 2 -sticky w - grid $f.wtitle $f.w $f.htitle $f.h $f.rformat -padx 2 -pady 2 -sticky w + grid $f.rtitle $f.r $f.rformat -padx 2 -pady 2 -sticky w # Param set f [ttk::labelframe $w.param -text [msgcat::mc {Table}] -padding 2] @@ -237,7 +234,7 @@ proc SIADialog {varname title url opts method action} { pack $w.tbl -side top -fill both -expand true ARCoord $varname - IMGSVRUpdate $varname + SIAUpdate $varname SIADialogUpdate $varname ARStatus $varname {} @@ -273,7 +270,7 @@ proc SIAApply {varname sync} { NSVRServer $varname } else { - IMGSVRServer $varname + SIAServer $varname } } @@ -451,25 +448,19 @@ proc SIAVOT1 {varname} { } } - # size (degrees) + # radius (degrees) switch $var(rformat) { degrees { - set ww $var(width) - set hh $var(height) + set rr $var(radius) } arcmin { - set ww [expr $var(width)/60.] - set hh [expr $var(height)/60.] + set rr [expr $var(radius)/60.] } arcsec { - set ww [expr $var(width)/60./60.] - set hh [expr $var(height)/60./60.] + set rr [expr $var(radius)/60./60.] } } - # now to radius - set rr [expr ($ww+$hh)/2.] - # query set var(query2) "$var(opts)[http::formatQuery POS "$xx,$yy" SIZE $rr FORMAT image/fits]" @@ -487,3 +478,87 @@ proc SIAWCSMenuUpdate {varname} { CoordMenuButtonCmd $varname psystem psky {} } +proc SIAUpdate {varname} { + upvar #0 $varname var + global $varname + + global current + global wcs + + global debug + if {$debug(tcl,image)} { + puts stderr "SIAUpdate $varname" + } + + if {[winfo exists $var(top)]} { + set var(name) {} + if {$current(frame) != {} } { + if {[$current(frame) has wcs equatorial $wcs(system)]} { + set coord [$current(frame) get fits center \ + $wcs(system) $var(sky) $var(skyformat)] + set var(x) [lindex $coord 0] + set var(y) [lindex $coord 1] + + set size [$current(frame) get fits size \ + $wcs(system) $var(sky) $var(rformat)] + set ww [lindex $size 0] + set hh [lindex $size 1] + set var(radius) [expr ($ww+$hh)/4] + + return + } + } else { + set var(x) {} + set var(y) {} + set var(radius) {} + } + } +} + +proc SIACrosshair {varname} { + upvar #0 $varname var + global $varname + + global debug + if {$debug(tcl,image)} { + puts stderr "SIACrosshair $varname" + } + + global current + global wcs + + if {[winfo exists $var(top)]} { + set var(name) {} + if {$current(frame) != {} } { + if {[$current(frame) has wcs equatorial $wcs(system)]} { + set coord [$current(frame) get crosshair \ + $wcs(system) $var(sky) $var(skyformat)] + set var(x) [lindex $coord 0] + set var(y) [lindex $coord 1] + + return + } + } + set var(x) {} + set var(y) {} + } +} + +proc SIAServer {varname} { + upvar #0 $varname var + global $varname + global current + + global debug + if {$debug(tcl,image)} { + puts stderr "SIAServer $varname" + } + + if {($var(x) != {}) && ($var(y) != {}) && ($var(radius) != {})} { + + ARStatus $varname [msgcat::mc {Contacting Image Server}] + eval [list $var(proc,exec) $varname] + } else { + eval [list $var(proc,error) $varname [msgcat::mc {Please specify radius and either name or (ra,dec)}]] + } +} diff --git a/ds9/parsers/sialex.fcl b/ds9/parsers/sialex.fcl index 36295f1..e038871 100644 --- a/ds9/parsers/sialex.fcl +++ b/ds9/parsers/sialex.fcl @@ -15,6 +15,7 @@ crosshair {return $CROSSHAIR_} export {return $EXPORT_} name {return $NAME_} print {return $PRINT_} +radius {return $RADIUS_} retrieve {return $RETRIEVE_} save {return $SAVE_} size {return $SIZE_} diff --git a/ds9/parsers/siaparser.tac b/ds9/parsers/siaparser.tac index 0732fe2..d0e75a4 100644 --- a/ds9/parsers/siaparser.tac +++ b/ds9/parsers/siaparser.tac @@ -18,6 +18,7 @@ %token EXPORT_ %token NAME_ %token PRINT_ +%token RADIUS_ %token RETRIEVE_ %token SAVE_ %token SIZE_ @@ -69,7 +70,9 @@ siaCmd : CANCEL_ {global cvarname; ARCancel $cvarname} | NAME_ STRING_ {ProcessCmdCVAR name $2} | PRINT_ {global cvarname; CATPrint $cvarname} | RETRIEVE_ {global cvarname; SIAApply $cvarname 1} - | SIZE_ numeric numeric rformat {SIACmdSize $2 $3 $4} + | RADIUS_ numeric rformat {SIACmdSize $2 $3} +# backward compatibily + | SIZE_ numeric numeric rformat {SIACmdSize [expr ($2+$3)/2.] $4} | SKY_ skyframe {SIACmdSkyframe $2} | SKYFORMAT_ skyformat {ProcessCmdCVAR skyformat $2} | SYSTEM_ wcssys {SIACmdSystem $2} -- cgit v0.12