Stokes.py module 'numpy' has no attribute 'zeroslike'

Issue #14 resolved
Willis Allen created an issue

The Stokes.parameters.amplitudes() method has an error at line 2685 if you use give_Ez = True. The error is:

line 2685, in amplitudes
E0z = np.zeroslike(E0x)
File "c:\users\\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages\numpy\__init__.py", line 284, in __getattr__
raise AttributeError("module {!r} has no attribute "

builtins.AttributeError: module 'numpy' has no attribute 'zeroslike'

It just needs to be zeros_like() instead of zeroslike()

Comments (4)

  1. Willis Allen reporter

    I’m calculating parameters for polarization images with the library. When I change the zeroslike to zeros_like and run the function I get a blank image after processing. I’m using a circular polarization filter and it isn’t perfectly lined up, other images are showing elliptical polarization. Does E0z not correspond to circular polarization like in the Poincare sphere? E0x, E0y and E0u are giving expected results.

  2. Willis Allen reporter

    My apologies, I didn’t read the comments saying E0z will always be zero. Could you please explain why E0z is always zero? I’m somewhat new to polarized light and don’t understand what it is supposed to represent.

  3. JESUS DEL HOYO MUÑOZ

    Dear Willis.

    Thank you to point out his issue. It is already solved in version 1.1.3.

    The reason the field in z component is alwaiys 0 is because polarization is always measured perpendicular to propagation direction, so Ez must be 0. We added his option just to use in programs which manages all three components.

  4. Log in to comment