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

Computation of noise stats should use dtype=np.float64 #31

Open
david-macmahon opened this issue Feb 24, 2023 · 1 comment
Open

Computation of noise stats should use dtype=np.float64 #31

david-macmahon opened this issue Feb 24, 2023 · 1 comment

Comments

@david-macmahon
Copy link

Computing the mean and std of large frames (e.g. ~16 million points) can suffer from floating point error when they are performed using float32 values. Both mean and std can be passed dtype=np.float64 to perform these computations using float64 instead and thereby retain better accuracy. One place where this could be added is here:

self.noise_mean, self.noise_std = np.mean(clipped_data), np.std(clipped_data)

but perhaps it would be good to add a dtype=np.float64 parameter to the enclosing function so that the user could specify a different type if desired.

@david-macmahon
Copy link
Author

There may be other places where this change could be applicable as well.

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

No branches or pull requests

1 participant