def _make_coverage_map(self, coverage_paths): """Make a map with the sum of images covering each pixel.""" configs = dict(self._configs) configs.update({"COMBINE_TYPE": "SUM", "RESAMPLE": "N", "SUBTRACT_BACK": "N"}) name = os.path.basename(os.path.splitext(self._mosaic_path)[0]) \ + ".coverage.fits" swarp = Swarp(coverage_paths, name, configs=configs, workDir=os.path.dirname(self._mosaic_path)) swarp.set_target_fits(self._mosaic_path) swarp.run() coadd_path, coadd_weight_path = swarp.mosaic_paths() os.remove(coadd_weight_path) return coadd_path
def _make_var_sum_map(self, variance_paths, coverage_paths): """Make a map with the sum of variances.""" configs = dict(self._configs) configs.update({"COMBINE_TYPE": "SUM", "RESAMPLE": "N", "WEIGHT_TYPE": "MAP_WEIGHT", "SUBTRACT_BACK": "N"}) name = os.path.basename(os.path.splitext(self._mosaic_path)[0]) \ + ".varsum.fits" swarp = Swarp(variance_paths, name, weightPaths=coverage_paths, configs=configs, workDir=os.path.dirname(self._mosaic_path)) swarp.set_target_fits(self._mosaic_path) swarp.run() coadd_path, coadd_weight_path = swarp.mosaic_paths() os.remove(coadd_weight_path) return coadd_path