当前位置:网站首页>Gee: explore the characteristics of precipitation change in the Yellow River Basin in the past 10 years [pixel by pixel analysis]
Gee: explore the characteristics of precipitation change in the Yellow River Basin in the past 10 years [pixel by pixel analysis]
2022-07-02 05:11:00 【Gee water ecological space】
Catalog
Preface
GEE, How to analyze the Yellow River Basin 10 Characteristics of precipitation changes in recent years ?
For similar analysis, see :
GEE: Explore the Yellow River Basin 10 Characteristics of vegetation changes over the years 【 Pixel by pixel analysis 】
The areas for this analysis are as follows :
One 、 Analysis steps
Main analysis steps :
Two 、python Code
1、 Load image set
The data set used is : Monthly climate and water balance data set
python The code is as follows
# Add display underlay , Select Gaode map
Map = geemap.Map()
# Map.basemap_demo()
Map.add_basemap('Gaode.Normal')
Map
2、 Characteristics of precipitation variation in the basin
- ee.Reducer.linearFit()
python The code is as follows :
# Watershed boundary
basin_shp = '../world_basins/worldrivers2/huanghe.shp'
basin_bj = geemap.shp_to_ee(basin_shp)
roi = basin_bj.geometry()
Map.centerObject(roi)
Map.addLayer(ee.Image().paint(roi, 0, 2), {
'palette':'darkblue'}, 'huanghe')
# Define and add time band function
def addTime(image):
return image.addBands(image.metadata('system:time_start').divide(1000 * 60 * 60 * 24 * 365))
# Add dataset , Add time band
collection = ee.ImageCollection('IDAHO_EPSCOR/TERRACLIMATE') \
.filterDate('2010-01-01', '2020-12-31') \
.map(addTime)
# Select the band used for linear trend prediction
trend = collection.select(['system:time_start', 'pr']) \
.reduce(ee.Reducer.linearFit()) \
.clip(roi)
# Rendering display
visualization = {
'max':3,
'min':-3,
'palette': ['b30000','d7301f','ef6548','fc8d59','fdbb84','fdd49e','fee8c8','f7fcf0','e0f3db','ccebc5','a8ddb5','7bccc4','4eb3d3','2b8cbe','0868ac']
}
# Slope change of precipitation , reflect 20 The change trend of the increase or decrease of precipitation in the basin in recent years
Map.addLayer(trend.select('scale'),visualization, 'huanghe_pre')
Map
give the result as follows :
3、 ... and 、 The question of contrast
Here I quote another blog post about the analysis of annual precipitation , Compare the difference between the two calculation results , Its python The code is as follows :
# Modify from "GEE(Python) Pixel by pixel linear fitting " Of code
# Join the research area
study_area = basin_bj
# Add function of time band
def createTimeBand(img):
date = img.metadata("date").subtract(2010)
return date.rename("year").clip(study_area).addBands(img)
# Traverse to obtain monthly precipitation data , And the total annual precipitation is calculated circularly , Deposit in list in
datalist=ee.List([])
year=2010
for i in range(10):
datalist=datalist.add(ee.ImageCollection("IDAHO_EPSCOR/TERRACLIMATE") \
.filter(ee.Filter.date(ee.Date(str(year)+"-01-01"), ee.Date(str(year+1)+"-01-01"))) \
.select('pr')\
.sum()\
.clip(study_area)\
.set("date",ee.Number(year)))
year += 1
# take list To ImageCollection
varyCollection = ee.ImageCollection.fromImages(datalist)
trend = varyCollection.map(createTimeBand) \
.reduce(ee.Reducer.linearFit()) # Linear regression for each pixel
print(trend.getInfo())
# Rendering display
visualization = {
'max':3,
'min':-3,
'palette': ['b30000','d7301f','ef6548','fc8d59','fdbb84','fdd49e','fee8c8','f7fcf0','e0f3db','ccebc5','a8ddb5','7bccc4','4eb3d3','2b8cbe','0868ac']
}
Map.addLayer(trend.select('scale'),visualization,'yearly pre trend')
# Map.centerObject(roi)
Map
give the result as follows : Comparison and analysis of the difference between the two calculation results :
- It can be seen that , The results of the two calculations are the same in the general trend , Both show that the precipitation in the eastern region is decreasing , And the precipitation in the western region is increasing .
- However, there are obvious differences in the variation of precipitation . The same place, such as Point (110.8477, 38.0308) It's about , The slope change of precipitation at this pixel fitted by the previous code is -0.85, The slope of the annual total is -12.5, The two are poor 1 An order of magnitude .
- It is preliminarily felt that the annual change rate is 12mm/a The change of is not in line with the actual situation , If so ,10 Decreased in 120mm, It's a little too exaggerated .
Four 、 Summary and discussion
- adopt MODIS Long time series precipitation changes , The temporal and spatial variation characteristics of precipitation in the basin are explored
- Should grasp ee.Reducer.linearFit() Function usage , This function is 2 Output of parameters , Respectively scale( Slope ) and offset( intercept ), Can pass scale We can see the evolution trend of regional vegetation .
- Problems to be explored , Before using linear analog functions , First, the data is processed by adding time bands , The time obtained is metadata in system:time_start Time , This value is converted in years , It is understood that the millisecond unit is converted to the year unit , But why is it different from the result calculated completely according to the total annual precipitation ? What's the problem ? Hope to discuss in the comment area .
Reference resources :
- https://developers.google.com/earth-engine/guides/ic_reducing
- https://blog.csdn.net/alley51775/article/details/121708658?spm=1001.2014.3001.5502
边栏推荐
- Video multiple effects production, fade in effect and border background are added at the same time
- Here comes the chicken soup! Keep this quick guide for data analysts
- 7.1模拟赛总结
- Application of intelligent robot in agricultural ecology
- Super detailed pycharm tutorial
- Mouse events in JS
- Pytest learning ----- pytest Interface Association framework encapsulation of interface automation testing
- C# 图片显示占用问题
- 2022阿里巴巴全球数学竞赛 第4题 虎虎生威(盲盒问题、集卡问题)解决思路
- Global and Chinese market of hydrocyclone desander 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢
2022 Alibaba global mathematics competition, question 4, huhushengwei (blind box problem, truck problem) solution ideas
Fabric.js IText 上标和下标
Application of intelligent robot in agricultural ecology
06 装饰(Decorator)模式
数学知识——快速幂的理解及例题
Collectors.groupingBy 排序
将光盘中的cda保存到电脑中
摆正元素(带过渡动画)
Application d'un robot intelligent dans le domaine de l'agroécologie
The El cascader echo only selects the questions that are not displayed
随机推荐
函数中使用sizeof(arr) / sizeof(arr[0])求数组长度不正确的原因
Cultivate primary and secondary school students' love for educational robots
Orthogonal test method and function diagram method for test case design
06 装饰(Decorator)模式
[opencv] image binarization
Global and Chinese market of cell culture freezers 2022-2028: Research Report on technology, participants, trends, market size and share
案例分享|智慧化的西部机场
Leetcode basic programming: array
Oracle和MySQL的基本区别(入门级)
运维工作的“本手、妙手、俗手”
Fabric.js 基础笔刷
Ruby replaces gem Alibaba image
el-cascader回显只选中不显示的问题
设置滚动条默认样式 谷歌浏览器
Fabric.js 3个api设置画布宽高
C case of communication between server and client based on mqttnet
A new attribute value must be added to the entity entity class in the code, but there is no corresponding column in the database table
农业生态领域智能机器人的应用
LeetCode 241. Design priorities for operational expressions (divide and conquer / mnemonic recursion / dynamic programming)
摆正元素(带过渡动画)