GalSim-developers/GalSim — pull request #144 by rmjarvis (2012-05-10 19:14:02+00:00)
Title: #102 Add multi-image FITS I/O functions

Four new functions and some mild clean up of the previous FITS I/O functions:
- These read/write multi-extension fits files with each image in a separate hdu:
```
readMulti(fits)
writeMulti(image_list, fits, add_wcs=True, clobber=True)
```
- These read/write fits data cubes. i.e. a 3-d array all in one hdu:
```
readCube(fits)
writeCube(image_list, fits, add_wcs=True, clobber=True):
```
- Removed the confusing read as a static method of Image and ImageView classes. This was confusing because it doesn't necessarily return the type specified. Rather the data type is determined from the fits file being read, not the class being used to call the function. Everyone who used the function used the `galsim.fits.read` syntax, so it was pretty painless to remove.
- Added the CD matrix to the WCS being written to the fits headers. Considering that this was extolled as an advantage to keeping the pixel size in the Image classes, it seemed like we should actually implement it.
- Added unit tests for the write function as well as all the new ones. (Only read had been unit tested, comparing the read values to a reference image.)