|
9 | 9 | import edu.caltech.ipac.firefly.server.events.FluxAction;
|
10 | 10 | import edu.caltech.ipac.firefly.server.events.ServerEventManager;
|
11 | 11 | import edu.caltech.ipac.firefly.server.util.Logger;
|
12 |
| -import edu.caltech.ipac.firefly.util.WebAssert; |
13 | 12 | import edu.caltech.ipac.firefly.visualize.Band;
|
14 | 13 | import edu.caltech.ipac.firefly.visualize.PlotImages;
|
15 | 14 | import edu.caltech.ipac.firefly.visualize.PlotState;
|
|
27 | 26 | import edu.caltech.ipac.visualize.draw.VectorObject;
|
28 | 27 | import edu.caltech.ipac.visualize.plot.ActiveFitsReadGroup;
|
29 | 28 | import edu.caltech.ipac.visualize.plot.Circle;
|
30 |
| -import edu.caltech.ipac.visualize.plot.CoordinateSys; |
31 | 29 | import edu.caltech.ipac.visualize.plot.FitsRead;
|
32 |
| -import edu.caltech.ipac.visualize.plot.GeomException; |
33 | 30 | import edu.caltech.ipac.visualize.plot.ImageMask;
|
34 | 31 | import edu.caltech.ipac.visualize.plot.ImagePlot;
|
35 | 32 | import edu.caltech.ipac.visualize.plot.PlotGroup;
|
@@ -188,78 +185,78 @@ static PlotImages defineTiles(File imagefileDir,
|
188 | 185 |
|
189 | 186 |
|
190 | 187 |
|
191 |
| - public static File createRotatedFile(FitsRead originalFR, |
192 |
| - String originalFileStr, |
193 |
| - String workingFileStr, |
194 |
| - PlotState.RotateType rotateType, |
195 |
| - double angle, |
196 |
| - CoordinateSys rotNorthType) throws FitsException, IOException, GeomException { |
197 |
| - |
198 |
| - String fStr = originalFileStr != null ? originalFileStr : workingFileStr; |
199 |
| - File originalFile = ServerContext.convertToFile(fStr); |
200 |
| - boolean rotateNorth = (rotateType == PlotState.RotateType.NORTH); |
201 |
| - File f = rotateNorth ? createRotateNorthFile(originalFile, originalFR, rotNorthType) : |
202 |
| - createRotatedAngleFile(originalFile, originalFR, angle); |
203 |
| - return f; |
204 |
| - } |
205 |
| - |
206 |
| - public static File createRotateNorthFile(File originalFile, |
207 |
| - FitsRead originalFR, |
208 |
| - CoordinateSys rotateNorthType) throws FitsException, |
209 |
| - IOException, |
210 |
| - GeomException { |
211 |
| - FitsRead northFR= null; |
212 |
| - if (rotateNorthType.equals(CoordinateSys.GALACTIC)) { |
213 |
| - northFR= FitsRead.createFitsReadNorthUpGalactic(originalFR); |
214 |
| - } |
215 |
| - else if (rotateNorthType.equals(CoordinateSys.EQ_J2000)){ |
216 |
| - northFR= FitsRead.createFitsReadNorthUp(originalFR); |
217 |
| - } |
218 |
| - else { |
219 |
| - WebAssert.argTst(false, "only supports galactic and j2000"); |
220 |
| - |
221 |
| - } |
222 |
| - String fname= originalFile.getName(); |
223 |
| - File f= File.createTempFile(FileUtil.getBase(fname) + "-rot-north", |
224 |
| - "." + FileUtil.FITS, |
225 |
| - ServerContext.getVisSessionDir()); |
226 |
| - BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(f), (int) FileUtil.MEG); |
227 |
| - if (northFR!=null) northFR.writeSimpleFitsFile(stream); |
228 |
| - FileUtil.silentClose(stream); |
229 |
| - return f; |
230 |
| - } |
231 |
| - |
232 |
| - |
233 |
| - public static File createRotatedAngleFile(File originalFile, FitsRead originalFR, double angle) throws FitsException, |
234 |
| - IOException, |
235 |
| - GeomException { |
236 |
| - FitsRead rotateFR= FitsRead.createFitsReadRotated(originalFR, angle, false); |
237 |
| - String fname= originalFile.getName(); |
238 |
| - String angleStr= String.format("%2f", angle); |
239 |
| - File f= File.createTempFile(FileUtil.getBase(fname)+"-rot-"+angleStr, |
240 |
| - "."+FileUtil.FITS, |
241 |
| - ServerContext.getVisSessionDir()); |
242 |
| - BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(f), (int) FileUtil.MEG); |
243 |
| - if (rotateFR!=null) rotateFR.writeSimpleFitsFile(stream); |
244 |
| - FileUtil.silentClose(stream); |
245 |
| - return f; |
246 |
| - } |
247 |
| - |
248 |
| - public static File createFlipYFile(File originalFile, FitsRead originalFR) throws FitsException, |
249 |
| - IOException, |
250 |
| - GeomException { |
251 |
| - FitsRead rotateFR= FitsRead.createFitsReadFlipLR(originalFR); |
252 |
| - String fname= originalFile.getName(); |
253 |
| - String base= FileUtil.getBase(fname); |
254 |
| - int idx= base.indexOf("-flip"); |
255 |
| - if (idx>-1) base= base.substring(0,idx); |
256 |
| - File f= File.createTempFile(base+"-flip", "."+FileUtil.FITS, |
257 |
| - ServerContext.getVisSessionDir()); |
258 |
| - BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(f), (int) FileUtil.MEG); |
259 |
| - rotateFR.writeSimpleFitsFile(stream); |
260 |
| - FileUtil.silentClose(stream); |
261 |
| - return f; |
262 |
| - } |
| 188 | +// public static File createRotatedFile(FitsRead originalFR, |
| 189 | +// String originalFileStr, |
| 190 | +// String workingFileStr, |
| 191 | +// PlotState.RotateType rotateType, |
| 192 | +// double angle, |
| 193 | +// CoordinateSys rotNorthType) throws FitsException, IOException, GeomException { |
| 194 | +// |
| 195 | +// String fStr = originalFileStr != null ? originalFileStr : workingFileStr; |
| 196 | +// File originalFile = ServerContext.convertToFile(fStr); |
| 197 | +// boolean rotateNorth = (rotateType == PlotState.RotateType.NORTH); |
| 198 | +// File f = rotateNorth ? createRotateNorthFile(originalFile, originalFR, rotNorthType) : |
| 199 | +// createRotatedAngleFile(originalFile, originalFR, angle); |
| 200 | +// return f; |
| 201 | +// } |
| 202 | +// |
| 203 | +// public static File createRotateNorthFile(File originalFile, |
| 204 | +// FitsRead originalFR, |
| 205 | +// CoordinateSys rotateNorthType) throws FitsException, |
| 206 | +// IOException, |
| 207 | +// GeomException { |
| 208 | +// FitsRead northFR= null; |
| 209 | +// if (rotateNorthType.equals(CoordinateSys.GALACTIC)) { |
| 210 | +// northFR= FitsRead.createFitsReadNorthUpGalactic(originalFR); |
| 211 | +// } |
| 212 | +// else if (rotateNorthType.equals(CoordinateSys.EQ_J2000)){ |
| 213 | +// northFR= FitsRead.createFitsReadNorthUp(originalFR); |
| 214 | +// } |
| 215 | +// else { |
| 216 | +// WebAssert.argTst(false, "only supports galactic and j2000"); |
| 217 | +// |
| 218 | +// } |
| 219 | +// String fname= originalFile.getName(); |
| 220 | +// File f= File.createTempFile(FileUtil.getBase(fname) + "-rot-north", |
| 221 | +// "." + FileUtil.FITS, |
| 222 | +// ServerContext.getVisSessionDir()); |
| 223 | +// BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(f), (int) FileUtil.MEG); |
| 224 | +// if (northFR!=null) northFR.writeSimpleFitsFile(stream); |
| 225 | +// FileUtil.silentClose(stream); |
| 226 | +// return f; |
| 227 | +// } |
| 228 | +// |
| 229 | +// |
| 230 | +// public static File createRotatedAngleFile(File originalFile, FitsRead originalFR, double angle) throws FitsException, |
| 231 | +// IOException, |
| 232 | +// GeomException { |
| 233 | +// FitsRead rotateFR= FitsRead.createFitsReadRotated(originalFR, angle, true); |
| 234 | +// String fname= originalFile.getName(); |
| 235 | +// String angleStr= String.format("%2f", angle); |
| 236 | +// File f= File.createTempFile(FileUtil.getBase(fname)+"-rot-"+angleStr, |
| 237 | +// "."+FileUtil.FITS, |
| 238 | +// ServerContext.getVisSessionDir()); |
| 239 | +// BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(f), (int) FileUtil.MEG); |
| 240 | +// if (rotateFR!=null) rotateFR.writeSimpleFitsFile(stream); |
| 241 | +// FileUtil.silentClose(stream); |
| 242 | +// return f; |
| 243 | +// } |
| 244 | +// |
| 245 | +// public static File createFlipYFile(File originalFile, FitsRead originalFR) throws FitsException, |
| 246 | +// IOException, |
| 247 | +// GeomException { |
| 248 | +// FitsRead rotateFR= FitsRead.createFitsReadFlipLR(originalFR); |
| 249 | +// String fname= originalFile.getName(); |
| 250 | +// String base= FileUtil.getBase(fname); |
| 251 | +// int idx= base.indexOf("-flip"); |
| 252 | +// if (idx>-1) base= base.substring(0,idx); |
| 253 | +// File f= File.createTempFile(base+"-flip", "."+FileUtil.FITS, |
| 254 | +// ServerContext.getVisSessionDir()); |
| 255 | +// BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(f), (int) FileUtil.MEG); |
| 256 | +// rotateFR.writeSimpleFitsFile(stream); |
| 257 | +// FileUtil.silentClose(stream); |
| 258 | +// return f; |
| 259 | +// } |
263 | 260 |
|
264 | 261 |
|
265 | 262 | public static long getTileModTime(String fname) {
|
|
0 commit comments