cut_resample flip XY coords during interpolation

Issue #304 resolved
Karim Gibrán Hernández Chahín created an issue

In scalar_fields_XY.py, in the methode cut_resample the argument of RectBivariateSpline are swaped the x, and y, resulting in a wrong dimentions of U after the interpolation

should be

            f_interp_abs = RectBivariateSpline(self.x,
                                               self.y,
                                               np.abs(self.u),
                                               kx=kxu,
                                               ky=kxu,
                                               s=0)
            f_interp_phase = RectBivariateSpline(self.x,
                                                 self.y,
                                                 np.angle(self.u),
                                                 kx=kxu,
                                                 ky=kxu,
                                                 s=0)

Comments (3)

  1. Karim Gibrán Hernández Chahín reporter

    I was using a special case, so I can see the need to use the swaped coors for the fitting function, however still the issue of the imaged with wrong dimentions of the output.

    The solution ( I tested on different cases) is to change the coods on the formation on the new field

                .
                .
                .
    
                u_new_abs = f_interp_abs(y_new, x_new)  #(on line 475)
                u_new_phase = f_interp_phase(y_new, x_new) #(on line 476)
                .
                .
                .
                u_new = self.u[j_s, i_s] #(on line 485)
                .
                .
                .
    

  2. LUIS MIGUEL SANCHEZ BREA repo owner

    Dear Karim Gibrán Hernández Chahín.

    Thank you very much for your suggestion. I have solved this bug in readme-change branch.

    Luis MIguel

  3. LUIS MIGUEL SANCHEZ BREA repo owner

    Dear Karim Gibrán Hernández Chahín.

    Thank you very much for your suggestion. I have solved this bug in readme-change branch.

    Luis MIguel

  4. Log in to comment