You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何将2D速度场NumPy数组从ft/s转换为m/s?

速度场单位转换:ft/s 转 m/s

要把英尺每秒(ft/s)的速度数组转换成米每秒(m/s),直接利用固定转换系数即可:1英尺 = 0.3048米,所以只需要将数组中的每个元素乘以0.3048。

修改你的代码如下:

import numpy as np
import matplotlib.pyplot as plt

vel = np.load('smaart/sigsbee2a_migvel.npy')
# 执行单位转换
vel_mps = vel * 0.3048

fig = plt.figure(figsize=(15, 10))
plt.imshow(vel_mps, cmap='plasma', aspect=.8)
plt.colorbar(shrink=.5, label='Vp [m/s]')
plt.title('Modelo Sigsbee 2A (Vp [m/s])')
plt.show()

说明

  • NumPy数组支持元素级的广播运算,直接用*乘以转换系数就能完成整个数组的单位转换,无需循环遍历每个元素。
  • 记得同步修改图表的标题和颜色条标签,保证可视化结果的单位与数据一致。

内容的提问来源于stack exchange,提问作者John

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 23:40:58