当前位置:网站首页>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
边栏推荐
- Orthogonal test method and function diagram method for test case design
- 数学知识——快速幂的理解及例题
- Pycharm breakpoint management: temporarily cancel some breakpoints + run directly to a line
- C # picture display occupancy problem
- 4. Flask cooperates with a tag to link internal routes
- Go implements leetcode rotation array
- Steam教育的实际问题解决能力
- Fabric.js 自由绘制矩形
- js面试收藏试题1
- Global and Chinese markets for marine selective catalytic reduction systems 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢
Video multiple effects production, fade in effect and border background are added at the same time
Fabric.js 激活输入框
[Yu Yue education] autumn 2021 reference materials of Tongji University
List of common bugs in software testing
Getting started with pytest ----- confitest Application of PY
LM09丨费雪逆变换反转网格策略
函数栈帧的创建和销毁
ansible安装与使用
Pyechart1.19 national air quality exhibition
运维工作的“本手、妙手、俗手”
随机推荐
Knowledge arrangement about steam Education
2022阿里巴巴全球数学竞赛 第4题 虎虎生威(盲盒问题、集卡问题)解决思路
Super detailed pycharm tutorial
el form 表单validate成功后没有执行逻辑
No logic is executed after the El form is validated successfully
4. Flask cooperates with a tag to link internal routes
MMAP zero copy knowledge point notes
Leetcode 18 problem [sum of four numbers] recursive solution
Acelems Expressway microgrid energy efficiency management platform and intelligent lighting solution intelligent lighting tunnel
Black Horse Notes - - set Series Collection
農業生態領域智能機器人的應用
Leetcode basic programming: array
js中的Map(含leetcode例题)
Basic differences between Oracle and MySQL (entry level)
Pyflink writes MySQL examples with JDBC
[quick view opencv] familiar with CV matrix operation with image splicing examples (3)
06 装饰(Decorator)模式
函数栈帧的创建和销毁
How to recover deleted data in disk
国产全中文-自动化测试软件Apifox