python一维数据插值_插值一维非功能数据点

我很难找到数据点的插值。这条线应该稍微像一个负的反二次曲线(比如倒“c”)。在

因为这不是一个函数(x可以有多个y值),所以我不确定要使用什么样的插值。在

我在想,也许我应该翻转轴来创建插值点/线,使用单变量样条线,然后在绘制时将其翻转回去?在

这是一个单独点的图表:

这是我的代码:import datetime as dt

import matplotlib.pyplot as plt

from scipy import interpolate

file = open_file("010217.hdf5", mode = "a", title = 'Sondrestrom1')

all_data = file.getNode('/Data/Table Layout').read()

file.close()

time = all_data['ut1_unix'] #time in seconds since 1/1/1970

alt = all_data['gdalt'] #all altitude points

electronDens = all_data['nel'] #all electron density points

x = []

y = []

positions = []

for t in range(len(time)): #Looking at this specific time, find all the respective altitude and electron density points

if time[t] == 982376726:

x.append(electronDens[t])

y.append(alt[t])

positions.append(t)

#FINDING THE DATE

datetime1970 = dt.datetime(1970,1,1,0,0,0)

seconds = long(time[t])

newDatetime = datetime1970 + dt.timedelta(0, seconds)

time1 = newDatetime.strftime('%Y-%m-%d %H:%M:%S')

title = "Electron Density vs. Altitude at "

title += time1

plt.plot(x,y,"o")

plt.title(title)

plt.xlabel('Electron Density (log_10[Ne])')

plt.ylabel('Altitude (km)')

plt.show()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值