read BAYER matrix info from FITS files
fix flat file creation