From 0ff03fce037f9af13b5f6d6b8e89f02197b2eb98 Mon Sep 17 00:00:00 2001 From: Maik Kahnt Date: Wed, 8 Jan 2025 11:03:08 +0100 Subject: [PATCH] fixed if statement to account for new possible data types of illumination.photons --- ptypy/core/illumination.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ptypy/core/illumination.py b/ptypy/core/illumination.py index c714a597..29cb7e7b 100644 --- a/ptypy/core/illumination.py +++ b/ptypy/core/illumination.py @@ -365,7 +365,7 @@ def init_storage(storage, pars, energy=None, **kwargs): if p.model is None: model = np.ones(s.shape, s.dtype) - if p.photons is not None: + if (type(p.photons) is int) or (type(p.photons) is float): model *= np.sqrt(p.photons) / np.prod(s.shape) elif type(p.model) is np.ndarray: model = p.model