From 15244b94dc46764ce00731752f850ff7ecef27fc Mon Sep 17 00:00:00 2001 From: James Krieger Date: Tue, 21 Jan 2025 13:18:49 +0100 Subject: [PATCH] init generator for pre and post ctf noise --- xmipp3/protocols/protocol_simulate_ctf.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xmipp3/protocols/protocol_simulate_ctf.py b/xmipp3/protocols/protocol_simulate_ctf.py index 852cd3b28..f7a55efc5 100644 --- a/xmipp3/protocols/protocol_simulate_ctf.py +++ b/xmipp3/protocols/protocol_simulate_ctf.py @@ -121,7 +121,8 @@ def simulateStep(self): if self.noiseBefore>0: I=xmippLib.Image(fnIn) Idata = I.getData() - I.setData(Idata+self.noiseBefore.get()*np.random.Generator.normal(size=Idata.shape)) + generator = np.random.default_rng() + I.setData(Idata+self.noiseBefore.get()*generator.normal(size=Idata.shape)) I.write(fnOut) fnIn=fnOut @@ -142,7 +143,8 @@ def simulateStep(self): if self.noiseAfter>0: I=xmippLib.Image(fnOut) Idata = I.getData() - I.setData(Idata+self.noiseAfter.get()*np.random.Generator.normal(size=Idata.shape)) + generator = np.random.default_rng() + I.setData(Idata+self.noiseAfter.get()*generator.normal(size=Idata.shape)) I.write(fnOut) newCTF = CTFModel()