Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init generator for pre and post ctf noise #883

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions xmipp3/protocols/protocol_simulate_ctf.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@
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()

Check notice

Code scanning / SonarCloud

Results that depend on random number generation should be reproducible Low

Provide a seed for this random generator. See more on SonarQube Cloud
I.setData(Idata+self.noiseBefore.get()*generator.normal(size=Idata.shape))
I.write(fnOut)
fnIn=fnOut

Expand All @@ -142,7 +143,8 @@
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()

Check notice

Code scanning / SonarCloud

Results that depend on random number generation should be reproducible Low

Provide a seed for this random generator. See more on SonarQube Cloud
I.setData(Idata+self.noiseAfter.get()*generator.normal(size=Idata.shape))
I.write(fnOut)

newCTF = CTFModel()
Expand Down
Loading