def _get_resolution_masker(beam, panel): t0 = time.perf_counter() masker = ResolutionMaskGenerator(beam, panel) t1 = time.perf_counter() logger.debug( f"ResolutionMaskGenerator calculation took {t1 - t0:.4f} seconds") return masker
def _get_resolution_masker(beam, panel): logger.debug("resolution masker cache miss") return ResolutionMaskGenerator(beam, panel)
def __call__(self): if self.result is None: self.result = ResolutionMaskGenerator(beam, panel) return self.result
def mask_resolution(*args): if not hasattr(mask_resolution, "masker"): mask_resolution.masker = ResolutionMaskGenerator( beam, panel) mask_resolution.masker.apply(mask, *args)