当前位置:网站首页>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 :x
For the data to be inserted x Axis ,xp
For the original data x Axis data ,fp
For 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
边栏推荐
- (04).NET MAUI实战 MVVM
- 【常见问题】浏览器环境、node环境的模块化问题
- [operation] write CSV to database on May 28, 2022
- [summary of skimming questions] database questions are summarized by knowledge points (continuous update / simple and medium questions have been completed)
- December2020 - true questions and analysis of C language (Level 2) in the youth level examination of the Electronic Society
- What does the hyphen mean for a block in Twig like in {% block body -%}?
- A minimalist way to integrate databinding into activity/fragment
- 【作业】2022.5.24 MySQL 查操作
- 利用反射整合ViewBinding和ViewHolder
- 【笔记】2022.5.27 通过pycharm操作MySQL
猜你喜欢
Node-RED系列(二八):基于OPC UA节点与西门子PLC进行通讯
51 single chip microcomputer indoor environment monitoring system, mq-2 smoke sensor and DHT11 temperature and humidity sensor, schematic diagram, C programming and simulation
laravel9本地安裝
Practical debugging skills
[punch in - Blue Bridge Cup] day 4--------- split ('') cannot be used. There is a space after the last number of test cases. Split ()
【论文阅读|深读】DANE:Deep Attributed Network Embedding
深入浅出掌握grpc通信框架
1150_ Makefile learning_ Duplicate name target processing in makefile
【笔记】AB测试和方差分析
dotnet-exec 0.5.0 released
随机推荐
December2020 - true questions and analysis of C language (Level 2) in the youth level examination of the Electronic Society
Redis high concurrency distributed locks (learning summary)
LitJson解析 生成json文件 读取json文件中的字典
1151_ Makefile learning_ Static matching pattern rules in makefile
【笔记】2022.5.27 通过pycharm操作MySQL
Installation and use of yarn
AppData文件夹下Local,Locallow和Roaming
Stc89c52/90c516rd/89c516rd ADC0832 ADC driver code
Number of students from junior college to Senior College (4)
【笔记】AB测试和方差分析
【论文阅读|深读】Role2Vec:Role-Based Graph Embeddings
【个人总结】学习计划
dotnet-exec 0.5.0 released
[summary of skimming questions] database questions are summarized by knowledge points (continuous update / simple and medium questions have been completed)
4-5 count words and spaces (15 points)
Learning cyclic redundancy CRC check
Redis高并发分布式锁(学习总结)
利用反射整合ViewBinding和ViewHolder
【笔记】2022.5.23 MySQL
ReSharper 7. Can X be used with vs2013 preview? [off] - can resharper 7 x be used with VS2013 preview? [closed]