@@ -8,6 +8,7 @@ import {ZoomType} from '../visualize/ZoomType.js';
8
8
import { WebPlotRequest , TitleOptions } from '../visualize/WebPlotRequest.js' ;
9
9
import { ServerRequest } from '../data/ServerRequest.js' ;
10
10
import { ServerParams } from '../data/ServerParams.js' ;
11
+ import { toMaxFixed } from '../util/MathUtil.js' ;
11
12
12
13
/**
13
14
* This method returns a WebRequest object
@@ -17,6 +18,9 @@ import {ServerParams} from '../data/ServerParams.js';
17
18
* @returns {WebPlotRequest } a web plot request
18
19
*/
19
20
const bandMap = { u :0 , g :1 , r :2 , i :3 , z :4 } ;
21
+
22
+ const DECDIGIT = 4 ;
23
+
20
24
function makeWebRequest ( sr , plotId , title ) {
21
25
const r = WebPlotRequest . makeProcessorRequest ( sr , 'lsst-sdss' ) ;
22
26
const rangeValues = RangeValues . makeRV ( { which :SIGMA , lowerValue :- 2 , upperValue :10 , algorithm :STRETCH_LINEAR } ) ;
@@ -56,7 +60,8 @@ function makeCcdReqBuilder(table, rowIdx) {
56
60
return ( plotId , id , filterName ) => {
57
61
sr . setParam ( 'filterName' , `${ filterName } ` ) ;
58
62
const scienceCCCdId = id . toString ( ) ;
59
- const title = scienceCCCdId . substr ( 0 , 4 ) + bandMap [ filterName ] . toString ( ) + scienceCCCdId . substr ( 5 , 10 ) + '-' + filterName + ( subsize ? ` size: ${ subsize } (deg)` : '' ) ;
63
+ const title = scienceCCCdId . substr ( 0 , 4 ) + bandMap [ filterName ] . toString ( ) + scienceCCCdId . substr ( 5 , 10 ) +
64
+ '-' + filterName + ( subsize ? ` size: ${ toMaxFixed ( subsize , DECDIGIT ) } (deg)` : '' ) ;
60
65
return makeWebRequest ( sr , plotId , title ) ;
61
66
} ;
62
67
}
@@ -87,7 +92,7 @@ function makeCoadReqBuilder(table, rowIdx) {
87
92
return ( plotId , id , filterName ) => {
88
93
sr . setParam ( 'filterName' , `${ filterName } ` ) ;
89
94
const deepCoaddId = id + bandMap [ filterName ] ;
90
- const title = deepCoaddId + '-' + filterName + ( subsize ? ` size: ${ subsize } (deg)` : '' ) ;
95
+ const title = deepCoaddId + '-' + filterName + ( subsize ? ` size: ${ toMaxFixed ( subsize , DECDIGIT ) } (deg)` : '' ) ;
91
96
return makeWebRequest ( sr , plotId , title ) ;
92
97
} ;
93
98
}
0 commit comments