afw::image::Image(str,hdu) and afw::image::Mask(str,hdu) both use 1-indexing for HDU counting when reading FITS, with “magic” treatment of hdu=0. This is entirely nonstandard (who 1-indexes FITS files?), and very confusing (specify 0 and you get data, specify 1 and you get an exception, because 0 is empty).
Why is it done this way, and can we please fix it?
See the docs: