summaryrefslogtreecommitdiffstats
path: root/ds9/library
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-06-30 19:44:08 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-06-30 19:44:08 (GMT)
commitfd9d256458fd64e5d63c161fde2080761b9ea6bb (patch)
tree90b5d6b5fde3e60f6636d645d694498988439027 /ds9/library
parentee1070fe1103bfcada7fe5c3b40a68352f05f53d (diff)
downloadblt-fd9d256458fd64e5d63c161fde2080761b9ea6bb.zip
blt-fd9d256458fd64e5d63c161fde2080761b9ea6bb.tar.gz
blt-fd9d256458fd64e5d63c161fde2080761b9ea6bb.tar.bz2
update parser scale
Diffstat (limited to 'ds9/library')
-rw-r--r--ds9/library/lex.fcl14
-rw-r--r--ds9/library/parser.tac92
2 files changed, 95 insertions, 11 deletions
diff --git a/ds9/library/lex.fcl b/ds9/library/lex.fcl
index 8f683e7..cd9dcc8 100644
--- a/ds9/library/lex.fcl
+++ b/ds9/library/lex.fcl
@@ -33,17 +33,26 @@ compass {return $::COMPASS_}
coord {return $::COORD_}
crosshair {return $::CROSSHAIR_}
current {return $::CURRENT_}
+datasec {return $::DATASEC_}
degrees {return $::DEGREES_}
elevation {return $::ELEVATION_}
el {return $::ELEVATION_}
+exp {return $::EXP_}
false {return $::FALSE_}
frame {return $::FRAME_}
+global {return $::GLOBAL_}
highlite {return $::HIGHLITE_}
histequ {return $::HISTEQU_}
linear {return $::LINEAR_}
+limits {return $::LIMITS_}
+local {return $::LOCAL_}
+lock {return $::LOCK_}
log {return $::LOG_}
+match {return $::MATCH_}
method {return $::METHOD_}
+minmax {return $::MINMAX_}
mip {return $::MIP_}
+mode {return $::MODE_}
name {return $::NAME_}
new {return $::NEW_}
no {return $::NO_}
@@ -54,6 +63,8 @@ open {return $::OPEN_}
pow {return $::POW_}
save {return $::SAVE_}
scale {return $::SCALE_}
+scalelimits {return $::SCALELIMITS_}
+scope {return $::SCOPE_}
sexagesimal {return $::SEXAGESIMAL_}
sinh {return $::SINH_}
size {return $::SIZE_}
@@ -62,9 +73,12 @@ sqrt {return $::SQRT_}
survey {return $::SURVEY_}
true {return $::TRUE_}
update {return $::UPDATE_}
+user {return $::USER_}
view {return $::VIEW_}
vp {return $::VIEW_}
yes {return $::YES_}
+zscale {return $::ZSCALE_}
+zmax {return $::ZMAX_}
# INT
[+-]?{D}+ {set ::yylval $yytext; return $::INT_}
diff --git a/ds9/library/parser.tac b/ds9/library/parser.tac
index 1ab16ba..58b8924 100644
--- a/ds9/library/parser.tac
+++ b/ds9/library/parser.tac
@@ -27,16 +27,25 @@
%token COORD_
%token CROSSHAIR_
%token CURRENT_
+%token DATASEC_
%token DEGREES_
%token ELEVATION_
+%token EXP_
%token FALSE_
%token FRAME_
+%token GLOBAL_
%token HIGHLITE_
%token HISTEQU_
+%token LIMITS_
%token LINEAR_
+%token LOCAL_
+%token LOCK_
%token LOG_
+%token MATCH_
%token METHOD_
+%token MINMAX_
%token MIP_
+%token MODE_
%token NAME_
%token NEW_
%token NO_
@@ -47,6 +56,8 @@
%token POW_
%token SAVE_
%token SCALE_
+%token SCALELIMITS_
+%token SCOPE_
%token SEXAGESIMAL_
%token SINH_
%token SIZE_
@@ -55,8 +66,11 @@
%token SURVEY_
%token TRUE_
%token UPDATE_
+%token USER_
%token VIEW_
%token YES_
+%token ZSCALE_
+%token ZMAX_
%%
@@ -75,6 +89,7 @@ command : 2MASS_ {2MASSDialog} 2mass
| LINEAR_ {global scale; set scale(type) linear; ChangeScale}
| LOG_ {global scale; set scale(type) log; ChangeScale}
| POW_ {global scale; set scale(type) pow; ChangeScale}
+ | SCALE_ scale
| SINH_ {global scale; set scale(type) sinh; ChangeScale}
| SQUARED_ {global scale; set scale(type) squared; ChangeScale}
| SQRT_ {global scale; set scale(type) sqrt; ChangeScale}
@@ -112,17 +127,17 @@ optDeg : {set _ degrees}
;
2mass : {IMGSVRApply dtwomass 1}
- | OPEN_ {}
- | CLOSE_ {ARDestroy dtwomass}
+ | STRING_ {global dtwomass; set dtwomass(name) $1; IMGSVRApply dtwomass 1}
+ | NAME_ STRING_ {global dtwomass; set dtwomass(name) $2; IMGSVRApply dtwomass 1}
+ | COORD_ 2massCoord {IMGSVRApply dtwomass 1}
+ | SIZE_ 2massSize
| SAVE_ yesno {global dtwomass; set dtwomass(save) $2}
| FRAME_ newCurrent {global dtwomass; set dtwomass(mode) $2}
- | SIZE_ 2massSize
- | SURVEY_ 2massSurvey {global dtwomass; set dtwomass(survey) $2}
| UPDATE_ FRAME_ {IMGSVRUpdate dtwomass; IMGSVRApply dtwomass 1}
| UPDATE_ CROSSHAIR_ {IMGSVRCrosshair dtwomass; IMGSVRApply dtwomass 1}
- | COORD_ 2massCoord {IMGSVRApply dtwomass 1}
- | NAME_ STRING_ {global dtwomass; set dtwomass(name) $2; IMGSVRApply dtwomass 1}
- | STRING_ {global dtwomass; set dtwomass(name) $1; IMGSVRApply dtwomass 1}
+ | SURVEY_ 2massSurvey {global dtwomass; set dtwomass(survey) $2}
+ | OPEN_ {}
+ | CLOSE_ {ARDestroy dtwomass}
;
2massCoord : SEXSTR_ SEXSTR_ optSex {
@@ -161,17 +176,17 @@ optDeg : {set _ degrees}
;
3d : {Create3DFrame}
- | OPEN_ {}
- | CLOSE_ {3DDestroyDialog}
+ | VIEW_ numeric numeric {global threed; set threed(az) $2; set threed(el) $3; 3DViewPoint}
| AZIMUTH_ numeric {global threed; set threed(az) $2; 3DViewPoint}
| ELEVATION_ numeric {global threed; set threed(el) $2; 3DViewPoint}
- | VIEW_ numeric numeric {global threed; set threed(az) $2; set threed(el) $3; 3DViewPoint}
| SCALE_ numeric {global threed; set threed(scale) $2; 3DScale}
| METHOD_ 3dMethod {global threed; set threed(method) $2; 3DRenderMethod}
| BACKGROUND_ 3dBackground {global threed; set threed(background) $2; 3DBackground}
- | HIGHLITE_ 3dHighlite
| BORDER_ 3dBorder
+ | HIGHLITE_ 3dHighlite
| COMPASS_ 3dCompass
+ | OPEN_ {}
+ | CLOSE_ {3DDestroyDialog}
;
3dMethod : MIP_ {set _ mip}
@@ -208,5 +223,60 @@ analysis : {puts "*** ANALYSIS ***"}
array : {puts "*** ARRAY ***"}
;
+scale : scaleScales {global scale; set scale(type) $1; ChangeScale}
+ | LOG_ scaleLog
+ | DATASEC_ yesno
+ | LIMITS_ scaleLimits
+ | SCALELIMITS_ scaleLimits
+ | MINMAX_ {global scale; set scale(mode) minmax; ChangeScaleMode}
+ | ZSCALE_ {global scale; set scale(mode) zscale; ChangeScaleMode}
+ | ZMAX_ {global scale; set scale(mode) zmax; ChangeScaleMode}
+ | USER_ {global scale; set scale(mode) user; ChangeScaleMode}
+ | MODE_ scaleMode {global scale; set scale(mode) $2; ChangeScaleMode}
+ | MODE_ numeric {global scale; set scale(mode) $2; ChangeScaleMode}
+ | LOCAL_ {global scale; set scale(scope) local; ChangeScaleScope}
+ | GLOBAL_ {global scale; set scale(scope) global; ChangeScaleScope}
+ | SCOPE_ scaleScope {global scale; set scale(scope) $2; ChangeScaleScope}
+ | MATCH_ {MatchScaleCurrent}
+ | MATCH_ LIMITS_ {MatchScaleLimitsCurrent}
+ | MATCH_ SCALELIMITS_ {MatchScaleLimitsCurrent}
+ | LOCK_ {global scale; set scale(lock) 1; LockScaleCurrent}
+ | LOCK_ yesno {global scale; set scale(lock) $2; LockScaleCurrent}
+ | LOCK_ LIMITS_ {global scale; set scale(lock,limits) 1; LockScaleLimitsCurrent}
+ | LOCK_ LIMITS_ scaleLockLimits
+ | LOCK_ SCALELIMITS_ {global scale; set scale(lock,limits) 1; LockScaleLimitsCurrent}
+ | LOCK_ SCALELIMITS_ scaleLockLimits
+ | OPEN_ {ScaleDialog}
+ | CLOSE_ {ScaleDestroyDialog}
+ ;
+
+scaleScales : LINEAR_ {set _ linear}
+ | POW_ {set _ pow}
+ | SQRT_ {set _ sqrt}
+ | SQUARED_ {set _ squared}
+ | ASINH_ {set _ asinh}
+ | SINH_ {set _ sinh}
+ | HISTEQU_ {set _ histequ}
+ ;
+
+scaleLog : {global scale; set scale(type) log; ChangeScale}
+ | EXP_ numeric {global scale; set scale(log) $2; ChangeScale}
+ ;
+
+scaleLimits: numeric numeric {global scale; set scale(min) $1; set scale(max) $2; ChangeScaleLimit}
+ ;
+
+scaleLockLimits : yesno {global scale; set scale(lock,limits) $1; LockScaleLimitsCurrent}
+ ;
+
+scaleMode : MINMAX_ {set _ minmax}
+ | ZSCALE_ {set _ zscale}
+ | ZMAX_ {set _ zmax}
+ ;
+
+scaleScope : LOCAL_ {set _ local}
+ | GLOBAL_ {set _ global}
+ ;
+
%%