groupeLIAMG / ttcr

Codes to do raytracing for geophysical applications
GNU General Public License v3.0
85 stars 33 forks source link

Inconsistency between v 1.1.8 and v 1.2.1 #63

Closed AmirMardan closed 9 months ago

AmirMardan commented 9 months ago

Hi,

I've been using this package for a while now. Today I noticed an inconsistency between the results of Grid2d.raytrace. Here is an example, where the left figure shows the rays in case of using version 1.1.8 and the right figure shows the rays for version 1.2.1.

v118_v121

Here is the code for the slowness model and how I called Grid2d.raytrace

n_rows_cols = 8

xn=np.linspace(-150, 1750, n_rows_cols+1)
zn=xn.copy()

xfast = 1037.5
zfast = 1037.5
xslow = 562.5
zslow = 562.5

vbackground = 2900
vtrue = np.full((n_rows_cols, n_rows_cols), vbackground)
for i in range(n_rows_cols):
    for j in range(n_rows_cols):
        vtrue[i,j] *= (1 + 0.10 * np.exp(-.00004 * ((xn[i] - xfast)**2 + (zn[j] - zfast)**2)))
        vtrue[i,j] *= (1 - 0.15 * np.exp(-.00004 * ((xn[i] - xslow)**2 + (zn[j] - zslow)**2)))
mtrue = 1 / vtrue.reshape(-1,1)

grid = Grid2d(xn, zn)
tt, rays, J = grid.raytrace(sc, rc, slowness=mtrue.flatten(), 
                            return_rays=True, compute_L=True)
bernard-giroux commented 9 months ago

A bug was introduced at some point between 1.1.8 & 1.2.1... Fixed, wheels are being built and will be uploaded to pypi. Check for v1.2.2 later on

AmirMardan commented 9 months ago

Thanks for the fast update!