• GEE图表——利用NOAA气象数据绘制气温预测图


    简介

    气象预测是通过气象数据和模型对未来某一时间和地点的天气情况进行预测。

    具体步骤如下:

    1. 数据采集:从气象观测站、卫星等获取气象数据,包括气压、水汽、风速、温度、降雨、云量等。

    2. 数据清洗:对采集到的数据进行质量检查、处理和筛选,去除异常数据和不合理数据。

    3. 数据处理:将清洗后的数据通过插值、平滑等方法处理成空间和时间上连续的气象场。

    4. 模型选择:根据预测的时间范围、区域和目的,选择合适的气象模型,如数值天气预报模型、统计预报模型等。

    5. 模型运行:将处理好的气象场输入到模型中,进行数值计算,得出预测结果。

    6. 预测结果评估:根据历史数据和实测数据,对预测结果进行评估和校正,提高预测精度。

    7. 结果输出:将预测结果以图表或文字形式输出,进行分析和应用。

    注:以上步骤是一个完整过程,具体实施时可能会因不同的预测目的、数据获取渠道和应用场景等因素有所改变。

    数据:

    全球预报系统(GFS)是由美国国家环境预报中心(NCEP)制作的天气预报模式。GFS 数据集由选定的模式输出(如下所述)组成,作为网格预报变量。384 小时的预报间隔为 1 小时(120 小时以内)和 3 小时(120 小时以后),时间分辨率为 6 小时(即每天更新四次)。使用 "创建时间 "和 "预报时间 "属性选择感兴趣的数据。

    函数

    ui.Chart.image.seriesByRegion(imageCollection, regions, reducer, bandscalexPropertyseriesProperty)

    Generates a Chart from an image collection. Extracts and plots the value of the specified band in each region for each image in the collection. Usually a time series.

    • X-axis = Image labeled by xProperty (default: 'system:time_start').

    • Y-axis = Reducer output.

    • Series = Region labeled by seriesProperty (default: 'system:index').

    Returns a chart.

    Arguments:

    imageCollection (ImageCollection):

    An ImageCollection with data to be included in the chart.

    regions (Feature|FeatureCollection|Geometry|List|List):

    The regions to reduce.

    reducer (Reducer):

    Reducer that generates the value for the y-axis. Must return a single value.

    band (Number|String, optional):

    The band name to reduce using the reducer. Defaults to the first band.

    scale (Number, optional):

    Scale to use with the reducer in meters.

    xProperty (String, optional):

    Property to be used as the label for each image on the x-axis. Defaults to 'system:time_start'.

    seriesProperty (String, optional):

    Property of features in opt_regions to be used for series labels. Defaults to 'system:index'.

    Returns: ui.Chart

    代码:

    1. // Select the locations
    2. var geometry1 = ee.Geometry.Point([-4.232, 53.263]);
    3. var geometry2 = ee.Geometry.Point([-2.936, 53.394]);
    4. // NOAA GFS dataset
    5. var gfs = ee.ImageCollection("NOAA/GFS0P25");
    6. // 选择气温数据
    7. var forecast = gfs.select('precipitable_water_entire_atmosphere');
    8. // 获取今天的天气预报
    9. // 预测每 6 小时生成一次
    10. // 为考虑摄取延迟,我们获取过去 10 小时内生成的预报
    11. var now = ee.Date(Date.now());
    12. var before = now.advance(-24, 'hour');
    13. var filtered = forecast
    14. .filter(ee.Filter.date(before, now));
    15. // 所有预报图像都有当天的时间戳
    16. // 由于我们需要的是时间序列的预报,因此我们要将
    17. // 时间戳更新为图像的预报日期。
    18. var filtered = filtered.select('precipitable_water_entire_atmosphere')
    19. .map(function(image) {
    20. var forecastTime = image.get('forecast_time');
    21. return image.set('system:time_start', forecastTime);
    22. });
    23. // 创建单一地点的预测图表
    24. var chart = ui.Chart.image.series({
    25. imageCollection: filtered,
    26. region: geometry1,
    27. reducer: ee.Reducer.first(),
    28. scale: 27830}).setOptions({
    29. lineWidth: 2,
    30. pointSize: 2,
    31. title: 'Precipitation Forecast ',
    32. vAxis: {title: 'Precipitation (mm)'},
    33. hAxis: {title: '', format: 'YYYY-MM-dd'},
    34. series: {
    35. 0: {color: 'blue'},
    36. },
    37. legend: {
    38. position: 'none'
    39. }
    40. });
    41. print(chart);
    42. // 为了绘制多个位置,我们需要一个特征集合
    43. var locations = ee.FeatureCollection([
    44. ee.Feature(geometry1, {'name': 'bangor'}),
    45. ee.Feature(geometry2, {'name': 'livepool'})
    46. ]);
    47. // 绘制气温预测图
    48. var chart = ui.Chart.image.seriesByRegion({
    49. imageCollection: filtered,
    50. regions: locations,
    51. reducer: ee.Reducer.first(),
    52. scale: 27830,
    53. seriesProperty: 'name'
    54. }).setOptions({
    55. lineWidth: 1,
    56. pointSize: 2,
    57. title: 'Precipitation Forecast ',
    58. vAxis: {title: 'Precipitation (mm)'},
    59. hAxis: {title: '', format: 'YYYY-MM-dd'},
    60. series: {
    61. 0: {color: '#1b9e77'},
    62. 1: {color: '#d95f02'}
    63. },
    64. legend: {
    65. position: 'top'
    66. }
    67. });
    68. print(chart);

    结果: 

  • 相关阅读:
    C语言,从联合看字节序
    保卫你的API:深入了解接口限流
    二、C++ Builder XE关于intraweb开发_工程组的三个CPP
    spring cloud 快速上手系列 -> 03-消息队列 Stream -> 031-安装rabbitmq-server
    【Vue】使用插槽和具名插槽解决组件内容传递问题(2)
    Linux cat 的作用
    Webpack干货系列 | 在 Webpack 5 集成 ESLint 的方法
    智能优化之遗传算法
    C语言08、数据在内存中的存储、大小端存储模式
    [FMMPEG] parse与 demuxer
  • 原文地址:https://blog.csdn.net/qq_31988139/article/details/133917726