summaryrefslogtreecommitdiffstats
path: root/tksao/fitsy++
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-06-01 18:53:02 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-06-01 18:53:02 (GMT)
commit26eb0121a4bdabe9ba965363634cfc314ba0bd0a (patch)
tree340818193c31fffb73261eed5fe8b586e2396f93 /tksao/fitsy++
parent77573989e854e6b75d0ed0d06ba708941c0c3b2e (diff)
downloadblt-26eb0121a4bdabe9ba965363634cfc314ba0bd0a.zip
blt-26eb0121a4bdabe9ba965363634cfc314ba0bd0a.tar.gz
blt-26eb0121a4bdabe9ba965363634cfc314ba0bd0a.tar.bz2
fix HealPix NESTED
Diffstat (limited to 'tksao/fitsy++')
-rw-r--r--tksao/fitsy++/hpx.C14
1 files changed, 13 insertions, 1 deletions
diff --git a/tksao/fitsy++/hpx.C b/tksao/fitsy++/hpx.C
index 0078858..7b5e7ef 100644
--- a/tksao/fitsy++/hpx.C
+++ b/tksao/fitsy++/hpx.C
@@ -148,6 +148,8 @@ void FitsHPX::build(FitsFile* fits)
FitsHead* head = fits->head();
FitsTableHDU* hdu = (FitsTableHDU*)(head->hdu());
int rowlen = hdu->width();
+ int nrow = hdu->rows();
+ int repeat = col_->repeat();
char* data = (char*)fits->data();
int nside = nside_;
@@ -213,9 +215,19 @@ void FitsHPX::build(FitsFile* fits)
}
// Gather data into the output vector.
+ /*
long* healp = healidx;
for (float* rowp = row; rowp < row+nside; rowp++)
- *rowp = col_->value(data+*(healp++)*rowlen,0);
+ *rowp = col_->value(data+*(healp++),0);
+ */
+ for (int ii=0; ii<nside_; ii++) {
+ int aa = healidx[ii]/repeat;
+ int bb = healidx[ii] - (aa*repeat);
+ if (aa<nrow)
+ row[ii] = col_->value(data+aa*rowlen,bb);
+ else
+ row[ii] = 0;
+ }
// Apply blanking to halved facets.
if (halve) {