青提小说
会员书架
首页 >女生耽美 >gee大神之路 > 十五

十五

上一页 章节目录 加入书签 下一页

totalDays = endDate.difference(startDate, \''day\'');

var daysToInterpolate = ee.List.sequence(1, totalDays, n)

var initImages = daysToInterpolate.map(function(day) {

var image = ee.Image().rename(\''ndvi\'').toFloat().set({

\''system:index\'': ee.Number(day).format(\''%d\''),

\''system:time_start\'': startDate.advance(day, \''day\'').millis(),

// Set a property so we can identify interpolated images

\''type\'': \''interpolated\''

})

return image

})

var initCol = ee.ImageCollection.fromImages(initImages)

var mergedCol = ndviCol.merge(initCol)

//添加时间信息

var mergedCol = mergedCol.map(function(image) {

var timeImage = image.metadata(\''system:time_start\'').rename(\''timestamp\'')

var timeImageMasked = timeImage.updateMask(image.mask().select(0))

return image.addBands(timeImageMasked)

})

//第三步:利用Join函数把每个影像对应的之前和之后的影像链接起来。

//影像时间的转化

var days = 60

var millis = ee.Number(days).multiply(1000*60*60*24)

var maxDiffFilter = ee.Filter.maxDifference({

difference: millis,

leftField: \''system:time_start\'',

rightField: \''system:time_start\''

})

var lessEqFilter = ee.Filter.lessThanOrEquals({

leftField: \''system:time_start\'',

rightField: \''system:time_start\''

})

var greaterEqFilter = ee.Filter.greaterThanOrEquals({

leftField: \''system:time_start\'',

rightField: \''system:time_start\''

})

var filter1 = ee.Filter.and(maxDiffFilter, lessEqFilter)

var join1 = ee.Join.saveAll({

matchesKey: \''after\'',

ordering: \''system:time_start\'',

ascending: false})

var join1Result = join1.apply({

primary: mergedCol,

secondary: mergedCol,

condition: filter1

})

var filter2 = ee.Filter.and(maxDiffFilter, greaterEqFilter)

点击切换 [繁体版]    [简体版]
上一页 章节目录 加入书签 下一页