summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-09-27 21:19:04 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-09-27 21:19:04 (GMT)
commitcc5df79627b75a1fcd807ff73319e1a3d3cb2b63 (patch)
treecc9a0745bdd56072d15f0cea1b258a8fccf8daba
parenteafc6af129cf5f2c71ee4fde54885e0167dd96e5 (diff)
downloadblt-cc5df79627b75a1fcd807ff73319e1a3d3cb2b63.zip
blt-cc5df79627b75a1fcd807ff73319e1a3d3cb2b63.tar.gz
blt-cc5df79627b75a1fcd807ff73319e1a3d3cb2b63.tar.bz2
REGION: use BUNIT keyword if available
-rw-r--r--ds9/doc/release/r8.0.html3
-rw-r--r--ds9/library/markeranalysishist.tcl6
-rw-r--r--ds9/library/markeranalysisplot2d.tcl8
-rw-r--r--ds9/library/markeranalysisplot3d.tcl8
-rw-r--r--tksao/fitsy++/hist.C84
5 files changed, 32 insertions, 77 deletions
diff --git a/ds9/doc/release/r8.0.html b/ds9/doc/release/r8.0.html
index 66d7220..bae86ac 100644
--- a/ds9/doc/release/r8.0.html
+++ b/ds9/doc/release/r8.0.html
@@ -86,6 +86,9 @@ incorrectly calculating an index into the data cube.</tt></li>
<li><tt>09.26.2018 BIN: fixed old style Einstein WCS keyword CRVAL2.</tt></li>
<li><tt><b>09.26.2018 RELEASE version 8.0rc4</b></tt></li>
<li><tt>09.27.2018 CONTOUR: fixed contour parser nlevels problem.</tt></li>
+<li><tt>09.27.2018 REGION: Plot3d- use BUNIT keyword if available.</tt></li>
+<li><tt>09.27.2018 REGION: Plot2d- use BUNIT keyword if available.</tt></li>
+<li><tt>09.27.2018 REGION: Histogram- use BUNIT keyword if available.</tt></li>
<li><tt><b>09.28.2018 RELEASE version 8.0rc5</b></tt></li>
</ol>
</div>
diff --git a/ds9/library/markeranalysishist.tcl b/ds9/library/markeranalysishist.tcl
index 9bb109b..83d57a9 100644
--- a/ds9/library/markeranalysishist.tcl
+++ b/ds9/library/markeranalysishist.tcl
@@ -74,7 +74,11 @@ proc MarkerAnalysisHistogramCB {frame id} {
if {!$ping} {
set tt [string totitle [$frame get marker $id type]]
- PlotLineDialog $vvarname $tt Histogram Values Counts
+ set bunit [string trim [$frame get fits header keyword BUNIT]]
+ if {$bunit=={}} {
+ set bunit {Values}
+ }
+ PlotLineDialog $vvarname $tt Histogram $bunit Counts
set vvar(manage) 0
set vvar(dim) xy
diff --git a/ds9/library/markeranalysisplot2d.tcl b/ds9/library/markeranalysisplot2d.tcl
index 121e948..a8fdf1d 100644
--- a/ds9/library/markeranalysisplot2d.tcl
+++ b/ds9/library/markeranalysisplot2d.tcl
@@ -154,7 +154,11 @@ proc MarkerAnalysisPlot2dCB {frame id} {
if {!$ping} {
set tt [string totitle [$frame get marker $id type]]
- PlotLineDialog $vvarname $tt {} $vvar(system) Counts
+ set vvar(bunit) [string trim [$frame get fits header keyword BUNIT]]
+ if {$vvar(bunit)=={}} {
+ set vvar(bunit) {Counts}
+ }
+ PlotLineDialog $vvarname $tt {} $vvar(system) $vvar(bunit)
MarkerAnalysisPlot2dXAxisTitle $vvarname
MarkerAnalysisPlot2dYAxisTitle $vvarname
@@ -240,7 +244,7 @@ proc MarkerAnalysisPlot2dYAxisTitle {vvarname} {
global $vvarname
# set for plot code
- set vvar(axis,y,title) "Counts [string totitle $vvar(method)]"
+ set vvar(axis,y,title) "$vvar(bunit) [string totitle $vvar(method)]"
# update now (may not make it into plot code)
$vvar(graph) yaxis configure -title $vvar(axis,y,title)
diff --git a/ds9/library/markeranalysisplot3d.tcl b/ds9/library/markeranalysisplot3d.tcl
index e448249..e26dd0b 100644
--- a/ds9/library/markeranalysisplot3d.tcl
+++ b/ds9/library/markeranalysisplot3d.tcl
@@ -152,7 +152,11 @@ proc MarkerAnalysisPlot3dCB {frame id} {
if {!$ping} {
set tt [string totitle [$frame get marker $id type]]
- PlotLineDialog $vvarname $tt {} $vvar(system) Counts
+ set vvar(bunit) [string trim [$frame get fits header keyword BUNIT]]
+ if {$vvar(bunit)=={}} {
+ set vvar(bunit) {Counts}
+ }
+ PlotLineDialog $vvarname $tt {} $vvar(system) $vvar(bunit)
MarkerAnalysisPlot3dXAxisTitle $vvarname
MarkerAnalysisPlot3dYAxisTitle $vvarname
@@ -297,7 +301,7 @@ proc MarkerAnalysisPlot3dYAxisTitle {vvarname} {
global $vvarname
# set for plot code
- set vvar(axis,y,title) "Counts [string totitle $vvar(method)]"
+ set vvar(axis,y,title) "$vvar(bunit) [string totitle $vvar(method)]"
# update now (may not make it into plot code)
$vvar(graph) yaxis configure -title $vvar(axis,y,title)
diff --git a/tksao/fitsy++/hist.C b/tksao/fitsy++/hist.C
index d46307e..2c831fa 100644
--- a/tksao/fitsy++/hist.C
+++ b/tksao/fitsy++/hist.C
@@ -36,11 +36,11 @@ static const char* reservedKeywords[] = {
"GCOUNT","ZGCOUNT",
"CHECKSUM","ZHECKSUM",
"DATASUM","ZDATASUM",
- /* "OBJECT",*/
+ /* "OBJECT", */
"INHERIT",
"BSCALE",
"BZERO","TZERO.",
- "BUNIT","TUNIT.",
+ /* "BUNIT", */ "TUNIT.",
"BLANK",
"DATAMAX","TDMAX.","TLMAX.",
"DATAMIN","TDMIN.","TLMIN.",
@@ -62,14 +62,14 @@ static const char* reservedKeywords[] = {
"PTYPE.","PSCAL.","PZERO.",
"WCSAXES.","WCSAX.?",
- "CTYPE.?",".CTYP.",".CTY.?","TCTYP.","TCTY.?",
- "CUNIT.?",".CUNI.",".CUN.?","TCUNI.","TCUN.?",
- "CRVAL.?",".CRVL.",".CRV.?","TCRVL.","TCRV.?",
- "CDELT.?",".CDLT.",".CDE.?","TCDLT.","TCDE.?",
- "CRPIX.?",".CRPX.",".CRP.?","TCRPX.","TCRP.?",
- "CROTA.",".CROT.","TCROT.",
- "PC._.?","..PC.?","TPC._.?","TP._.?",
- "CD._.?","..CD.?","TCD._.?","TC._.?",
+ /* "CTYPE.?", */ ".CTYP.",".CTY.?","TCTYP.","TCTY.?",
+ /* "CUNIT.?", */ ".CUNI.",".CUN.?","TCUNI.","TCUN.?",
+ /* "CRVAL.?", */ ".CRVL.",".CRV.?","TCRVL.","TCRV.?",
+ /* "CDELT.?", */ ".CDLT.",".CDE.?","TCDLT.","TCDE.?",
+ /* "CRPIX.?", */ ".CRPX.",".CRP.?","TCRPX.","TCRP.?",
+ /* "CROTA.", */ ".CROT.","TCROT.",
+ /* "PC._.?", */ "..PC.?","TPC._.?","TP._.?",
+ /* "CD._.?", */ "..CD.?","TCD._.?","TC._.?",
"PV._.?",".PV._.?",".V._.?","TPV._.?","TV._.?",
".V._X?",
"PS._.?",".PS._.?",".S._.?","TPS._.?","TS._.?",
@@ -632,69 +632,9 @@ void FitsHist::initWCS(FitsFile* fits, Matrix& mm, Vector block)
mapWCSReal(srcHead, "MJD-OBS", "MJDOB");
if (!head_->find("RADESYS"))
mapWCSString(srcHead, w, "RADESYS", "RADE");
- }
-
- // and finally, check for old Einstein type WCS
- char key[8];
-
- // CTYPEx
- strcpy(key,"CTYPE1");
- if (srcHead->find(key)) {
- char* str = srcHead->getString(key);
- head_->appendString(key, str, NULL);
- }
- strcpy(key,"CTYPE2");
- if (srcHead->find(key)) {
- char* str = srcHead->getString(key);
- head_->appendString(key, str, NULL);
- }
-
- // CRVALx
- strcpy(key,"CRVAL1");
- if (srcHead->find(key)) {
- float cc = srcHead->getReal(key, 0);
- head_->appendReal(key, cc, 10, NULL);
- }
- strcpy(key,"CRVAL2");
- if (srcHead->find(key)) {
- float cc = srcHead->getReal(key, 0);
- head_->appendReal(key, cc, 10, NULL);
- }
- //CRPIXx
- strcpy(key,"CRPIX1");
- if (srcHead->find(key)) {
- float cc = srcHead->getReal(key, 0);
- head_->appendReal(key, cc, 10, NULL);
- }
- strcpy(key,"CRPIX2");
- if (srcHead->find(key)) {
- float cc = srcHead->getReal(key, 0);
- head_->appendReal(key, cc, 10, NULL);
- }
-
- // CDELTx
- strcpy(key,"CDELT1");
- if (srcHead->find(key)) {
- float cc = srcHead->getReal(key, 0);
- head_->appendReal(key, cc, 10, NULL);
- }
- strcpy(key,"CDELT2");
- if (srcHead->find(key)) {
- float cc = srcHead->getReal(key, 0);
- head_->appendReal(key, cc, 10, NULL);
- }
-
- // CROTAx
- strcpy(key,"CROTA1");
- if (srcHead->find(key)) {
- float cc = srcHead->getReal(key, 0);
- head_->appendReal(key, cc, 10, NULL);
- }
- strcpy(key,"CROTA2");
- if (srcHead->find(key)) {
- float cc = srcHead->getReal(key, 0);
- head_->appendReal(key, cc, 10, NULL);
+ // general
+ mapWCSString(srcHead, w, "BUNIT", "TUNIT");
}
}