Comments (5)
Is arctan significantly faster than arctan2?
from shampoo.
I don't know, @jkentwallace had opinions though.
from shampoo.
LaurentRDC and bmorris3, I was concerned not so much about efficiency. Reading through Emilio's original writeup, (in which he used Matlab) he had a comment about using atan(z) vs atan2(y,x). Problem is that atan only goes from -p/2 to +pi/2, whereas atan2 goes from -pi to pi. (That's because in the ratio of x/y = z, not knowing the sign of x and/or y precludes getting the angle in the correct quadrant.)
Quick question: does python support a function called Arg[a + i b]? Arg[] will return the phase angle of a complex number.
from shampoo.
@jkentwallace I believe what you're looking for is implemented in numpy.angle
, which returns
the counterclockwise angle from the positive real axis on the complex plane
from shampoo.
Yes! That's it. Basically, this is the same as atan2. However, for those who might be lazy - ahem - you don't need to do atan2[imaginary,real], but just np.angle([]) instead.
Just a thought...
from shampoo.
Related Issues (17)
- Reconstruction of non-square holograms raises error HOT 7
- Error Installing SHAMPOO HOT 3
- Raise warning if pyfftw not installed HOT 1
- Camera features to be controlled in the GUI HOT 3
- Missing feature: magnification HOT 2
- Efficiency: calculate G only on mask
- Efficiency: switch to using fftshift method HOT 1
- Inefficient pyfftw implementation: order of magnitude speedups possible! HOT 6
- Feature request: adjustable Fourier mask attribute
- Docs wishlist
- HDF5 Storage of ReconstructedWave object HOT 5
- RuntimeWarning: invalid value encountered in sqrt np.sqrt(1.0 - first_term - second_term)) HOT 4
- Is the picture specific? HOT 6
- Error with shampoo.test() HOT 2
- ModuleNotFoundError
- MNT: Stop using ci-helpers in appveyor.yml
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shampoo.