def write_model_map(self, model_name=None, name=None):
        """Save counts model map to a FITS file.

        """

        if model_name is None:
            suffix = self.config['file_suffix']
        else:
            suffix = '_%s%s' % (model_name, self.config['file_suffix'])

        self.logger.info('Generating model map for component %s.', self.name)

        outfile = os.path.join(self.config['fileio']['workdir'],
                               'mcube%s.fits' % (suffix))

        cmap = self.model_counts_map(name, use_mask=False)
        cmap.write(outfile, overwrite=True, conv='fgst-ccube')
        return cmap
Save counts model map to a FITS file.