学术交流|航天宏图PIE-Engine遥感云平台在棉花方面所做的工作(7)
2023-05-21 来源:飞速影视
76.var NDWI_max = wat.reduceRegion(pie.Reducer.max(), shz, 30).get("NDWI").getInfo();
77.print("NDWI最大值", NDWI_max);
78.var NDWI_min = wat.reduceRegion(pie.Reducer.min(), shz, 30).get("NDWI").getInfo();
79.print("NDWI
80.var NDWI_mean = wat.reduceRegion(pie.Reducer.mean(), shz, 30).get("NDWI").getInfo();
81.print("NDWI平均值", NDWI_mean);
82.
83.//掩膜获取棉花SPAD
84.var crp = SPAD.updateMask(lc.eq(1).and(nir.gt(4500)).and(NDVI.gt(0.5)));
85.
86.//按不同阈值显示SPAD
87.var chlorophyll = crp.where(crp.gt(0.0).and(crp.lte(1.5)), 1)
88. .where(crp.gt(1.5).and(crp.lte(2.5)), 2)
89. .where(crp.gt(2.5).and(crp.lte(3.5)), 3)
90. .wh
91. .where(crp.gt(4.5), 5);
92.Map.addLayer(crp, {min:1, max:5, palette: ["FFFF80", "71EB2F", "55FF00", "216E9E", "0C1078"]}, "叶绿素");
93.
94.//计算棉花SPAD最大值、最小值以及均值
95.var SPAD_max = crp.reduceRegion(pie.Reducer.max(), shz, 30).get("SPAD").getInfo();
96.print("叶绿素最大值", SPAD_max);
97.var SPAD_min = crp.reduceRegion(pie.Reducer.min(), shz, 30).get("SPAD").getInfo();