Skip to content

RuntimeWarning: invalid value encountered in sqrt np.sqrt(1.0 - first_term - second_term)) #34

Description

@tomdertech

This is my first attempt at using shampoo. I am getting the following error with the USAF_test.tif in the repo:

\Anaconda3\lib\site-packages\shampoo-0.1.dev156-py3.5.egg\shampoo\reconstruction.py:419: RuntimeWarning: invalid value encountered in sqrt
np.sqrt(1.0 - first_term - second_term))

The code I am using is here:

from shampoo import Hologram
import matplotlib.pyplot as plt

hologram_path = 'C:\\Users\\xxxxx\\Desktop\\usaf_sqt.tiff'
propagation_distance = 0.03685  # m
h = Hologram.from_tif(hologram_path, wavelength=470e-6, dx=3.5e-6, dy=3.5e-6)
wave = h.reconstruct(propagation_distance)
fig, ax = wave.plot()
fig.suptitle("USAF Target")
fig.tight_layout()
plt.show()

I have tried my own .tif and I get the same result. I have also tried modifying the propagation_distance, wavelength and dx,dy variables, but I get the same problem.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions