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

Conversation

jamesmkrieger
Copy link
Contributor

Fixes #882

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@@ -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
@@ -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
@jamesmkrieger
Copy link
Contributor Author

A potential sanity test from my log likelihood analysis:

I simulated projections from 2 volumes converted from pdbs of the spike in different conformations and am looking at how the sums of square residuals, which are the simplest part of the log likelihood equation, are affected by various operations.

  • when I normalise synthetic projections after simulating the CTF without noise, I get sums of square residuals from reprojections of two volumes that are rather even. They have small differences that can be captured by normalisation by the mean over volumes
  • when I add noise with a separate add noise protocol using Gaussian noise with standard deviation 1.0 before simulating CTF and when I use the pre-CTF noise option here with sigma 1.0, I get the same behaviour that normalising the images does not flatten the sums of square residuals.

Simulate CTF + preprocess norm, no noise
image

Add noise + simulate CTF (separate protocols) + preprocess norm
image

Simulate CTF with pre-CTF (same protocol) + preprocess norm
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simulating CTF with pre-CTF noise doesn't work
1 participant