Skip to content

Commit 0503b27

Browse files
authored
Firelfy-1597: Merge pull request #1679 from Caltech-IPAC/FIREFLY-1597-null
Firelfy-1597: fixes: things with null ra/dec shouldn't be plotted on coverage map
2 parents 1dfd7b5 + c8ca87e commit 0503b27

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/firefly/java/edu/caltech/ipac/firefly/server/query/SearchServerCommands.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,11 @@ public void processRequest(HttpServletRequest req, HttpServletResponse res, SrvP
145145
else {
146146
for(int i=0; (i<len);i++) {
147147
obj= dg.get(i);
148-
long raVal= (long)((obj.getDouble(raName,0))*pow);
148+
double raD= obj.getDouble(decName,Double.NaN);
149+
long raVal= Double.isNaN(raD) ?Integer.MAX_VALUE : (long)((obj.getDouble(raName,0))*pow);
149150
populateToLittleEndianByte(raVal,raByteAry,i*4);
150-
decAry[i]= (int)((obj.getDouble(decName,0))*pow);
151+
double decD= obj.getDouble(decName,Double.NaN);
152+
decAry[i]= Double.isNaN(decD) ? Integer.MAX_VALUE : (int)(decD*pow);;
151153
}
152154
}
153155

src/firefly/js/tables/HpxIndexCntlr.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ export function getFirstIndex(orderData, norder, tileNumber) {
351351
*/
352352
export function makeHpxWpt(hpxIndexData, idx) {
353353
if (!hpxIndexData?.latAry || !hpxIndexData?.latAry) return;
354+
if (hpxIndexData.lonAry[idx]===0x7fffffff || hpxIndexData.latAry[idx]===0x7fffffff) return null;
354355
return makeWorldPt(
355356
hpxIndexData.lonAry[idx]/UINT_SCALE,
356357
hpxIndexData.latAry[idx]/UINT_SCALE,
@@ -545,7 +546,9 @@ function initOrderData() {
545546
}
546547

547548
function addOrderRow(orderData,lonAry,latAry,rowIdx,csys) {
549+
if (lonAry[rowIdx]===0x7fffffff || latAry[rowIdx]===0x7fffffff) return;
548550
const wp= convertCelestial(makeWorldPt( lonAry[rowIdx]/UINT_SCALE, latAry[rowIdx]/UINT_SCALE, csys));
551+
if (!wp) return;
549552
const pixel= getIpixForWp(wp,DATA_NSIDE);
550553
const tileEntry= getTile(orderData,DATA_NORDER,pixel);
551554
if (tileEntry) {

0 commit comments

Comments
 (0)