@@ -45,11 +45,6 @@ public static SimpleResults create(WebPlotRequest wpr) throws FailedRequestExcep
45
45
return (retList !=null && retList .size ()>0 ) ? retList .get (0 ) : null ;
46
46
}
47
47
48
- // public static List<ImagePlot> createList(WebPlotRequest wpr)
49
- // throws FailedRequestException, GeomException {
50
- // return createList(wpr, PlotState.MultiImageAction.USE_ALL);
51
- // }
52
-
53
48
public static SimpleResults create3Color (WebPlotRequest redRequest ,
54
49
WebPlotRequest greenRequest ,
55
50
WebPlotRequest blueRequest ) throws FailedRequestException , GeomException {
@@ -61,7 +56,7 @@ public static SimpleResults create3Color(WebPlotRequest redRequest,
61
56
if (blueRequest != null ) requestMap .put (BLUE , blueRequest );
62
57
63
58
try {
64
- Results allPlots = build (null , requestMap , PlotState .MultiImageAction .USE_FIRST ,
59
+ Results allPlots = build (requestMap , PlotState .MultiImageAction .USE_FIRST ,
65
60
null , true );
66
61
ImagePlotInfo piAry []= allPlots .getPlotInfoAry ();
67
62
if (piAry !=null && piAry .length >0 ) retval = new SimpleResults (piAry [0 ].getPlot (), piAry [0 ].getFrGroup ());
@@ -77,8 +72,6 @@ public static SimpleResults create3Color(WebPlotRequest redRequest,
77
72
}
78
73
79
74
80
-
81
-
82
75
private static List <SimpleResults > createList (WebPlotRequest wpr , PlotState .MultiImageAction multiAction )
83
76
throws FailedRequestException , GeomException {
84
77
wpr .setProgressKey (null ); // this just makes sure in update progress caching does not happen
@@ -87,7 +80,7 @@ private static List<SimpleResults> createList(WebPlotRequest wpr, PlotState.Mult
87
80
try {
88
81
Map <Band , WebPlotRequest > requestMap = new LinkedHashMap <>(2 );
89
82
requestMap .put (NO_BAND , wpr );
90
- Results allPlots = build (null , requestMap , multiAction , null , false );
83
+ Results allPlots = build (requestMap , multiAction , null , false );
91
84
for (ImagePlotInfo pi : allPlots .getPlotInfoAry ()) retList .add (new SimpleResults (pi .getPlot (),pi .getFrGroup ()));
92
85
} catch (FailedRequestException e ) {
93
86
throw new FailedRequestException ("Could not create plot. " + e .getMessage (), e .getDetailMessage ());
@@ -99,8 +92,7 @@ private static List<SimpleResults> createList(WebPlotRequest wpr, PlotState.Mult
99
92
return retList ;
100
93
}
101
94
102
- static Results build (String workingCtxStr ,
103
- Map <Band , WebPlotRequest > requestMap ,
95
+ static Results build (Map <Band , WebPlotRequest > requestMap ,
104
96
PlotState .MultiImageAction multiAction ,
105
97
PlotState state ,
106
98
boolean threeColor ) throws Exception {
@@ -123,7 +115,7 @@ static Results build(String workingCtxStr,
123
115
// ------------ make the ImagePlot(s)
124
116
ZoomChoice zoomChoice = makeZoomChoice (requestMap , readInfoMap );
125
117
if (state == null ) {
126
- pInfo = makeNewPlots (workingCtxStr , readInfoMap , requestMap , zoomChoice , multiAction , threeColor );
118
+ pInfo = makeNewPlots (readInfoMap , requestMap , zoomChoice , multiAction , threeColor );
127
119
} else {
128
120
pInfo = new ImagePlotInfo [1 ];
129
121
pInfo [0 ] = recreatePlot (state , readInfoMap , zoomChoice );
@@ -145,7 +137,6 @@ static Results buildFromFile(WebPlotRequest request,
145
137
PlotServUtils .updateProgress (request , ProgressStat .PType .CREATING ,
146
138
PlotServUtils .CREATING_MSG );
147
139
long readElapse = System .currentTimeMillis () - readStart ;
148
- // VisContext.shouldContinue(workingCtxStr);
149
140
150
141
151
142
Map <Band , FileReadInfo []> readInfoMap = WebPlotReader .processFitsRead (fileData ,request ,fitsRead ,imageIdx );
@@ -156,8 +147,7 @@ static Results buildFromFile(WebPlotRequest request,
156
147
// ------------ make the ImagePlot(s)
157
148
ZoomChoice zoomChoice = makeZoomChoice (requestMap , readInfoMap );
158
149
if (state == null ) {
159
- pInfo = makeNewPlots (null , readInfoMap , requestMap , zoomChoice , PlotState .MultiImageAction .USE_FIRST , false );
160
- // VisContext.shouldContinue(workingCtxStr);
150
+ pInfo = makeNewPlots (readInfoMap , requestMap , zoomChoice , PlotState .MultiImageAction .USE_FIRST , false );
161
151
} else {
162
152
pInfo = new ImagePlotInfo [1 ];
163
153
pInfo [0 ] = recreatePlot (state , readInfoMap , zoomChoice );
@@ -180,7 +170,7 @@ static private ImagePlotInfo recreatePlot(PlotState state,
180
170
IOException ,
181
171
FitsException ,
182
172
GeomException {
183
- return ImagePlotCreator .makeOneImagePerBand (null , state , readInfoMap , zoomChoice );
173
+ return ImagePlotCreator .makeOneImagePerBand (state , readInfoMap , zoomChoice );
184
174
}
185
175
186
176
@@ -240,8 +230,7 @@ private static Map<Band, FileData> findFiles(Map<Band, WebPlotRequest> requestMa
240
230
* @throws FitsException error creating the fits data
241
231
* @throws GeomException on geom error
242
232
*/
243
- private static ImagePlotInfo [] makeNewPlots (String workingCtxStr ,
244
- Map <Band , FileReadInfo []> readInfoMap ,
233
+ private static ImagePlotInfo [] makeNewPlots (Map <Band , FileReadInfo []> readInfoMap ,
245
234
Map <Band , WebPlotRequest > requestMap ,
246
235
ZoomChoice zoomChoice ,
247
236
PlotState .MultiImageAction multiAction ,
@@ -256,7 +245,7 @@ private static ImagePlotInfo[] makeNewPlots(String workingCtxStr,
256
245
257
246
switch (multiAction ) {
258
247
case GUESS :
259
- plotInfo = makeNewPlots (workingCtxStr , readInfoMap , requestMap , zoomChoice ,
248
+ plotInfo = makeNewPlots (readInfoMap , requestMap , zoomChoice ,
260
249
getActionGuess (threeColor ), threeColor );
261
250
break ;
262
251
case USE_FIRST :
@@ -266,7 +255,7 @@ private static ImagePlotInfo[] makeNewPlots(String workingCtxStr,
266
255
state .setOriginalImageIdx (0 , band );
267
256
state .setImageIdx (0 , band );
268
257
}
269
- plotInfo [0 ] = ImagePlotCreator .makeOneImagePerBand (workingCtxStr , state , readInfoMap , zoomChoice );
258
+ plotInfo [0 ] = ImagePlotCreator .makeOneImagePerBand (state , readInfoMap , zoomChoice );
270
259
break ;
271
260
case USE_IDX :
272
261
WebPlotRequest r = requestMap .get (NO_BAND );
@@ -276,15 +265,15 @@ private static ImagePlotInfo[] makeNewPlots(String workingCtxStr,
276
265
state .setImageIdx (idx , NO_BAND );
277
266
state .setMultiImageFile (true ,Band .NO_BAND );
278
267
//todo: here
279
- plotInfo [0 ] = ImagePlotCreator .makeOneImagePerBand (workingCtxStr , state , readInfoMap , zoomChoice );
268
+ plotInfo [0 ] = ImagePlotCreator .makeOneImagePerBand (state , readInfoMap , zoomChoice );
280
269
break ;
281
270
case USE_ALL :
282
271
if (!readInfoMap .containsKey (NO_BAND ) || threeColor ) {
283
272
throw new FailedRequestException ("Cannot create plot" ,
284
273
"Cannot yet use the MultiImageAction.USE_ALL action with three color" );
285
274
}
286
275
PlotState stateAry [] = makeNoBandMultiImagePlotState (requestMap .get (NO_BAND ), readInfoMap .get (NO_BAND ));
287
- plotInfo = ImagePlotCreator .makeAllNoBand (workingCtxStr , stateAry , readInfoMap .get (NO_BAND ), zoomChoice );
276
+ plotInfo = ImagePlotCreator .makeAllNoBand (stateAry , readInfoMap .get (NO_BAND ), zoomChoice );
288
277
break ;
289
278
case MAKE_THREE_COLOR :
290
279
if (threeColor && readInfoMap .containsKey (NO_BAND )) { // this handles the case of one file with multiple images becoming three color
@@ -299,7 +288,7 @@ private static ImagePlotInfo[] makeNewPlots(String workingCtxStr,
299
288
}
300
289
}
301
290
state = make3ColorState (requestMap , readInfoMap , multiAction );
302
- plotInfo [0 ] = ImagePlotCreator .makeOneImagePerBand (workingCtxStr , state , readInfoMap , zoomChoice );
291
+ plotInfo [0 ] = ImagePlotCreator .makeOneImagePerBand (state , readInfoMap , zoomChoice );
303
292
break ;
304
293
default :
305
294
throw new FailedRequestException ("Plot creation failed" , "unknown multiAction, don't know how to create plot" );
0 commit comments