Пример #1
0
def plot_rays(pathes, rays, plot=None):
    plot = getplot(plot)
    path_to_color = {}
    for ipath, path in enumerate(pathes):
        path_to_color[path] = colors[ipath%len(colors)]

    if rays is None:
        rays = pathes

    for iray, ray in enumerate(rays):
        fanz, fanx = [], []
        if isinstance(ray, cake.RayPath):
            path = ray
            p = num.linspace(path.pmin(), path.pmax(), 6)
        else:
            p = cake.filled(ray.p, 1)
            path = ray.path
            
        for z,x,t in path.iter_partial_zxt(p):
            fanz.append(z)
            fanx.append(x)
        
        fanz = num.array(fanz).T
        fanx = num.array(fanx).T
        color = path_to_color[path]
        for zs, xs in zip(fanz, fanx):
            l = plot.plot( xs, zs, color=color)
Пример #2
0
def plot_rays(paths, rays, zstart, zstop, plot=None):
    plot = getplot(plot)
    path_to_color = {}
    for ipath, path in enumerate(paths):
        path_to_color[path] = colors[ipath % len(colors)]

    if rays is None:
        rays = paths

    for iray, ray in enumerate(rays):
        if isinstance(ray, cake.RayPath):
            path = ray
            pmin, pmax, xmin, xmax, tmin, tmax = path.ranges(path.endgaps(zstart, zstop))
            p = num.linspace(pmin, pmax, 6)
        else:
            p = cake.filled(ray.p, 1)
            path = ray.path

        fanz, fanx, _ = path.zxt_path_subdivided(p, path.endgaps(zstart, zstop))
        color = path_to_color[path]
        for zs, xs in zip(fanz, fanx):
            l = plot.plot(xs, zs, color=color)
Пример #3
0
def plot_rays(paths, rays, zstart, zstop, plot=None):
    plot = getplot(plot)
    path_to_color = {}
    for ipath, path in enumerate(paths):
        path_to_color[path] = colors[ipath % len(colors)]

    if rays is None:
        rays = paths

    for iray, ray in enumerate(rays):
        if isinstance(ray, cake.RayPath):
            path = ray
            pmin, pmax, xmin, xmax, tmin, tmax = path.ranges(
                path.endgaps(zstart, zstop))
            p = num.linspace(pmin, pmax, 6)
        else:
            p = cake.filled(ray.p, 1)
            path = ray.path

        fanz, fanx, _ = path.zxt_path_subdivided(p,
                                                 path.endgaps(zstart, zstop))
        color = path_to_color[path]
        for zs, xs in zip(fanz, fanx):
            l = plot.plot(xs, zs, color=color)
Пример #4
0
def plot_receivers(zstop, distances, axes=None):
    axes = getaxes(axes)
    axes.plot(
        distances, cake.filled(zstop, len(distances)), '^', color='black')
Пример #5
0
def plot_receivers(zstop, distances, plot=None):
    plot = getplot(plot)
    plot.plot(distances, cake.filled(zstop, len(distances)), '^', color='black')