This was a bit tricky to test out but I managed to get started by using fpack to create a real-life compressed file with a NaN. I think we didn't actually previously support this properly in astropy or fitsio. With the reference file included here produced by fpack:
I didn't yet implement the ability to write per-tile different values of ZBLANK but as far as I can tell we didn't expose that before anyway so I don't think it needs to be done (I'm not even sure how one would have written any file out with ZBLANK before).
This was a bit tricky to test out but I managed to get started by using fpack to create a real-life compressed file with a NaN. I think we didn't actually previously support this properly in astropy or fitsio. With the reference file included here produced by fpack:
fitsio:
astropy before this PR:
with this PR
I didn't yet implement the ability to write per-tile different values of ZBLANK but as far as I can tell we didn't expose that before anyway so I don't think it needs to be done (I'm not even sure how one would have written any file out with ZBLANK before).