Skip to content

Commit e71d2ae

Browse files
authored
Merge pull request #262 from Caltech-IPAC/DM-8548-addMoreInfo
DM-8548 fixed the wrong deepCoaddId in the image title
2 parents 1a093fe + f3da63b commit e71d2ae

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/firefly/js/metaConvert/LsstSdssRequestList.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {ServerRequest} from '../data/ServerRequest.js';
1414
* @param title - {String}
1515
* @returns {WebPlotRequest} a web plot request
1616
*/
17+
const bandMap= {u:0, g:1,r:2,i:3, z:4};
1718
function makeWebRequest(sr, plotId, title) {
1819
const r = WebPlotRequest.makeProcessorRequest(sr, 'lsst-sdss');
1920
const rangeValues= RangeValues.makeRV({which:SIGMA, lowerValue:-2, upperValue:10, algorithm:STRETCH_LINEAR});
@@ -43,8 +44,10 @@ function makeCcdReqBuilder(table, rowIdx) {
4344
sr.setParam('camcol', `${camcol}`);
4445
sr.setParam('field', `${field}`);
4546

46-
return (plotId, title, filterName) => {
47+
return (plotId, id, filterName) => {
4748
sr.setParam('filterName', `${filterName}`);
49+
const scienceCCCdId = id.toString();
50+
const title =scienceCCCdId.substr(0, 4) + bandMap[filterName].toString() + scienceCCCdId.substr(5, 10)+'-'+filterName;
4851
return makeWebRequest(sr, plotId, title);
4952
};
5053
}
@@ -66,8 +69,10 @@ function makeCoadReqBuilder(table, rowIdx) {
6669
sr.setParam('tract', `${tract}`);
6770
sr.setParam('patch', `${patch}`);
6871

69-
return (plotId, title, filterName) => {
72+
return (plotId, id, filterName) => {
7073
sr.setParam('filterName', `${filterName}`);
74+
const deepCoaddId = id + bandMap[filterName];
75+
const title = deepCoaddId+'-'+filterName;
7176
return makeWebRequest(sr, plotId, title);
7277
};
7378
}
@@ -85,14 +90,15 @@ export function makeLsstSdssPlotRequest(table, row, includeSingle, includeStanda
8590

8691
const retval= {};
8792
var builder;
88-
var titleBase;
93+
var id;
8994
if (getCellValue(table, row, 'scienceCcdExposureId')) {
90-
builder= makeCcdReqBuilder(table,row);
91-
titleBase= Number(getCellValue(table, row, 'scienceCcdExposureId'));
95+
builder= makeCcdReqBuilder(table,row);
96+
id= Number(getCellValue(table, row, 'scienceCcdExposureId'));
9297
}
9398
else {
9499
builder= makeCoadReqBuilder(table, row);
95-
titleBase= Number(getCellValue(table, row, 'deepCoaddId'));
100+
const deepCoaddId= Number(getCellValue(table, row, 'deepCoaddId'));
101+
id = deepCoaddId - deepCoaddId%8;
96102

97103
}
98104
const filterId= Number(getCellValue(table, row, 'filterId'));
@@ -104,11 +110,11 @@ export function makeLsstSdssPlotRequest(table, row, includeSingle, includeStanda
104110

105111
if (includeStandard) {
106112
retval.standard= [
107-
builder('lsst-sdss-u', titleBase+'-u', 'u'),
108-
builder('lsst-sdss-g', titleBase+'-g', 'g'),
109-
builder('lsst-sdss-r', titleBase+'-r', 'r'),
110-
builder('lsst-sdss-i', titleBase+'-i', 'i'),
111-
builder('lsst-sdss-z', titleBase+'-z', 'z'),
113+
builder('lsst-sdss-u', id, 'u'),
114+
builder('lsst-sdss-g', id, 'g'),
115+
builder('lsst-sdss-r', id, 'r'),
116+
builder('lsst-sdss-i', id, 'i'),
117+
builder('lsst-sdss-z', id, 'z'),
112118
];
113119
if (retval.standard[filterId]) retval.highlightPlotId= retval.standard[filterId].getPlotId();
114120
}

0 commit comments

Comments
 (0)