Skip to content

Conversation

@JacobTh98
Copy link
Contributor

If a complex perm value like perm = 100 + 10j was assigned to an anomaly, the resulting simulated voltages of the forward EIT model were real valued. This is also because of the initialized array in fem.py line 120:

result = np.empty((ex_mat.shape[0], self.kg.shape[0]))

This PR simply changes the data type of the NumPy array to complex.
Finally, the output values for the simulated forward EIT model will be complex.
The following warning will no longer appear:

For the reconstruction algorithms still the following warning will still appear:
ComplexWarning: Casting complex values to real discards the imaginary part
jac[:, e] = np.sum(np.dot(ri[:, ijk], self.se[e]) * f_n[:, ijk], axis=1)

Copy link
Collaborator

@liubenyuan liubenyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please also fix the linting error on line 603 of quality/merit.py by replacing np.NaN with np.nan?

@JacobTh98
Copy link
Contributor Author

After replacing np.NaN with np.nan one after the other, the linting process runs through.

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.

2 participants