try {
ImageTiler tiler = getTiler();
Object tile = tiler.getTile(offset, size);
ret = new ImageHDU(this.getHeader(), new ImageData(tile));
Header retHeader = ret.getHeader();
for (int i = 0; i < offset.length; i++) {
retHeader.addValue(Header.NAXIS + (i + 1), size[i], "Axis "
+ (i + 1) + " size");
double crpix = retHeader.getDoubleValue(CRPIX + (i + 1),
Double.NaN);
if (!Double.isNaN(crpix)) {
retHeader.addValue(CRPIX + (i + 1), crpix - offset[i],
"WCS reference point coordinate");
}
}
} catch (IOException ioex) {
throw new FitsException(ioex.toString());