<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _scale_srcmap(self, scale_map, check_header=True, names=None):
 """Apply exposure corrections to the source map file. Parameters scale_map : dict Dictionary of exposure corrections. check_header : bool Check EXPSCALE header keyword to see if an exposure correction has already been applied to this source. names : list, optional Names of sources to which the exposure correction will be applied. If None then all sources will be corrected. """


        srcmap = fits.open(self.files['srcmap'])

        for hdu in srcmap[1:]:
            if hdu.name not in scale_map:
                continue
            if names is not None and hdu.name not in names:
                continue

            scale = scale_map[hdu.name]
            if scale < 1e-20:
                self.logger.warning(
                    "The expscale parameter was zero, setting it to 1e-8")
                scale = 1e-8
            if 'EXPSCALE' in hdu.header and check_header:
                old_scale = hdu.header['EXPSCALE']
            else:
                old_scale = 1.0
            hdu.data *= scale / old_scale
            hdu.header['EXPSCALE'] = (scale,
                                      'Exposure correction applied to this map')

        srcmap.writeto(self.files['srcmap'], overwrite=True)
        srcmap.close()

        # Force reloading the map from disk
        for name in scale_map.keys():
            self.like.logLike.eraseSourceMap(str(name))
        self.like.logLike.buildFixedModelWts()