summaryrefslogtreecommitdiffstats
path: root/ds9/library
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-07-14 21:02:10 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-07-14 21:02:10 (GMT)
commit41f87b98fef1d37f8ae8d70ed8c625e10aa6e5ed (patch)
tree8389398b927c2c1eeaa90b64da17e68cbec83899 /ds9/library
parent273d9233346920da6c2f66c57c7214079ded015c (diff)
downloadblt-41f87b98fef1d37f8ae8d70ed8c625e10aa6e5ed.zip
blt-41f87b98fef1d37f8ae8d70ed8c625e10aa6e5ed.tar.gz
blt-41f87b98fef1d37f8ae8d70ed8c625e10aa6e5ed.tar.bz2
update parser
Diffstat (limited to 'ds9/library')
-rw-r--r--ds9/library/lex.fcl35
-rw-r--r--ds9/library/parser.tac104
2 files changed, 137 insertions, 2 deletions
diff --git a/ds9/library/lex.fcl b/ds9/library/lex.fcl
index fa820dd..17c9502 100644
--- a/ds9/library/lex.fcl
+++ b/ds9/library/lex.fcl
@@ -27,6 +27,8 @@ E [Ee][+-]?{D}+
-blink {return $::BLINKCMD_}
-block {return $::BLOCKCMD_}
-blue {return $::BLUECMD_}
+-cat {return $::CATALOGCMD_}
+-catalog {return $::CATALOGCMD_}
-cd {return $::CDCMD_}
-cmap {return $::CMAPCMD_}
-console {return $::CONSOLECMD_}
@@ -90,6 +92,8 @@ about {return $::ABOUT_}
aip {return $::AIP_}
align {return $::ALIGN_}
all {return $::ALL_}
+allcols {return $::ALLCOLS_}
+allrows {return $::ALLROWS_}
amplifier {return $::AMPLIFIER_}
append {return $::APPEND_}
arcmin {return $::ARCMIN_}
@@ -112,6 +116,7 @@ block {return $::BLOCK_}
blue {return $::BLUE_}
border {return $::BORDER_}
buffersize {return $::BUFFERSIZE_}
+cancel {return $::CANCEL_}
catalog {return $::CATALOG_}
center {return $::CENTER_}
channel {return $::CHANNEL_}
@@ -126,21 +131,27 @@ colsz {return $::COLSZ_}
compass {return $::COMPASS_}
contrast {return $::CONTRAST_}
coord {return $::COORD_}
+coordinate {return $::COORDINATE_}
crop {return $::CROP_}
crosshair {return $::CROSSHAIR_}
current {return $::CURRENT_}
+csv {return $::CSV_}
datamin {return $::DATAMIN_}
datasec {return $::DATASEC_}
+dec {return $::DEC_}
+decr {return $::DECR_}
delete {return $::DELETE_}
depth {return $::DEPTH_}
detector {return $::DETECTOR_}
degrees {return $::DEGREES_}
direction {return $::DIRECTION_}
ecliptic {return $::ECLIPTIC_}
+edit {return $::EDIT_}
elevation {return $::ELEVATION_}
el {return $::ELEVATION_}
examine {return $::EXAMINE_}
exp {return $::EXP_}
+export {return $::EXPORT_}
fk4 {return $::FK4_}
fk5 {return $::FK5_}
factor {return $::FACTOR_}
@@ -159,12 +170,15 @@ galactic {return $::GALACTIC_}
global {return $::GLOBAL_}
green {return $::GREEN_}
grid {return $::GRID_}
+header {return $::HEADER_}
hide {return $::HIDE_}
highlite {return $::HIGHLITE_}
histequ {return $::HISTEQU_}
icrs {return $::ICRS_}
image {return $::IMAGE_}
+import {return $::IMPORT_}
in {return $::IN_}
+incr {return $::INCR_}
interval {return $::INTERVAL_}
invert {return $::INVERT_}
iraf {return $::IRAF_}
@@ -178,10 +192,12 @@ linear {return $::LINEAR_}
line {return $::LINE_}
load {return $::LOAD_}
local {return $::LOCAL_}
+location {return $::LOCATION_}
lock {return $::LOCK_}
log {return $::LOG_}
manual {return $::MANUAL_}
match {return $::MATCH_}
+maxrows {return $::MAXROWS_}
mecube {return $::MECUBE_}
method {return $::METHOD_}
minmax {return $::MINMAX_}
@@ -203,27 +219,38 @@ open {return $::OPEN_}
order {return $::ORDER_}
out {return $::OUT_}
pan {return $::PAN_}
+panto {return $::PANTO_}
+physical {return $::PHYSICAL_}
play {return $::PLAY_}
+plot {return $::PLOT_}
pointer {return $::POINTER_}
pow {return $::POW_}
prev {return $::PREV_}
-physical {return $::PHYSICAL_}
+print {return $::PRINT_}
+psky {return $::PSKY_}
+psystem {return $::PSYSTEM_}
+ra {return $::RA_}
region {return $::REGION_}
+regions {return $::REGIONS_}
refresh {return $::REFRESH_}
red {return $::RED_}
replace {return $::REPLACE_}
reset {return $::RESET_}
+retrieve {return $::RETRIEVE_}
rgb {return $::RGB_}
rgbcube {return $::RGBCUBE_}
rgbimage {return $::RGBIMAGE_}
rotate {return $::ROTATE_}
row {return $::ROW_}
+samp {return $::SAMP_}
sample {return $::SAMPLE_}
save {return $::SAVE_}
+sb {return $::SB_}
scale {return $::SCALE_}
scalelimits {return $::SCALELIMITS_}
scan {return $::SCAN_}
scope {return $::SCOPE_}
+server {return $::SERVER_}
sexagesimal {return $::SEXAGESIMAL_}
show {return $::SHOW_}
sinh {return $::SINH_}
@@ -232,20 +259,25 @@ sky {return $::SKY_}
skyformat {return $::SKYFORMAT_}
slice {return $::SLICE_}
smooth {return $::SMOOTH_}
+sort {return $::SORT_}
squared {return $::SQUARED_}
sqrt {return $::SQRT_}
+starbase {return $::STARBASE_}
stop {return $::STOP_}
sum {return $::SUM_}
survey {return $::SURVEY_}
+symbol {return $::SYMBOL_}
system {return $::SYSTEM_}
threads {return $::THREADS_}
tag {return $::TAG_}
to {return $::TO_}
true {return $::TRUE_}
+tsv {return $::TSV_}
update {return $::UPDATE_}
user {return $::USER_}
value {return $::VALUE_}
view {return $::VIEW_}
+vot {return $::VOT_}
vp {return $::VP_}
wcs {return $::WCS_}
wcsa {return $::WCSA_}
@@ -276,6 +308,7 @@ wcsy {return $::WCSY_}
wcsz {return $::WCSZ_}
wfpc2 {return $::WFP2_}
x {return $::X_}
+xml {return $::XML_}
xy {return $::XY_}
y {return $::Y_}
yes {return $::YES_}
diff --git a/ds9/library/parser.tac b/ds9/library/parser.tac
index b639b76..f5cd05d 100644
--- a/ds9/library/parser.tac
+++ b/ds9/library/parser.tac
@@ -31,6 +31,7 @@ set file(load) 0
%token BLOCKCMD_
%token BLUECMD_
%token BLINKCMD_
+%token CATALOGCMD_
%token CDCMD_
%token CMAPCMD_
%token CONSOLECMD_
@@ -87,11 +88,16 @@ set file(load) 0
%token 312_
%token 321_
+%token SB_
+%token STARBASE_
+
%token 3D_
%token ABOUT_
%token AIP_
%token ALIGN_
%token ALL_
+%token ALLCOLS_
+%token ALLROWS_
%token AMPLIFIER_
%token APPEND_
%token ARCMIN_
@@ -112,6 +118,7 @@ set file(load) 0
%token BLUE_
%token BORDER_
%token BUFFERSIZE_
+%token CANCEL_
%token CATALOG_
%token CENTER_
%token CHANNEL_
@@ -126,20 +133,26 @@ set file(load) 0
%token COMPASS_
%token CONTRAST_
%token COORD_
+%token COORDINATE_
%token CROP_
%token CROSSHAIR_
+%token CSV_
%token CURRENT_
%token DATAMIN_
%token DATASEC_
+%token DEC_
+%token DECR_
%token DEGREES_
%token DEPTH_
%token DETECTOR_
%token DELETE_
%token DIRECTION_
%token ECLIPTIC_
+%token EDIT_
%token ELEVATION_
%token EXAMINE_
%token EXP_
+%token EXPORT_
%token FACTOR_
%token FALSE_
%token FILE_
@@ -158,12 +171,15 @@ set file(load) 0
%token GLOBAL_
%token GREEN_
%token GRID_
+%token HEADER_
%token HIDE_
%token HIGHLITE_
%token HISTEQU_
%token ICRS_
%token IMAGE_
+%token IMPORT_
%token IN_
+%token INCR_
%token INTERVAL_
%token INVERT_
%token IRAF_
@@ -177,10 +193,12 @@ set file(load) 0
%token LINEAR_
%token LOAD_
%token LOCAL_
+%token LOCATION_
%token LOCK_
%token LOG_
%token MANUAL_
%token MATCH_
+%token MAXROWS_
%token MECUBE_
%token METHOD_
%token MINMAX_
@@ -202,27 +220,37 @@ set file(load) 0
%token ORDER_
%token OUT_
%token PAN_
+%token PANTO_
+%token PHYSICAL_
%token PLAY_
+%token PLOT_
%token POINTER_
%token POW_
%token PREV_
-%token PHYSICAL_
+%token PRINT_
+%token PSKY_
+%token PSYSTEM_
+%token RA_
%token RED_
%token REFRESH_
%token REGION_
+%token REGIONS_
%token REPLACE_
%token RESET_
+%token RETRIEVE_
%token RGB_
%token RGBCUBE_
%token RGBIMAGE_
%token ROTATE_
%token ROW_
+%token SAMP_
%token SAMPLE_
%token SAVE_
%token SCALE_
%token SCALELIMITS_
%token SCAN_
%token SCOPE_
+%token SERVER_
%token SEXAGESIMAL_
%token SHOW_
%token SINH_
@@ -233,18 +261,22 @@ set file(load) 0
%token SMOOTH_
%token SQUARED_
%token SQRT_
+%token SORT_
%token STOP_
%token SUM_
%token SURVEY_
+%token SYMBOL_
%token SYSTEM_
%token THREADS_
%token TAG_
%token TO_
%token TRUE_
+%token TSV_
%token UPDATE_
%token USER_
%token VALUE_
%token VIEW_
+%token VOT_
%token VP_
%token WCS_
%token WCSA_
@@ -275,6 +307,7 @@ set file(load) 0
%token WCSZ_
%token WFPC2_
%token X_
+%token XML_
%token XY_
%token Y_
%token YES_
@@ -297,6 +330,7 @@ command : 2MASSCMD_ {2MASSDialog} 2mass
| BLINKCMD_ blink
| BLOCKCMD_ {ProcessRealizeDS9} block
| BLUECMD_ {global current; set current(rgb) blue; RGBChannel}
+ | CATALOGCMD_ catalog
| CDCMD_ cd
| CMAPCMD_ {ProcessRealizeDS9} cmap
| CONSOLECMD_ {global ds9; OpenConsole; InitError $ds9(msg,src)}
@@ -617,6 +651,74 @@ blockTo : int {global block; set block(factor) " $1 $1 "; ChangeBlock}
| FIT_ {BlockToFit}
;
+catalog : {CATTool}
+ | LOAD_ catLoad
+ | FILE_ catLoad
+ | IMPORT_ catLoad
+ | STRING_ cat
+ | cat
+ ;
+
+catLoad: catLoadReader STRING_ {global icats; CATDialog cattool {} {} {} none; CATLoadFn [lindex $icat(cats) end] $2 $1; FileLast catfbox $2}
+ ;
+
+catLoadReader : XML_ {set _ VOTRead}
+ | VOT_ {set _ VOTRead}
+ | SB_ {set _ starbase_read}
+ | STARBASE_ {set _ starbase_read}
+ | CSV_ {set _ TSVRead}
+ | TSV_ {set _ TSVRead}
+ ;
+
+cat :
+ | ALLCOLS_ {set cvar(allrows) 1}
+ | ALLROWS_ {set cvar(allcols) 1}
+ | CANCEL_ {global cvarname; ARCancel $cvarname}
+ | CLEAR_ {global cvarname; CATOff $cvarname}
+ | CLOSE_ {global cvarname; CATDestroy $cvarname}
+ | COORDINATE_ skycoord skyframe {set cvar(x) $yy(x); set cvar(y) $yy(y); set cvar(sky) $yy(skyframe)}
+ | CROSSHAIR_ {global cvarname; CATCrosshair $cvarname}
+ | EDIT_ yesno {global cvarname; set cvar(edit) $2; CATEdit $cvarname}
+ | EXPORT_
+ | FILTER_
+ | HEADER_ {global cvarname; CATHeader $cvarname}
+ | HIDE_ {global cvarname; set cvar(show) 0; CATGenerate $cvarname}
+ | LOCATION_ {global cvarname; set cvar(loc) [lindex $var $i]; CATGenerate $cvarname}
+ | MATCH_
+ | MAXROWS_ int {set cvar(max) $2}
+ | NAME_ STRING_ {set cvar(name) $2}
+ | PANTO_ yesno {set cvar(panto) $2}
+ | PLOT_
+ | PRINT_ {global cvarname; CATPrint $cvarname}
+ | PSKY_ skyframe {global cvarname; set cvar(psky) $2; CATGenerate $cvarname}
+ | PSYSTEM_ wcssys {global cvarname; set cvar(psystem) $2; CATGenerate $cvarname}
+ | REGIONS_ {global cvarname; CATGenerateRegions $cvarname}
+ | RETRIEVE_ {global cvarname; CATApply $cvarname 1}
+ | SAMP_
+ | SAVE_
+ | SERVER_ STRING_ {global cvarname; set cvar(server) $2}
+ | SHOW_ {global cvarname; set cvar(show) 1; CATGenerate $cvarname}
+ | SIZE_
+ | SKY_
+ | SKYFORMAT_ skyformat {set cvar(skyformat) $2}
+ | SORT_ catSort
+ | SYMBOL_
+ | SYSTEM_
+ | UPDATE_ {global cvarname; CATUpdate $cvarname}
+ | X_ STRING_ {global cvarname; set cvar(colx) $2; CATGenerate $cvarname}
+ | RA_ STRING_ {global cvarname; set cvar(colx) $2; CATGenerate $cvarname}
+ | Y_ STRING_ {global cvarname; set cvar(coly) $2; CATGenerate $cvarname}
+ | DEC_ STRING_ {global cvarname; set cvar(coly) $2; CATGenerate $cvarname}
+ ;
+
+catSort : STRING_ {set cvar(sort) $1; CATTable $cvarname}
+ | STRING_ catSortDir {set cvar(sort) $1; set cvar(sort,dir) $2; CATTable $cvarname}
+ ;
+
+catSortDir : INCR_ {set _ "-increasing"}
+ | DECR_ {set _ "-decreasing"}
+ ;
+
cd : STRING_ {cd $2}
| '.' {cd .}
| '/' {cd /}