Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def reconstruct(self, height=None, max_l=None, clamp_negative=True):
"""
:height: height of the reconstructed image
:clamp_negative: Remove reconstructed values under 0
"""
retval = []
for i in range(len(self.coeffs)):
retval.append(MakeGridDH(self.coeffs[i], norm=self.norm, sampling=2, lmax=height, lmax_calc=max_l))
retval = np.asarray(retval).transpose((1,2,0))
if clamp_negative:
retval = np.maximum(retval, 0)
return retval