Esempio n. 1
0
pEXP.plot_line(xp, yp, U, p1, p2, interp=interp, Xaxis=x_axis)

#%%
# Upward continuation of the field data

mesh, label_prop = dEXP.upwc(xp,
                             yp,
                             zp,
                             U,
                             shape,
                             zmin=0,
                             zmax=max_elevation,
                             nlayers=nlay,
                             qorder=qorder)

plt, cmap = pEXP.plot_xy(mesh, label=label_prop, Xaxis=x_axis)
plt.colorbar(cmap)

#%%
# ridges identification
# dEXP.ridges_minmax_plot(xp, yp, mesh, p1, p2,
#                                       label=label_prop,
#                                       fix_peak_nb=2,
#                                       method_peak='find_peaks')

# or  find_peaks or peakdet or spline_roots
dfI, dfII, dfIII = dEXP.ridges_minmax(xp,
                                      yp,
                                      mesh,
                                      p1,
                                      p2,
Esempio n. 2
0
    #%%
    # save data loop

    MESH.append(mesh)
    LABEL.append(label_prop)
    DF_F.append(df_f)
    DF_FIT.append(df_fit)
    XXZZ.append(xxzz)
    CTm.append(CT)

#%%
plt.figure()
ax = plt.gca()

i = 0
pEXP.plot_xy(MESH[i], label=LABEL[i], ax=ax)  #, ldg=)
dfI_f, dfII_f, dfIII_f = DF_F[i]
pEXP.plot_ridges_harmonic(dfI_f, dfII_f, dfIII_f, ax=ax, label=False)
pEXP.plot_ridges_sources(DF_FIT[i],
                         ax=ax,
                         z_max_source=-max_elevation * 1.2,
                         ridge_type=[0, 1, 2],
                         ridge_nb=None)
x1, x2, z1, z2 = XXZZ[i]
square([x1, x2, z1, z2])
plt.annotate(CTm[i], [(x1 + x2) / 2, (z1 + z2) / 2])

plt.figure()
ax = plt.gca()

i = 1
Esempio n. 3
0
    MESHratio.append(mesh_ratio)
    LABELratio.append(label_ratio)
    XXZZ.append(xxzz)
    CTm.append(CT)

#%%
# Plot the results
scl = 0
i = 0

fig = plt.figure()
ax = plt.gca()
plt, cmap = pEXP.plot_xy(MESHratio[i],
                         scaled=scl,
                         label=LABELratio[i],
                         markerMax=True,
                         qratio=str(qratio),
                         p1p2=np.array([p1, p2]),
                         ax=ax,
                         Xaxis=x_axis)
cbar = plt.colorbar(cmap, shrink=0.25, pad=0.04)
cbar.set_label('ratio voltage (V)')
x1, x2, z1, z2 = XXZZ[i]
square([x1, x2, -z1, -z2])
plt.annotate(CTm[i], [(x1 + x2) / 2, -(z1 + z2) / 2])

i = 1

fig = plt.figure()
ax = plt.gca()
plt, cmap = pEXP.plot_xy(MESHratio[i],
                         scaled=scl,
    pEXP.plot_field(xp, yp, gravity, shape_grid)

    #%%
    # Upward continuation of the field data with discretisation in altitude controlled by the number of layers (nlay) and the maximum elevation desired (max_elevation)
    mesh, label_prop = dEXP.upwc(xp,
                                 yp,
                                 zp,
                                 gravity,
                                 shape_grid,
                                 zmin=0,
                                 zmax=max_elevation,
                                 nlayers=nlay,
                                 qorder=qorder)

    plt, cmap = pEXP.plot_xy(mesh,
                             label=label_prop,
                             Xaxis=x_axis,
                             p1p2=np.array([p1, p2]))
    plt.colorbar(cmap)

    #%%

    xderiv = transform.derivx(xp, yp, gravity, shape_grid, order=qorder)
    yderiv = transform.derivy(xp, yp, gravity, shape_grid, order=qorder)
    zderiv = transform.derivz(xp, yp, gravity, shape_grid, order=qorder)

    # # plt.plot(xderiv)
    # # plt.plot(yderiv)

    # # interp = True
    pEXP.plot_line(xp,
                   yp,
Esempio n. 5
0
# -------------------------------  Model
xp, yp, zp, U, shape, p1, p2, coord= magfwd.load_mag_synthetic()
max_elevation=2*max(coord[:,2])
scaled, SI, zp, qorder, nlay, minAlt_ridge, maxAlt_ridge = para.set_par(shape=shape,max_elevation=max_elevation)
interp = True

#%% ------------------------------- Plot the data 
pEXP.plot_line(xp, yp, U,p1,p2, interp=interp)

#%% ------- upward continuation of the field data

mesh, label_prop = dEXP.upwc(xp, yp, zp, U, shape, 
                 zmin=0, zmax=max_elevation, nlayers=nlay, 
                 qorder=qorder)

plt, cmap = pEXP.plot_xy(mesh, label=label_prop)
plt.colorbar(cmap)
        

# %% ridges identification

dEXP.ridges_minmax_plot(xp, yp, mesh, p1, p2,
                                      label=label_prop,
                                      method_peak='find_peaks')  

# or  find_peaks or peakdet or spline_roots
dfI,dfII, dfIII = dEXP.ridges_minmax(xp, yp, mesh, p1, p2,
                                      label=label_prop,
                                      method_peak='find_peaks')  

 
Esempio n. 6
0
    #%% ------- upward continuation of the field data
    p = [p1_s, p2_s]

    mesh, label_prop = dEXP.upwc(Xs,
                                 Ys,
                                 zp,
                                 U,
                                 shape,
                                 zmin=0,
                                 zmax=max_elevation,
                                 nlayers=nlay,
                                 qorder=qorder)

    plt, cmap = pEXP.plot_xy(mesh,
                             label=label_prop,
                             Xaxis=x_axis,
                             Vminmax=[0, 0.35],
                             p1p2=p)
    cbar = plt.colorbar(cmap, shrink=0.25, pad=0.04)
    cbar.set_label('upwc voltage (V)')
    plt.tight_layout()
    plt.savefig('upwc voltage' + str(file) + '.png', dpi=450)

    #%% DEXP ratio
    # x_axis = 'x'
    qratio = [1, 0]
    mesh_dexp, label_dexp = dEXP.dEXP_ratio(Xs,
                                            Ys,
                                            zp,
                                            U,
                                            shape,
Esempio n. 7
0
               smooth=smooth,
               Xaxis=x_axis)

#%% ------- upward continuation of the field data

mesh, label_prop = dEXP.upwc(Xs,
                             Ys,
                             zp,
                             U,
                             shape,
                             zmin=0,
                             zmax=max_elevation,
                             nlayers=nlay,
                             qorder=qorder)

plt, cmap = pEXP.plot_xy(mesh, label=label_prop, Xaxis=x_axis)
plt.colorbar(cmap)

#%% DEXP ratio
# x_axis = 'x'
qratio = [1, 0]
mesh_dexp, label_dexp = dEXP.dEXP_ratio(Xs,
                                        Ys,
                                        zp,
                                        U,
                                        shape,
                                        zmin=0,
                                        zmax=max_elevation,
                                        nlayers=nlay,
                                        qorders=qratio)
fig = plt.figure()
Esempio n. 8
0
               interp=interp,
               Xaxis=x_axis)

#%%
# Upward continuation of the field data with discretisation in altitude controlled by the number of layers (nlay) and the maximum elevation desired (max_elevation)
mesh, label_prop = dEXP.upwc(xp,
                             yp,
                             zp,
                             U,
                             shape,
                             zmin=0,
                             zmax=max_elevation,
                             nlayers=nlay,
                             qorder=qorder)

plt, cmap = pEXP.plot_xy(mesh, label=label_prop)
plt.colorbar(cmap)

p = np.array([p1, p2])
plt, cmap = pEXP.plot_xy(mesh, label=label_prop, Xaxis=x_axis,
                         p1p2=p)  #, ldg=)
plt.colorbar(cmap)

# plt, cmap = pEXP.plot_xy(mesh, label=label_prop, Xaxis='y', p1p2=p) #, ldg=)
# plt.colorbar(cmap)

# plt, cmap = pEXP.slice_mesh(xp, yp, mesh, label_prop, p1, p2, interp=True, Xaxis='x')
# plt.colorbar(cmap)

#%%
# Ridges identification: plot all extremas obtained via find_peaks function (numpy) for a given altitude