DL-FWI:数据(第二次培训作业)

news/2024/11/17 8:44:02/

代码:

import scipy.io
import matplotlib
import numpy as np
import matplotlib.pylab as plt
matplotlib.use('TkAgg')
from mpl_toolkits.axes_grid1 import make_axes_locatable
import cv2font21 = {'family': 'Times New Roman','weight': 'normal','size': 21,}font18 = {'family': 'Times New Roman','weight': 'normal','size': 18,}def pain_seg_seismic_data(para_seismic_data):'''Plotting seismic data images of SEG salt datasets:param para_seismic_data:   Seismic data (400 x 301) (numpy):param is_colorbar:         Whether to add a color bar (1 means add, 0 is the default, means don't add)'''fig, ax = plt.subplots(figsize=(6.2, 8), dpi = 120)im = ax.imshow(para_seismic_data, extent=[0, 300, 400, 0], cmap=plt.cm.seismic, vmin=-0.4, vmax=0.44)ax.set_xlabel('Position (km)', font21)ax.set_ylabel('Time (s)', font21)ax.set_xticks(np.linspace(0, 300, 5))ax.set_yticks(np.linspace(0, 400, 5))ax.set_xticklabels(labels = [0,0.75,1.5,2.25,3.0], size=21)ax.set_yticklabels(labels = [0.0,0.50,1.00,1.50,2.00], size=21)plt.rcParams['font.size'] = 14      # Set colorbar font sizedivider = make_axes_locatable(ax)cax = divider.append_axes("top", size="3%", pad=0.32)plt.colorbar(im, ax=ax, cax=cax, orientation='horizontal')plt.subplots_adjust(bottom=0.08, top=0.98, left=0.11, right=0.99)plt.show()def pain_openfwi_seismic_data(para_seismic_data):'''Plotting seismic data images of openfwi dataset:param para_seismic_data:   Seismic data (1000 x 70) (numpy)'''data = cv2.resize(para_seismic_data, dsize=(400, 301), interpolation=cv2.INTER_CUBIC)fig, ax = plt.subplots(figsize=(6.1, 8), dpi = 120)im = ax.imshow(data, extent=[0, 0.7, 1.0, 0], cmap=plt.cm.seismic, vmin=-18, vmax=19)ax.set_xlabel('Position (km)', font21)ax.set_ylabel('Time (s)', font21)ax.set_xticks(np.linspace(0, 0.7, 5))ax.set_yticks(np.linspace(0, 1.0, 5))ax.set_xticklabels(labels=[0, 0.17, 0.35, 0.52, 0.7], size=21)ax.set_yticklabels(labels=[0, 0.25, 0.5, 0.75, 1.0], size=21)plt.rcParams['font.size'] = 14      # Set colorbar font sizedivider = make_axes_locatable(ax)cax = divider.append_axes("top", size="3%", pad=0.3)plt.colorbar(im, ax=ax, cax=cax, orientation='horizontal')plt.subplots_adjust(bottom=0.08, top=0.98, left=0.11, right=0.99)plt.show()def pain_openfwi_velocity_model(para_velocity_model):'''Plotting seismic data images of openfwi dataset:param para_velocity_model: Velocity model (70 x 70) (numpy):param min_velocity:        Upper limit of velocity in the velocity model:param max_velocity:        Lower limit of velocity in the velocity model:param is_colorbar:         Whether to add a color bar (1 means add, 0 is the default, means don't add):return:'''fig, ax = plt.subplots(figsize=(5.8, 6), dpi=150)im = ax.imshow(para_velocity_model, extent=[0, 0.7, 0.7, 0])ax.set_xlabel('Position (km)', font18)ax.set_ylabel('Depth (km)', font18)ax.set_xticks(np.linspace(0, 0.7, 8))ax.set_yticks(np.linspace(0, 0.7, 8))ax.set_xticklabels(labels=[0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7], size=18)ax.set_yticklabels(labels=[0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7], size=18)plt.rcParams['font.size'] = 14      # Set colorbar font sizedivider = make_axes_locatable(ax)cax = divider.append_axes("top", size="3%", pad=0.35)plt.colorbar(im, ax=ax, cax=cax, orientation='horizontal')plt.subplots_adjust(bottom=0.10, top=0.95, left=0.13, right=0.95)plt.show()def pain_seg_velocity_model(para_velocity_model):''':param para_velocity_model: Velocity model (200 x 301) (numpy):param min_velocity:        Upper limit of velocity in the velocity model:param max_velocity:        Lower limit of velocity in the velocity model:return:'''fig, ax = plt.subplots(figsize=(5.8, 4.3), dpi=150)im = ax.imshow(para_velocity_model, extent=[0, 3, 2, 0])ax.set_xlabel('Position (km)', font18)ax.set_ylabel('Depth (km)', font18)ax.tick_params(labelsize=14)plt.rcParams['font.size'] = 14  # Set colorbar font sizedivider = make_axes_locatable(ax)cax = divider.append_axes("top", size="3%", pad=0.32)plt.colorbar(im, ax=ax, cax=cax, orientation='horizontal')plt.subplots_adjust(bottom=0.12, top=0.95, left=0.11, right=0.99)plt.show()if __name__ == '__main__':# SEGseismic_SEGReal = scipy.io.loadmat(r"C:\Users\86183\PycharmProjects\FWI\simple_data\seismic_SEGReal.mat")["data"]vmodel_SEGReal = scipy.io.loadmat(r"C:\Users\86183\PycharmProjects\FWI\simple_data\vmodel_SEGReal.mat")["data"]seismic_SEGSimulation = scipy.io.loadmat(r"C:\Users\86183\PycharmProjects\FWI\simple_data\seismicseismic_SEGSimulation.mat")["data"]vmodel_SEGSimulation = scipy.io.loadmat(r"C:\Users\86183\PycharmProjects\FWI\simple_data\vmodel_SEGSimulation.mat")["data"]# OpenFWIseismic_curvefaulta = np.load(r"C:\Users\86183\PycharmProjects\FWI\simple_data\seismic_openfwi_CurveFaultA.npy")vmodel_curvefaulta = np.load(r"C:\Users\86183\PycharmProjects\FWI\simple_data\vmodel_openfwi_CurveFaultA.npy")# SEGprint(seismic_SEGReal.shape)print(vmodel_SEGReal.shape)print(seismic_SEGSimulation.shape)print(vmodel_SEGSimulation.shape)# OpenFWIprint(seismic_curvefaulta.shape)print(vmodel_curvefaulta.shape)# showpain_seg_seismic_data(seismic_SEGReal[:,:,15])pain_seg_velocity_model(vmodel_SEGReal)pain_seg_seismic_data(seismic_SEGSimulation[:, :, 15])pain_seg_velocity_model(vmodel_SEGSimulation)pain_openfwi_seismic_data(seismic_curvefaulta[300,2,:,:])pain_openfwi_velocity_model(vmodel_curvefaulta[300,0,:,:])# show tracetrace_id = 150fig,ax = plt.subplots(figsize = (6.0,5.0),dpi = 150)trace_curve = seismic_SEGSimulation[:, trace_id,15]im = ax.plot(trace_curve,label = "Middle trace")ax.set_xlabel("Time", font18)ax.set_ylabel("Amplitude",font18)plt.legend()plt.show()

结果:

 

 


http://www.ppmy.cn/news/774633.html

相关文章

如何解密单片机内程序?

▌单片机解密是什么? 单片机解密又叫单片机破解,芯片解密,IC解密,但是这严格说来这几种称呼都不科学,但已经成 了习惯叫法,我们把CPLD解密,DSP解密都习惯称为单片机解密。单片机只是能装载程序芯…

ARM与 X86 CPU架构对比

CISC(复杂指令集计算机)和RISC(精简指令集计算机)是当前CPU的两种架构。它们的区别在于不同的CPU设计理念和方法。早期的CPU全部是CISC架构,它的设计目的是 CISC要用最少的机器语言指令来完成所需的计算任务。RISC和CISC是设计制造微处理器的两种典型技术&#xff…

我对eBPF的偏见

台风天气,适合饮酒作文。 我并不反对eBPF技术本身,相反,我很喜欢eBPF并且是它的粉丝,我反对的是对eBPF的滥用。 上周听了一个关于eBPF技术扩展spinlock的讨论,基于以下这个paper: https://www.sigops.org…

ARM与x86 CPU架构对比

CISC(复杂指令集计算机)和RISC(精简指令集计算机)是当前CPU的两种架构。它们的区别在于不同的CPU设计理念和方法。早期的CPU全部是CISC架构,它的设计目的是CISC要用最少的机器语言指令来完成所需的计算任务。RISC和CIS…

ZABBIX(七) Zabbix 选择适合的监控类型

Zabbix提供了十几种监控类型,包括:Zabbix agent,Simple Checks,SNMP,Zabbix internal,IPMI,JMX monitoring等等。 Item类型:Zabbix agent ;Zabbix agent(active);Simple check &…

Java基础篇:Java的包和jar包知识介绍

给自己的每日一句 不从恶人的计谋,不站罪人的道路,不坐亵慢人的座位,惟喜爱耶和华的律法,昼夜思想,这人便为有福!他要像一棵树栽在溪水旁,按时候结果子,叶子也不枯干。凡他所做的尽…

Linux进程调度与性能优化 | 真货

作者简介: 张毅峰,某主机厂架构师。 一、eBPF安全可观测性的前景展望 本次分享将从监控和可观测性、eBPF安全可观测性分析、内核安全可观测性展望三个方面展开。 1.监控(Monitoring)vs可观测性(Observability) 从上图可以看到,监控只是可观测…

如何实现spark春节期间的监控告警系统

马上要过年了,大部分公司这个时候都不会再去谋求开新业务,而大数据工匠们,想要过好年,就要保证过年期间自己对自己的应用了如执掌。一般公司都会有轮值人员,至少要有春节应急预案,尤其是对于我们这些搞平台…