当前位置: 首页 > news >正文

wordpress评论删除站点网站推广公司

wordpress评论删除站点,网站推广公司,建立网站账号违法行为数据库,网站开发项目文档目录 1 完整代码 2 运行结果 利用GEE合成NDVI时,如果研究区较大,一个月的影像覆盖不了整个研究区,就会有缺失的地方,还有就是去云之后,有云量的地区变成空值。 所以今天来用一种插值的方法来填补缺失的影像&#xf…

目录

1 完整代码

2 运行结果



利用GEE合成NDVI时,如果研究区较大,一个月的影像覆盖不了整个研究区,就会有缺失的地方,还有就是去云之后,有云量的地区变成空值。

所以今天来用一种插值的方法来填补缺失的影像,以NDVI为例,主要实现原理其实就是用前后两个月的NDVI的均值进行填补。

1 完整代码

var roi = table;
Map.centerObject(roi,7)
var styling = {color:"red",fillColor:"00000000"};
Map.addLayer(roi.style(styling),{},"geometry")
var img_normalize = function(img){ var minMax = img.reduceRegion({ reducer:ee.Reducer.minMax(), geometry: roi, scale: 30, maxPixels: 10e13, tileScale: 16 }) 
var year = img.get('year') 
var normalize = ee.ImageCollection.fromImages( img.bandNames().map(function(name){ name = ee.String(name); var band = img.select(name); return band.unitScale(ee.Number(minMax.get(name.cat('_min'))), ee.Number(minMax.get(name.cat('_max')))); }) ).toBands().rename(img.bandNames()); return normalize;}
function maskL457sr(image) {//l57去云// Bit 0 - Fill// Bit 1 - Dilated Cloud// Bit 2 - Unused// Bit 3 - Cloud// Bit 4 - Cloud Shadowvar qaMask = image.select('QA_PIXEL').bitwiseAnd(parseInt('11111', 2)).eq(0);var saturationMask = image.select('QA_RADSAT').eq(0);// Apply the scaling factors to the appropriate bands.var opticalBands = image.select('SR_B.').multiply(0.0000275).add(-0.2);var thermalBand = image.select('ST_B6').multiply(0.00341802).add(149.0);// Replace the original bands with the scaled ones and apply the masks.return image.addBands(opticalBands, null, true).addBands(thermalBand, null, true).updateMask(qaMask).updateMask(saturationMask);
}
/*function maskL8sr(image) {// Bit 0 - Fill// Bit 1 - Dilated Cloud// Bit 2 - Cirrus// Bit 3 - Cloud// Bit 4 - Cloud Shadowvar qaMask = image.select('QA_PIXEL').bitwiseAnd(parseInt('11111', 2)).eq(0);var saturationMask = image.select('QA_RADSAT').eq(0);// Apply the scaling factors to the appropriate bands.var opticalBands = image.select('SR_B.').multiply(0.0000275).add(-0.2);var thermalBands = image.select('ST_B.*').multiply(0.00341802).add(149.0);// Replace the original bands with the scaled ones and apply the masks.return image.addBands(opticalBands, null, true).addBands(thermalBands, null, true).updateMask(qaMask).updateMask(saturationMask);
}*/
var imageCollection = ee.ImageCollection('LANDSAT/LT05/C02/T1_L2').filterBounds(roi);//1111111
var monthCount = ee.List.sequence(0, 11);// 通过图像收集,生成每月NDVI中值图像
var composites = ee.ImageCollection.fromImages(monthCount.map(function(m) {var startMonth = 1; // 从1月开始var startYear = ee.Number(2000); // 1993-1var month = ee.Date.fromYMD(startYear, startMonth, 1).advance(m,'month').get('month');var year = ee.Date.fromYMD(startYear, startMonth, 1).advance(m,'month').get('year')// 按年筛选,然后按月筛选var filtered = imageCollection.filter(ee.Filter.calendarRange({start: year.subtract(1), // 过去两年的平均数end: year,field: 'year'})).filter(ee.Filter.calendarRange({start: month,field: 'month'}));// mask for clouds and then take the median///var composite = filtered.map(maskL457sr).median().clip(roi);return composite.normalizedDifference(['SR_B4', 'SR_B3']).rename('NDVI').set('month', ee.Date.fromYMD(startYear, startMonth, 1).advance(m,'month')).set('system:time_start', ee.Date.fromYMD(startYear, startMonth, 1).advance(m,'month').millis());
}));
print(composites);
var stackCollection = function(collection) {// 创建一个初始图像.var first = ee.Image(collection.first()).select([]);// Write a function that appends a band to an image.var appendBands = function(image, previous) {return ee.Image(previous).addBands(image);};return ee.Image(collection.iterate(appendBands, first));
};
var compos = stackCollection(composites);
print('插值前', compos);// 用上个月和下个月的平均值替换被遮挡的像素 
var replacedVals = composites.map(function(image){var currentDate = ee.Date(image.get('system:time_start'));var meanImage = composites.filterDate(currentDate.advance(-2,'month'), currentDate.advance(2, 'month')).mean();//33333333333333333333333max min median// 替换所有被屏蔽的值return meanImage.where(image, image);
});// 将ImageCollection堆叠成一个多波段的光栅,以便下载
var stackCollection = function(collection) {// 创建一个初始图像.var first = ee.Image(collection.first()).select([]);// Write a function that appends a band to an image.var appendBands = function(image, previous) {return ee.Image(previous).addBands(image);};return ee.Image(collection.iterate(appendBands, first));
};
var stacked = stackCollection(replacedVals);
print('stacked image', stacked);
var Vis = {min: -1,max: 1.0,palette: ['FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901','66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01','012E01', '011D01', '011301'],};
Map.addLayer(compos.select(6), Vis, '插值前');
// .0-11  分别代表1-12个月
Map.addLayer(stacked.select(6), Vis, 'NDVI');//555555555Export.image.toDrive({image: stacked.select(0),//选择导出影像的波段0-11  分别代表1-12个月description: 'NDVI',//选择导出云盘的文件夹名称crs: "EPSG:4326",//坐标系scale: 30,//空间分辨率region: roi,//研究区maxPixels: 1e13,//最大像元个数folder: 'NDVI'
});

2 运行结果

填补空值之前的效果
填补空值之后的效果

可以看出,填补的效果还是非常明显的。

http://www.r43.cn/news/604.html

相关文章:

  • 网站建设杭州最便宜百度网站排名关键词整站优化
  • 简单个人网站模板经典软文案例分析
  • 做搜狗pc网站湖北百度推广公司
  • 做seo需要建网站吗淘宝怎么设置关键词搜索
  • 五金企业网站模板关键词的选取原则
  • 怎么通过做网站来赚钱长沙哪家网络公司做网站好
  • 做单页网站的软件seo关键词推广
  • 网站建设落地页网络科技公司经营范围
  • 免费黄页营销网站站长工具高清吗
  • 广州的网站建设公司哪家好seo专员岗位职责
  • 网站建设经济可行性分析搜狗seo刷排名软件
  • 黄骅市在哪里seo站长综合查询工具
  • java做3d游戏下载网站有哪些友情链接交换平台
  • 网站正在建设中 html代码百度推广每年600元什么费用
  • 检察机关门户网站建设情况产品线上推广方式都有哪些
  • python开发做网站百度权重什么意思
  • 学网站开发工程师难学吗单页网站seo如何优化
  • 做网站开发的经营范围网站正能量免费推广软件
  • 门户网站建设的必要性百度竞价推广的优势
  • 站长工具关键词青岛网站权重提升
  • 做淘口令网站人员优化方案
  • 福州网站排名推广中央人民政府网
  • 网址大全首页济南做seo的公司排名
  • 教学网站在线自测功能怎么做seo优化推广工程师招聘
  • 肇庆住房和城乡建设部网站徐州百度seo排名优化
  • 化工网站建站模板百度关键词优化快速排名软件
  • 网站建设注意事项知乎seo独立站优化
  • 校园网站模版推广普通话的宣传语
  • 木门行业网站该怎么做百度搜索高级搜索
  • 成都哪里做网站备案百度推广费用预算表