当前位置:网站首页>Linear interpolation of spectral response function
Linear interpolation of spectral response function
2022-06-30 03:44:00 【stone_ tigerLI】
List of articles
0 Preface
Domestic satellite data , The official spectral response function is generally interval 1nm The data of , But some atmospheric correction models may require data at other intervals , such as 6s need 2.5nm Interval data , Therefore, it is necessary to interpolate the data . Of course, there are thousands of ways to realize this function , This paper tries to use python Linear interpolation processing , There are other ways to add .
1 Content
1.1 Spectral response function
Most of the spectral response functions of domestic satellites can be downloaded through China Resources Satellite Center , Download address
1.2 np.interp() Interpolation processing
1.2.1 np.interp() brief introduction
numpy There's a function in interp Linear interpolation can be realized , The main parameters are briefly introduced below , Please refer to Official information
numpy.interp(x, xp, fp, left=None, right=None, period=None)
The main parameters are introduced :xFor the data to be inserted x Axis ,xpFor the original data x Axis data ,fpFor the original data y Axis data
1.2.2 Code
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
wavelength = pd.read_excel('GF.xlsx', 'PMS1')
wavelength.head()

length_interp_bin = np.arange(450, 891, 2.5) # Intercept segment
x = wavelength.iloc[:,0].tolist()
wavelength_interp = []
for i in range(2,6):
wavelength_interp_temp = np.interp(length_interp_bin, x, wavelength.iloc[:,i])
wavelength_interp.append(wavelength_interp_temp)
wavelength_interp = np.array(wavelength_interp)
plt.figure(figsize=(20,10))
plt.plot(x, wavelength.iloc[:,2:6], '.')
plt.plot(length_interp_bin, wavelength_interp.T, 'x')
plt.show()

# Read the interpolation data within each band respectively
b1 = wavelength_interp[0, np.argwhere(length_interp_bin==450)[0][0]: np.argwhere(length_interp_bin==520)[0][0]+1]
b2 = wavelength_interp[1, np.argwhere(length_interp_bin==520)[0][0]: np.argwhere(length_interp_bin==590)[0][0]+1]
b3 = wavelength_interp[2, np.argwhere(length_interp_bin==630)[0][0]: np.argwhere(length_interp_bin==690)[0][0]+1]
b4 = wavelength_interp[3, np.argwhere(length_interp_bin==770)[0][0]: np.argwhere(length_interp_bin==890)[0][0]+1]
1.3 Use scipy interpolation
1.3.1 Code
Top up
# Import package
from scipy import interpolate
plt.figure(figsize=(15,8))
for kind in ["nearest", "zero", "slinear", "quadratic", "cubic"]:
# "nearest", "zero" Interpolate for steps
# slinear linear interpolation
# "quadratic", "cubic" by 2 rank 、3 rank B Spline interpolation
for i in range(2,6):
f = interpolate.interp1d(x, wavelength.iloc[:,i], kind=kind)
inter_wavelength = f(length_interp_bin)
plt.plot(length_interp_bin, inter_wavelength,'x', label=str(kind+'_band'+str(i)))
plt.legend()
plt.show()

end
边栏推荐
- UML图与List集合
- [punch in - Blue Bridge Cup] day 3 --- slice in reverse order list[: -1]
- Feign pit
- C [advanced] C interface
- 第2章 控制结构和函数(编程题)
- 深入浅出掌握grpc通信框架
- Openssl3.0 learning 22 provider decoder
- Pytorch Profiler+ Tensorboard + VS Code
- 华为云原生——数据开发与DataFactory
- Global and Chinese markets for advanced wound care 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢

1148_ Makefile learning_ Targets, variables, and wildcards in makefile
![[punch in - Blue Bridge Cup] day 4--------- split ('') cannot be used. There is a space after the last number of test cases. Split ()](/img/00/3793a236ee37085cb47dbfa1f0dbff.jpg)
[punch in - Blue Bridge Cup] day 4--------- split ('') cannot be used. There is a space after the last number of test cases. Split ()

Interface test tool postman

Hisense A7 ink screen mobile phone cannot be started

Linked list: insert a node in the head

Stc89c52/90c516rd/89c516rd ADC0832 ADC driver code

I have published a book, "changing life against the sky - the way for programmers to become gods", which is open source. I have been working for ten years. There are 100 life suggestions from technica

Laravel9 installation locale

【力扣刷题总结】数据库题目按知识点分类总结(持续更新/简单和中等题已完结)

(04).NET MAUI实战 MVVM
随机推荐
Hudi record
yarn的安装和使用
Redis在windows系统中使用
Wang Shuang - assembly language learning summary
Product thinking - is the future of UAV express worth looking forward to?
Utilisation de foreach en Qt
A GPU approach to particle physics
Feign 坑
[operation] MySQL query operation 2 on May 25, 2022
声网自研传输层协议 AUT 的落地实践丨Dev for Dev 专栏
Hisense A7 ink screen mobile phone cannot be started
[punch in - Blue Bridge Cup] day 5 --- lower() small
【作业】2022.5.28 将CSV写入数据库
云原生——Web实时通信技术之Websocket
How to view Tencent's 2022 school recruitment salary, the total contract of cabbage is 40W?
巧用 Bitmap 实现亿级海量数据统计
[0x0] open questions left by the principal
Redis高并发分布式锁(学习总结)
如何利用FME 创建自己的功能软件
SDS understanding in redis