MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / getHDU

Method getHDU

ij/src/main/java/ij/plugin/FITS_Reader.java:1237–1262  ·  view source on GitHub ↗

Create an OpenDialog, and read in the selected FITS file.

(String path)

Source from the content-addressed store, hash-verified

1235 * Create an {@link OpenDialog}, and read in the selected FITS file.
1236 */
1237 private PostFitsRead getHDU(String path) throws FitsException, IOException {
1238 OpenDialog od = new OpenDialog("Open FITS...", path);
1239 directory = od.getDirectory();
1240 fileName = od.getFileName();
1241 if (fileName == null) {
1242 throw new FitsException("Null filename.");
1243 }
1244 IJ.showStatus("Opening: " + directory + fileName);
1245 //IJ.log("Opening: " + directory + fileName);
1246
1247 FitsFactory.setAllowHeaderRepairs(true);
1248
1249 var fr = getFitsFile(path);
1250 if (fr.hasErrored) return null;
1251 Fits f = null;
1252 try {
1253 f = fr.fits;
1254 var hdus = f.read();
1255 fr.close();
1256
1257 return new PostFitsRead(f, hdus);
1258 } catch (FitsException e) {
1259 closeThing(f);
1260 throw e;
1261 }
1262 }
1263
1264 /**
1265 * Opens a FITS file from the path. If it is in a zip file, it will open the zip

Callers 5

runMethod · 0.95
FitsReaderMethod · 0.45
processFitsMethod · 0.45
processorsFrom3DDataMethod · 0.45

Calls 8

getDirectoryMethod · 0.95
getFileNameMethod · 0.95
showStatusMethod · 0.95
setAllowHeaderRepairsMethod · 0.95
getFitsFileMethod · 0.95
readMethod · 0.95
closeThingMethod · 0.95
closeMethod · 0.65

Tested by

no test coverage detected