try to fix up FITS writer and masking tools for class reader