Google Earth Engine(GEE)——如何获取指定时间范围的影像值并进行图表展示(指定天数范围内的时序图)

简介: Google Earth Engine(GEE)——如何获取指定时间范围的影像值并进行图表展示(指定天数范围内的时序图)

很多时候我们可以直接进行影像图表的加载,但是如何获取不同天数,或者给了指定的时间节点,如何获取这个指定时间范围内的月或者日的结果,从而正确的加载影像波段值的图表。我们需要了解几个函数:

difference(start, unit)

Returns the difference between two Dates in the specified units; the result is floating-point and based on the average length of the unit.

返回两个Date在指定单位中的差值;结果是浮点的,基于单位的平均长度。

Arguments:

this:date (Date)

start (Date)

unit (String):

One of 'year', 'month' 'week', 'day', 'hour', 'minute', or 'second'.

Returns: Float

advance(delta, unit, timeZone)//这个是进行日期的设定,按照年月日等格式

Create a new Date by adding the specified units to the given Date.

通过向给定的日期添加指定的单位来创建一个新的日期。

Arguments:

this:date (Date)

delta (Float)

unit (String):

One of 'year', 'month' 'week', 'day', 'hour', 'minute', or 'second'.

timeZone (String, default: null):

The time zone (e.g. 'America/Los_Angeles'); defaults to UTC.

Returns: Date

ui.Chart.image.series(imageCollection, region, reducer, scale, xProperty)

Generates a Chart from an ImageCollection. Plots derived values of each band in a region across images. Usually a time series.

  • X-axis: Image, labeled by xProperty value.
  • Y-axis: Band value.
  • Series: Band names.

Returns a chart.

Arguments:

imageCollection (ImageCollection):

An ImageCollection with data to be included in the chart.

region (Feature|FeatureCollection|Geometry):

The region to reduce.

reducer (Reducer, optional):

Reducer that generates the values for the y-axis. Must return a single value. Defaults to ee.Reducer.mean().

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'.

Returns: ui.Chart

 

代码:

var startDate = ee.Date('2022-01-01'); // set start time for analysis
var endDate = ee.Date('2022-12-31'); // set end time for analysis
var nDays = ee.Number(endDate.difference(startDate,'day')).round();
// coordinate Arpat Ponte alle Mosse
//var point = ee.Geometry.Point([11.230520538799576, 43.78480193916678]);
// Signa 11.097849 43.793234
//https://www.arpat.toscana.it/temi-ambientali/aria/qualita-aria/rete_monitoraggio/scheda_stazione/FI-SIGNA
var point = ee.Geometry.Point([11.097849, 43.793234]);
Map.setCenter(11.097849, 43.793234,14);
var chirps = ee.ImageCollection('COPERNICUS/S5P/NRTI/L3_O3')
            .select('O3_column_number_density')
            .filterBounds(point)
            .filterDate(startDate, endDate)
            .map(function(image){return image.clip(point)}) ;
      
//这个关键地方,,是需要我们建立一个时序,然后获取每一天的值,这里最主要的时间函数的运用,以及影像系统时间的设定
var byday = ee.ImageCollection(
  // map over each day
  ee.List.sequence(0,nDays).map(function (n) {
    var ini = startDate.advance(n,'day');
    // advance just one day
    var end = ini.advance(1,'day');
    return chirps.filterDate(ini,end)
                .select(0).mean()
                .set('system:time_start', ini);
}));
// plot full time series
print(
  ui.Chart.image.series({
    imageCollection: byday,
    region: point,
    scale: 1
  }).setOptions({title: 'O3 Signa 2020 mol/m2'})
);
Export.table.toDrive({
        collection: chirps,
        description: 'O3', 
    fileNamePrefix: 'O3', 
    fileFormat: 'CSV'
    });
相关文章
|
3月前
|
数据可视化 定位技术 Sentinel
如何用Google Earth Engine快速、大量下载遥感影像数据?
【2月更文挑战第9天】本文介绍在谷歌地球引擎(Google Earth Engine,GEE)中,批量下载指定时间范围、空间范围的遥感影像数据(包括Landsat、Sentinel等)的方法~
537 0
如何用Google Earth Engine快速、大量下载遥感影像数据?
|
3月前
|
机器学习/深度学习 算法 数据可视化
基于Google Earth Engine云平台构建的多源遥感数据森林地上生物量AGB估算模型含生物量模型应用APP
基于Google Earth Engine云平台构建的多源遥感数据森林地上生物量AGB估算模型含生物量模型应用APP
106 0
|
2月前
|
存储 编解码 数据可视化
Google Earth Engine获取随机抽样点并均匀分布在栅格的不同数值区中
【2月更文挑战第14天】本文介绍在谷歌地球引擎(Google Earth Engine,GEE)中,按照给定的地表分类数据,对每一种不同的地物类型,分别加以全球范围内随机抽样点自动批量选取的方法~
260 0
Google Earth Engine获取随机抽样点并均匀分布在栅格的不同数值区中
|
3月前
|
API Go 网络架构
GEE Colab——如何从本地/Google云盘/Google Cloud Storage (GCS)上传和下载
GEE Colab——如何从本地/Google云盘/Google Cloud Storage (GCS)上传和下载
89 4
|
3月前
|
机器学习/深度学习 存储 人工智能
GEE Colab——初学者福音快速入门 Google Colab(Colaboratory)
GEE Colab——初学者福音快速入门 Google Colab(Colaboratory)
72 3
|
3月前
|
编解码 人工智能 算法
Google Earth Engine——促进森林温室气体报告的全球时间序列数据集
Google Earth Engine——促进森林温室气体报告的全球时间序列数据集
26 0
|
3月前
|
编解码 人工智能 数据库
Google Earth Engine(GEE)——全球道路盘查项目全球道路数据库
Google Earth Engine(GEE)——全球道路盘查项目全球道路数据库
45 0
|
3月前
|
编解码
Open Google Earth Engine(OEEL)——matrixUnit(...)中产生常量影像
Open Google Earth Engine(OEEL)——matrixUnit(...)中产生常量影像
21 0
|
3月前
Google Earth Engine(GEE)——导出指定区域的河流和流域范围
Google Earth Engine(GEE)——导出指定区域的河流和流域范围
44 0
|
3月前
|
传感器 编解码 数据处理
Open Google Earth Engine(OEEL)——哨兵1号数据的黑边去除功能附链接和代码
Open Google Earth Engine(OEEL)——哨兵1号数据的黑边去除功能附链接和代码
23 0

热门文章

最新文章

相关实验场景

更多