Skip to content

Commit d5b345e

Browse files
author
Lijun Zhang
committed
DM-8548 fixed the wrong deepCoaddId in the image title
1 parent 99a2a3b commit d5b345e

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

src/firefly/js/metaConvert/LsstSdssRequestList.js

Lines changed: 17 additions & 13 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+
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});
@@ -37,14 +38,14 @@ function makeCcdReqBuilder(table, rowIdx) {
3738
const run= getCellValue(table, rowIdx, 'run');
3839
const field= getCellValue(table, rowIdx, 'field');
3940
const camcol= getCellValue(table, rowIdx, 'camcol');
40-
4141
const sr= new ServerRequest('LSSTImageSearch');
4242
sr.setParam('run', `${run}`);
4343
sr.setParam('camcol', `${camcol}`);
4444
sr.setParam('field', `${field}`);
4545

46-
return (plotId, title, filterName) => {
46+
return (plotId, id, filterName) => {
4747
sr.setParam('filterName', `${filterName}`);
48+
const title = id+'-'+filterName;
4849
return makeWebRequest(sr, plotId, title);
4950
};
5051
}
@@ -58,16 +59,18 @@ function makeCcdReqBuilder(table, rowIdx) {
5859
*/
5960
function makeCoadReqBuilder(table, rowIdx) {
6061

61-
62+
const bandMap= {u:0, g:1,r:2,i:3, z:4};
6263
const tract= getCellValue(table, rowIdx, 'tract');
6364
const patch= getCellValue(table, rowIdx, 'patch');
6465

6566
const sr= new ServerRequest('LSSTImageSearch');
6667
sr.setParam('tract', `${tract}`);
6768
sr.setParam('patch', `${patch}`);
6869

69-
return (plotId, title, filterName) => {
70+
return (plotId, id, filterName) => {
7071
sr.setParam('filterName', `${filterName}`);
72+
const deepCoaddId = id + bandMap[filterName];
73+
const title = deepCoaddId+'-'+filterName;
7174
return makeWebRequest(sr, plotId, title);
7275
};
7376
}
@@ -85,14 +88,15 @@ export function makeLsstSdssPlotRequest(table, row, includeSingle, includeStanda
8588

8689
const retval= {};
8790
var builder;
88-
var titleBase;
91+
var id;
8992
if (getCellValue(table, row, 'scienceCcdExposureId')) {
90-
builder= makeCcdReqBuilder(table,row);
91-
titleBase= Number(getCellValue(table, row, 'scienceCcdExposureId'));
93+
builder= makeCcdReqBuilder(table,row);
94+
id= Number(getCellValue(table, row, 'scienceCcdExposureId'));
9295
}
9396
else {
9497
builder= makeCoadReqBuilder(table, row);
95-
titleBase= Number(getCellValue(table, row, 'deepCoaddId'));
98+
const deepCoaddId= Number(getCellValue(table, row, 'deepCoaddId'));
99+
id = deepCoaddId - deepCoaddId%8;
96100

97101
}
98102
const filterId= Number(getCellValue(table, row, 'filterId'));
@@ -104,11 +108,11 @@ export function makeLsstSdssPlotRequest(table, row, includeSingle, includeStanda
104108

105109
if (includeStandard) {
106110
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'),
111+
builder('lsst-sdss-u', id, 'u'),
112+
builder('lsst-sdss-g', id, 'g'),
113+
builder('lsst-sdss-r', id, 'r'),
114+
builder('lsst-sdss-i', id, 'i'),
115+
builder('lsst-sdss-z', id, 'z'),
112116
];
113117
if (retval.standard[filterId]) retval.highlightPlotId= retval.standard[filterId].getPlotId();
114118
}

0 commit comments

Comments
 (0)