• PIE-engine 教程 ——提取黄河流域/山西省1980—2018年流域降水量并对比分析


    这里面我们首先要上传我们自己的研究区,然后加载每一年的数据降水数据,通过系数转化,完成正常降水量的展示,我们通过对reduceregion的统计,分别算出平均降水量,分辨率设定为1000米,最后加载影像的chart折线图,用于存放坐标横轴时间和纵轴的对象(降水),这里我们首先看一下降水数据

    中国区域地面气象要素驱动数据年度合成产品(1979-2018),包括近地面气温、近地面气压、近地面空气比湿、近地面全速、地面向下短波辐射、地面向下长波辐射、地面降水率共7个要素。数据为NETCDF格式,时间分辨率为年,水平空间分辨率为0.1°。可为中国区陆面过程模拟提供驱动数据。

    数据集ID: 

    TPDC/CMFD_01YEAR

    时间范围: 1979年-2018年

    范围: 全国

    来源: 国家青藏高原科学数据中心

    复制代码段: 

    var images = pie.ImageCollection("TPDC/CMFD_01YEAR")

    波段统计:

    名称类型空间分辨率无效值
    lradFloat320.1度-32767
    precFloat320.1度-32767
    presFloat320.1度-32767
    shumFloat320.1度-32767
    sradFloat320.1度-32767
    tempFloat320.1度-32767
    windFloat320.1度-32767

    属性:

    date

    string

    影像日期

    数据引用:阳坤, 何杰. (2019). 中国区域地面气象要素驱动数据集(1979-2018). 国家青藏高原科学数据中心, DOI: 10.11888/AtmosphericPhysics.tpe.249369.file. CSTR: 18406.11.AtmosphericPhysics.tpe.249369.file.
    [Yang, K., He, J. (2019). China meteorological forcing dataset (1979-2018). National Tibetan Plateau Data Center, DOI: 10.11888/AtmosphericPhysics.tpe.249369.file. CSTR: 18406.11.AtmosphericPhysics.tpe.249369.file. ] (下载引用: RIS格式 | RIS英文格式 | Bibtex格式 | Bibtex英文格式 )

    文章引用:
    1.He, J., Yang, K., Tang, W. Lu, H., Qin, J., Chen, Y.Y., & Li, X. (2020). The first high-resolution meteorological forcing dataset for land process studies over China. Scientific Data, 7, 25, https://doi.org/10.1038/s41597-020-0369-y.( 查看 | Bibtex格式)
    2.Yang, K., He, J.,Tang, W.J., Qin, J., & Cheng, C. (2010). On downward shortwave and longwave radiations over high altitude regions: Observation and modeling in the Tibetan Plateau. Agricultural and Forest Meteorology, 150(1), 38-46.( 查看 | Bibtex格式)

    文中用到的函数:

    reduceRegion(reducer,geometry,scale)

    对特定区域的所有像素进行统计,返回结果为一个JSON对象;目前可完成最大、最小和求和统计计算。

    方法参数:

    - image(Image)

    Image实例。

    - reducer(Reducer)

    统计类型,包括最大值、最小值和求和。

    - geometry(Geometry)

    统计区域范围。默认是影像第一个波段的范围。

    - scale(Number)

    统计采样比例。

    返回值:Dictionary

    ChartImage(ySeries,xSeries,options)

    即将弃用,请使用 ui.Chart.image.*替换。
    通过统计的结果在控制台绘制图表,绘制的图表可以保存。

    方法参数:

    - ySeries(List)

    计算结果Array对象

    - xSeries(List)

    横坐标标注Array对象

    - options(Object)

    用于描述统计图的Json对象

    返回值:null

    代码:

    1. //加载用户已上传的研究区边界数据(以黄河流域为例/山西省为例)
    2. var region = pie.FeatureCollection("user/PieGeoLiu666/RiverBasin/YellowRiver_Basin")//选择用户已上传的矢量边界
    3. .first()
    4. .geometry();
    5. //显示计算区域边界
    6. Map.addLayer(region, { color: "0000ff", fillColor: "00000000", width: 2 }, "黄河流域");
    7. Map.setCenter(112.254, 35.726, 3);
    8. print(region);
    9. //加载逐年CMFD数据
    10. var CMFD1979 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1979").select('prec').clip(region);
    11. var prec1979 = CMFD1979.multiply(8760);
    12. var CMFD1980 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1980").select('prec').clip(region);
    13. var prec1980 = CMFD1980.multiply(8760);
    14. var CMFD1981 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1981").select('prec').clip(region);
    15. var prec1981 = CMFD1981.multiply(8760);
    16. var CMFD1982 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1982").select('prec').clip(region);
    17. var prec1982 = CMFD1982.multiply(8760);
    18. var CMFD1983 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1983").select('prec').clip(region);
    19. var prec1983 = CMFD1983.multiply(8760);
    20. var CMFD1984 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1984").select('prec').clip(region);
    21. var prec1984 = CMFD1984.multiply(8760);
    22. var CMFD1985 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1985").select('prec').clip(region);
    23. var prec1985 = CMFD1985.multiply(8760);
    24. var CMFD1986 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1986").select('prec').clip(region);
    25. var prec1986 = CMFD1986.multiply(8760);
    26. var CMFD1987 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1987").select('prec').clip(region);
    27. var prec1987 = CMFD1987.multiply(8760);
    28. var CMFD1988 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1988").select('prec').clip(region);
    29. var prec1988 = CMFD1988.multiply(8760);
    30. var CMFD1989 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1989").select('prec').clip(region);
    31. var prec1989 = CMFD1989.multiply(8760);
    32. var CMFD1990 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1990").select('prec').clip(region);
    33. var prec1990 = CMFD1990.multiply(8760);
    34. var CMFD1991 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1991").select('prec').clip(region);
    35. var prec1991 = CMFD1991.multiply(8760);
    36. var CMFD1992 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1992").select('prec').clip(region);
    37. var prec1992 = CMFD1992.multiply(8760);
    38. var CMFD1993 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1993").select('prec').clip(region);
    39. var prec1993 = CMFD1993.multiply(8760);
    40. var CMFD1994 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1994").select('prec').clip(region);
    41. var prec1994 = CMFD1994.multiply(8760);
    42. var CMFD1995 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1995").select('prec').clip(region);
    43. var prec1995 = CMFD1995.multiply(8760);
    44. var CMFD1996 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1996").select('prec').clip(region);
    45. var prec1996 = CMFD1996.multiply(8760);
    46. var CMFD1997 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1997").select('prec').clip(region);
    47. var prec1997 = CMFD1997.multiply(8760);
    48. var CMFD1998 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1998").select('prec').clip(region);
    49. var prec1998 = CMFD1998.multiply(8760);
    50. var CMFD1999 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1999").select('prec').clip(region);
    51. var prec1999 = CMFD1999.multiply(8760);
    52. var CMFD2000 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2000").select('prec').clip(region);
    53. var prec2000 = CMFD2000.multiply(8760);
    54. var CMFD2001 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2001").select('prec').clip(region);
    55. var prec2001 = CMFD2001.multiply(8760);
    56. var CMFD2002 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2002").select('prec').clip(region);
    57. var prec2002 = CMFD2002.multiply(8760);
    58. var CMFD2003 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2003").select('prec').clip(region);
    59. var prec2003 = CMFD2003.multiply(8760);
    60. var CMFD2004 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2004").select('prec').clip(region);
    61. var prec2004 = CMFD2004.multiply(8760);
    62. var CMFD2005 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2005").select('prec').clip(region);
    63. var prec2005 = CMFD2005.multiply(8760);
    64. var CMFD2006 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2006").select('prec').clip(region);
    65. var prec2006 = CMFD2006.multiply(8760);
    66. var CMFD2007 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2007").select('prec').clip(region);
    67. var prec2007 = CMFD2007.multiply(8760);
    68. var CMFD2008 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2008").select('prec').clip(region);
    69. var prec2008 = CMFD2008.multiply(8760);
    70. var CMFD2009 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2009").select('prec').clip(region);
    71. var prec2009 = CMFD2009.multiply(8760);
    72. var CMFD2010 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2010").select('prec').clip(region);
    73. var prec2010 = CMFD2010.multiply(8760);
    74. var CMFD2011 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2011").select('prec').clip(region);
    75. var prec2011 = CMFD2011.multiply(8760);
    76. var CMFD2012 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2012").select('prec').clip(region);
    77. var prec2012 = CMFD2012.multiply(8760);
    78. var CMFD2013 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2013").select('prec').clip(region);
    79. var prec2013 = CMFD2013.multiply(8760);
    80. var CMFD2014 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2014").select('prec').clip(region);
    81. var prec2014 = CMFD2014.multiply(8760);
    82. var CMFD2015 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2015").select('prec').clip(region);
    83. var prec2015 = CMFD2015.multiply(8760);
    84. var CMFD2016 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2016").select('prec').clip(region);
    85. var prec2016 = CMFD2016.multiply(8760);
    86. var CMFD2017 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2017").select('prec').clip(region);
    87. var prec2017 = CMFD2017.multiply(8760);
    88. var CMFD2018 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2018").select('prec').clip(region);
    89. var prec2018 = CMFD2018.multiply(8760);
    90. //统计计算研究区内的逐年均值
    91. var prec1979_mean = prec1979.reduceRegion(pie.Reducer.mean(), region, 1000);
    92. var prec1980_mean = prec1980.reduceRegion(pie.Reducer.mean(), region, 1000);
    93. var prec1981_mean = prec1981.reduceRegion(pie.Reducer.mean(), region, 1000);
    94. var prec1982_mean = prec1982.reduceRegion(pie.Reducer.mean(), region, 1000);
    95. var prec1983_mean = prec1983.reduceRegion(pie.Reducer.mean(), region, 1000);
    96. var prec1984_mean = prec1984.reduceRegion(pie.Reducer.mean(), region, 1000);
    97. var prec1985_mean = prec1985.reduceRegion(pie.Reducer.mean(), region, 1000);
    98. var prec1986_mean = prec1986.reduceRegion(pie.Reducer.mean(), region, 1000);
    99. var prec1987_mean = prec1987.reduceRegion(pie.Reducer.mean(), region, 1000);
    100. var prec1988_mean = prec1988.reduceRegion(pie.Reducer.mean(), region, 1000);
    101. var prec1989_mean = prec1989.reduceRegion(pie.Reducer.mean(), region, 1000);
    102. var prec1990_mean = prec1990.reduceRegion(pie.Reducer.mean(), region, 1000);
    103. var prec1991_mean = prec1991.reduceRegion(pie.Reducer.mean(), region, 1000);
    104. var prec1992_mean = prec1992.reduceRegion(pie.Reducer.mean(), region, 1000);
    105. var prec1993_mean = prec1993.reduceRegion(pie.Reducer.mean(), region, 1000);
    106. var prec1994_mean = prec1994.reduceRegion(pie.Reducer.mean(), region, 1000);
    107. var prec1995_mean = prec1995.reduceRegion(pie.Reducer.mean(), region, 1000);
    108. var prec1996_mean = prec1996.reduceRegion(pie.Reducer.mean(), region, 1000);
    109. var prec1997_mean = prec1997.reduceRegion(pie.Reducer.mean(), region, 1000);
    110. var prec1998_mean = prec1998.reduceRegion(pie.Reducer.mean(), region, 1000);
    111. var prec1999_mean = prec1999.reduceRegion(pie.Reducer.mean(), region, 1000);
    112. var prec2000_mean = prec2000.reduceRegion(pie.Reducer.mean(), region, 1000);
    113. var prec2001_mean = prec2001.reduceRegion(pie.Reducer.mean(), region, 1000);
    114. var prec2002_mean = prec2002.reduceRegion(pie.Reducer.mean(), region, 1000);
    115. var prec2003_mean = prec2003.reduceRegion(pie.Reducer.mean(), region, 1000);
    116. var prec2004_mean = prec2004.reduceRegion(pie.Reducer.mean(), region, 1000);
    117. var prec2005_mean = prec2005.reduceRegion(pie.Reducer.mean(), region, 1000);
    118. var prec2006_mean = prec2006.reduceRegion(pie.Reducer.mean(), region, 1000);
    119. var prec2007_mean = prec2007.reduceRegion(pie.Reducer.mean(), region, 1000);
    120. var prec2008_mean = prec2008.reduceRegion(pie.Reducer.mean(), region, 1000);
    121. var prec2009_mean = prec2009.reduceRegion(pie.Reducer.mean(), region, 1000);
    122. var prec2010_mean = prec2010.reduceRegion(pie.Reducer.mean(), region, 1000);
    123. var prec2011_mean = prec2011.reduceRegion(pie.Reducer.mean(), region, 1000);
    124. var prec2012_mean = prec2012.reduceRegion(pie.Reducer.mean(), region, 1000);
    125. var prec2013_mean = prec2013.reduceRegion(pie.Reducer.mean(), region, 1000);
    126. var prec2014_mean = prec2014.reduceRegion(pie.Reducer.mean(), region, 1000);
    127. var prec2015_mean = prec2015.reduceRegion(pie.Reducer.mean(), region, 1000);
    128. var prec2016_mean = prec2016.reduceRegion(pie.Reducer.mean(), region, 1000);
    129. var prec2017_mean = prec2017.reduceRegion(pie.Reducer.mean(), region, 1000);
    130. var prec2018_mean = prec2018.reduceRegion(pie.Reducer.mean(), region, 1000);
    131. //配置折线图的样式
    132. var line_options = {
    133. title: '1979-2018年黄河流域年降水量(mm)',
    134. legend: ['降水量(mm)'],
    135. xAxisName: "年份",
    136. yAxisName: "年降水量(mm)",
    137. chartType: "line"
    138. };
    139. var images = [prec1979_mean, prec1980_mean, prec1981_mean, prec1982_mean, prec1983_mean, prec1984_mean,
    140. prec1985_mean, prec1986_mean, prec1987_mean, prec1988_mean, prec1989_mean, prec1990_mean,
    141. prec1991_mean, prec1992_mean, prec1993_mean, prec1994_mean, prec1995_mean, prec1996_mean,
    142. prec1997_mean, prec1998_mean, prec1999_mean, prec2000_mean, prec2001_mean, prec2002_mean,
    143. prec2003_mean, prec2004_mean, prec2005_mean, prec2006_mean, prec2007_mean, prec2008_mean,
    144. prec2009_mean, prec2010_mean, prec2011_mean, prec2012_mean, prec2013_mean, prec2014_mean,
    145. prec2015_mean, prec2016_mean, prec2017_mean, prec2018_mean];
    146. var xSeries = [1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
    147. 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
    148. 2013, 2014, 2015, 2016, 2017, 2018];
    149. //绘制折线图
    150. ChartImage(images, xSeries, line_options);

     

     同样我们加载山西省的数据来尝试一下,当然你也可以画一个自己的研究区完成指定区域的降水数据的统计,当然这里加载新的研究区会有卡顿现象,所以大家要注意研究加载较大的时候,我们注意等待,大概2分钟山西省的降水量也能出来啦:

     山西省的代码:

    1. //加载山西省边界
    2. var region = pie.FeatureCollection('user/xg346049806/shanxibianjie').first().geometry();;
    3. //显示计算区域边界
    4. Map.addLayer(region, { color: "0000ff", fillColor: "00000000", width: 2 }, "黄河流域");
    5. Map.setCenter(112.254, 35.726, 3);
    6. print(region);
    7. //加载逐年CMFD数据
    8. var CMFD1979 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1979").select('prec').clip(region);
    9. var prec1979 = CMFD1979.multiply(8760);
    10. var CMFD1980 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1980").select('prec').clip(region);
    11. var prec1980 = CMFD1980.multiply(8760);
    12. var CMFD1981 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1981").select('prec').clip(region);
    13. var prec1981 = CMFD1981.multiply(8760);
    14. var CMFD1982 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1982").select('prec').clip(region);
    15. var prec1982 = CMFD1982.multiply(8760);
    16. var CMFD1983 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1983").select('prec').clip(region);
    17. var prec1983 = CMFD1983.multiply(8760);
    18. var CMFD1984 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1984").select('prec').clip(region);
    19. var prec1984 = CMFD1984.multiply(8760);
    20. var CMFD1985 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1985").select('prec').clip(region);
    21. var prec1985 = CMFD1985.multiply(8760);
    22. var CMFD1986 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1986").select('prec').clip(region);
    23. var prec1986 = CMFD1986.multiply(8760);
    24. var CMFD1987 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1987").select('prec').clip(region);
    25. var prec1987 = CMFD1987.multiply(8760);
    26. var CMFD1988 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1988").select('prec').clip(region);
    27. var prec1988 = CMFD1988.multiply(8760);
    28. var CMFD1989 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1989").select('prec').clip(region);
    29. var prec1989 = CMFD1989.multiply(8760);
    30. var CMFD1990 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1990").select('prec').clip(region);
    31. var prec1990 = CMFD1990.multiply(8760);
    32. var CMFD1991 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1991").select('prec').clip(region);
    33. var prec1991 = CMFD1991.multiply(8760);
    34. var CMFD1992 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1992").select('prec').clip(region);
    35. var prec1992 = CMFD1992.multiply(8760);
    36. var CMFD1993 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1993").select('prec').clip(region);
    37. var prec1993 = CMFD1993.multiply(8760);
    38. var CMFD1994 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1994").select('prec').clip(region);
    39. var prec1994 = CMFD1994.multiply(8760);
    40. var CMFD1995 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1995").select('prec').clip(region);
    41. var prec1995 = CMFD1995.multiply(8760);
    42. var CMFD1996 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1996").select('prec').clip(region);
    43. var prec1996 = CMFD1996.multiply(8760);
    44. var CMFD1997 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1997").select('prec').clip(region);
    45. var prec1997 = CMFD1997.multiply(8760);
    46. var CMFD1998 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1998").select('prec').clip(region);
    47. var prec1998 = CMFD1998.multiply(8760);
    48. var CMFD1999 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_1999").select('prec').clip(region);
    49. var prec1999 = CMFD1999.multiply(8760);
    50. var CMFD2000 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2000").select('prec').clip(region);
    51. var prec2000 = CMFD2000.multiply(8760);
    52. var CMFD2001 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2001").select('prec').clip(region);
    53. var prec2001 = CMFD2001.multiply(8760);
    54. var CMFD2002 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2002").select('prec').clip(region);
    55. var prec2002 = CMFD2002.multiply(8760);
    56. var CMFD2003 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2003").select('prec').clip(region);
    57. var prec2003 = CMFD2003.multiply(8760);
    58. var CMFD2004 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2004").select('prec').clip(region);
    59. var prec2004 = CMFD2004.multiply(8760);
    60. var CMFD2005 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2005").select('prec').clip(region);
    61. var prec2005 = CMFD2005.multiply(8760);
    62. var CMFD2006 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2006").select('prec').clip(region);
    63. var prec2006 = CMFD2006.multiply(8760);
    64. var CMFD2007 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2007").select('prec').clip(region);
    65. var prec2007 = CMFD2007.multiply(8760);
    66. var CMFD2008 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2008").select('prec').clip(region);
    67. var prec2008 = CMFD2008.multiply(8760);
    68. var CMFD2009 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2009").select('prec').clip(region);
    69. var prec2009 = CMFD2009.multiply(8760);
    70. var CMFD2010 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2010").select('prec').clip(region);
    71. var prec2010 = CMFD2010.multiply(8760);
    72. var CMFD2011 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2011").select('prec').clip(region);
    73. var prec2011 = CMFD2011.multiply(8760);
    74. var CMFD2012 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2012").select('prec').clip(region);
    75. var prec2012 = CMFD2012.multiply(8760);
    76. var CMFD2013 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2013").select('prec').clip(region);
    77. var prec2013 = CMFD2013.multiply(8760);
    78. var CMFD2014 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2014").select('prec').clip(region);
    79. var prec2014 = CMFD2014.multiply(8760);
    80. var CMFD2015 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2015").select('prec').clip(region);
    81. var prec2015 = CMFD2015.multiply(8760);
    82. var CMFD2016 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2016").select('prec').clip(region);
    83. var prec2016 = CMFD2016.multiply(8760);
    84. var CMFD2017 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2017").select('prec').clip(region);
    85. var prec2017 = CMFD2017.multiply(8760);
    86. var CMFD2018 = pie.Image("TPDC/CMFD_01YEAR/CMFD_01YEAR_2018").select('prec').clip(region);
    87. var prec2018 = CMFD2018.multiply(8760);
    88. //统计计算研究区内的逐年均值
    89. var prec1979_mean = prec1979.reduceRegion(pie.Reducer.mean(), region, 1000);
    90. var prec1980_mean = prec1980.reduceRegion(pie.Reducer.mean(), region, 1000);
    91. var prec1981_mean = prec1981.reduceRegion(pie.Reducer.mean(), region, 1000);
    92. var prec1982_mean = prec1982.reduceRegion(pie.Reducer.mean(), region, 1000);
    93. var prec1983_mean = prec1983.reduceRegion(pie.Reducer.mean(), region, 1000);
    94. var prec1984_mean = prec1984.reduceRegion(pie.Reducer.mean(), region, 1000);
    95. var prec1985_mean = prec1985.reduceRegion(pie.Reducer.mean(), region, 1000);
    96. var prec1986_mean = prec1986.reduceRegion(pie.Reducer.mean(), region, 1000);
    97. var prec1987_mean = prec1987.reduceRegion(pie.Reducer.mean(), region, 1000);
    98. var prec1988_mean = prec1988.reduceRegion(pie.Reducer.mean(), region, 1000);
    99. var prec1989_mean = prec1989.reduceRegion(pie.Reducer.mean(), region, 1000);
    100. var prec1990_mean = prec1990.reduceRegion(pie.Reducer.mean(), region, 1000);
    101. var prec1991_mean = prec1991.reduceRegion(pie.Reducer.mean(), region, 1000);
    102. var prec1992_mean = prec1992.reduceRegion(pie.Reducer.mean(), region, 1000);
    103. var prec1993_mean = prec1993.reduceRegion(pie.Reducer.mean(), region, 1000);
    104. var prec1994_mean = prec1994.reduceRegion(pie.Reducer.mean(), region, 1000);
    105. var prec1995_mean = prec1995.reduceRegion(pie.Reducer.mean(), region, 1000);
    106. var prec1996_mean = prec1996.reduceRegion(pie.Reducer.mean(), region, 1000);
    107. var prec1997_mean = prec1997.reduceRegion(pie.Reducer.mean(), region, 1000);
    108. var prec1998_mean = prec1998.reduceRegion(pie.Reducer.mean(), region, 1000);
    109. var prec1999_mean = prec1999.reduceRegion(pie.Reducer.mean(), region, 1000);
    110. var prec2000_mean = prec2000.reduceRegion(pie.Reducer.mean(), region, 1000);
    111. var prec2001_mean = prec2001.reduceRegion(pie.Reducer.mean(), region, 1000);
    112. var prec2002_mean = prec2002.reduceRegion(pie.Reducer.mean(), region, 1000);
    113. var prec2003_mean = prec2003.reduceRegion(pie.Reducer.mean(), region, 1000);
    114. var prec2004_mean = prec2004.reduceRegion(pie.Reducer.mean(), region, 1000);
    115. var prec2005_mean = prec2005.reduceRegion(pie.Reducer.mean(), region, 1000);
    116. var prec2006_mean = prec2006.reduceRegion(pie.Reducer.mean(), region, 1000);
    117. var prec2007_mean = prec2007.reduceRegion(pie.Reducer.mean(), region, 1000);
    118. var prec2008_mean = prec2008.reduceRegion(pie.Reducer.mean(), region, 1000);
    119. var prec2009_mean = prec2009.reduceRegion(pie.Reducer.mean(), region, 1000);
    120. var prec2010_mean = prec2010.reduceRegion(pie.Reducer.mean(), region, 1000);
    121. var prec2011_mean = prec2011.reduceRegion(pie.Reducer.mean(), region, 1000);
    122. var prec2012_mean = prec2012.reduceRegion(pie.Reducer.mean(), region, 1000);
    123. var prec2013_mean = prec2013.reduceRegion(pie.Reducer.mean(), region, 1000);
    124. var prec2014_mean = prec2014.reduceRegion(pie.Reducer.mean(), region, 1000);
    125. var prec2015_mean = prec2015.reduceRegion(pie.Reducer.mean(), region, 1000);
    126. var prec2016_mean = prec2016.reduceRegion(pie.Reducer.mean(), region, 1000);
    127. var prec2017_mean = prec2017.reduceRegion(pie.Reducer.mean(), region, 1000);
    128. var prec2018_mean = prec2018.reduceRegion(pie.Reducer.mean(), region, 1000);
    129. //配置折线图的样式
    130. var line_options = {
    131. title: '1979-2018年山西省年降水量(mm)',
    132. legend: ['降水量(mm)'],
    133. xAxisName: "年份",
    134. yAxisName: "年降水量(mm)",
    135. chartType: "line"
    136. };
    137. var images = [prec1979_mean, prec1980_mean, prec1981_mean, prec1982_mean, prec1983_mean, prec1984_mean,
    138. prec1985_mean, prec1986_mean, prec1987_mean, prec1988_mean, prec1989_mean, prec1990_mean,
    139. prec1991_mean, prec1992_mean, prec1993_mean, prec1994_mean, prec1995_mean, prec1996_mean,
    140. prec1997_mean, prec1998_mean, prec1999_mean, prec2000_mean, prec2001_mean, prec2002_mean,
    141. prec2003_mean, prec2004_mean, prec2005_mean, prec2006_mean, prec2007_mean, prec2008_mean,
    142. prec2009_mean, prec2010_mean, prec2011_mean, prec2012_mean, prec2013_mean, prec2014_mean,
    143. prec2015_mean, prec2016_mean, prec2017_mean, prec2018_mean];
    144. var xSeries = [1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
    145. 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
    146. 2013, 2014, 2015, 2016, 2017, 2018];
    147. //绘制折线图
    148. ChartImage(images, xSeries, line_options);

  • 相关阅读:
    YARN,ZOOKEERPER--学习笔记
    C++11 线程相关操作
    大流量、业务效率?从一个榜单开始
    debug(二)(还没完)
    (四)linux文件内容查看
    1021 Deepest Root
    检索qpython文件夹下.py
    Java IO流的“四大家族”
    (王道考研计算机网络)第五章传输层-第三节1-5:TCP拥塞控制
    Day05-Java入门语言基础之循环
  • 原文地址:https://blog.csdn.net/qq_31988139/article/details/127022076