CRIMAC-WP4-Machine-learning / CRIMAC-Raw-To-Svf-TSf

Python code showing the current processing steps for modern broadband echosounders, from raw data to Sv(f) and TS(f).
GNU Lesser General Public License v3.0
5 stars 1 forks source link

Is np.atan2 deprecated? #2

Open nilsolav opened 2 years ago

nilsolav commented 2 years ago

When trying to calculate the angles from y_pc_nu I get an error on np.atan2. Also the code coverts to degrees, but I think the notation in the paper suggests radians? Also, the function returns y_alon and y_athw, which is undefined in the paper. Perhaps update the paper? The name of the function is also erroneous since the function does not return the electrical angles (Eq 13 and 14), but partially calculates the physical angles by calling the arctan2 but not the correction factor and the arcsin/arccos step in the function (Eq15&16 in the paper).

In [144]: y_theta_n, y_phi_n = ekcalc.calcElectricalAngles(y_pc_nu)


AttributeError Traceback (most recent call last)

in () ----> 1 y_theta_n, y_phi_n = ekcalc.calcElectricalAngles(y_pc_nu) d:\repos\Github\CRIMAC-Raw-To-Svf-TSf\Core\EK80Calculation.py in calcElectricalAngles(self, y_pc) 306 y_pc_port = 0.5 * (y_pc[1, :] + y_pc[2, :]) 307 --> 308 y_alon = np.atan2(np.real(y_pc_fore), np.imag(np.conj(y_pc_aft))) * 180 / np.pi 309 y_athw = np.atan2(np.real(y_pc_star), np.imag(np.conj(y_pc_port))) * 180 / np.pi 310 AttributeError: module 'numpy' has no attribute 'atan2'
gavinmacaulay commented 2 years ago

It seems to be math.atan2() or np.arctan2()