aaspip / pyekfmm

A python package for 3D fast-marching-based traveltime calculation and its applications in seismology
GNU General Public License v3.0
47 stars 10 forks source link

Does functions eikonal_surf and eikonal with multiply sources work? #1

Open YuYifan2000 opened 1 year ago

YuYifan2000 commented 1 year ago

Hi, Thanks for implementing and sharing these useful package. When I was running it, the eikonal function with one sources like the codes in 'demo' runs smoothly. However, if I try to input the eikonal function with multiple sources following the instruction in the 'src' folder, no matter the grid size, it has the error of 'Segmentation fault'. The same as eikonal_surf function, no matter the grid size i tried, the same error 'Segmentation fault' showed up.

So I was wondering if these two functions work? Could share some examples using these functions in 'demo' folder? That would be very helpful.

Thanks!

Yifan

chenyk1990 commented 1 year ago

Thanks for your feedback. Here is an example.

https://github.com/chenyk1990/pyrfloc/blob/main/demos/test_first.py

Please download data according to the documentation and also uncomment the following lines to generate traveltime using pyekfmm.

using pyekfmm to calculate traveltime

shots=myloc.evlabels.transpose();

myloc.calc_traveltime(shots);

myloc.stimes=myloc.fmmtimes;

The function for using pyekfmm to calculate traveltime is copied and pasted below.

def calc_traveltime(self,shots):
    '''
    Calculate traveltime using pyekfmm

    A substitute of load_traveltime
    '''
    import pyekfmm as fmm
    vp=self.vp; #zxy
    vp=np.swapaxes(vp,0,2).reshape([self.nx*self.ny*self.nz,1],order='F');

transpose to [xyz]

    fmmtimes=np.zeros([self.nx,self.ny,self.nevent],dtype='float32')

x,y,nevent

    for ii in range(self.nevent):
        fmmtimes[:,:,ii]=fmm.eikonal_surf(vp,

xyz=np.expand_dims(shots[ii,:],0),

ay=[self.minx,self.dx,self.nx],

ax=[self.miny,self.dy,self.ny], az=[self.minz,self.dz,self.nz ],

order=1,verb=0).reshape(self.nx,self.ny,order='F');

a little inconsistent here (due to C-version X-Y inconsistency)

        if np.mod(ii,50)==0:
            print('event id=',ii,' is done\n');
    self.fmmtimes=fmmtimes;

On Mon, Jul 24, 2023 at 1:50 PM Yifan Yu @.***> wrote:

Hi, Thanks for implementing and sharing these useful package. When I was running it, the eikonal function with one sources like the codes in 'demo' runs smoothly. However, if I try to input the eikonal function with multiple sources following the instruction in the 'src' folder, no matter the grid size, it has the error of 'Segmentation fault'. The same as eikonal_surf function, no matter the grid size i tried, the same error 'Segmentation fault' showed up.

So I was wondering if these two functions work? Could share some examples using these functions in 'demo' folder? That would be very helpful.

Thanks!

Yifan

— Reply to this email directly, view it on GitHub https://github.com/aaspip/pyekfmm/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADHCWEV5LHYPTRT2KCAVIULXR27YNANCNFSM6AAAAAA2V7VTGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>