Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/451.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Python GEE从陆地卫星图像中提取featurecollection时间序列_Javascript_Python_Google Earth Engine_Landsat - Fatal编程技术网

Javascript Python GEE从陆地卫星图像中提取featurecollection时间序列

Javascript Python GEE从陆地卫星图像中提取featurecollection时间序列,javascript,python,google-earth-engine,landsat,Javascript,Python,Google Earth Engine,Landsat,我有一个功能集合,需要从陆地卫星图像中提取NDWI的时间序列 下面是我用来提取timeseries的javascript函数代码: 现在我尝试在python中复制相同的脚本,如下所示,但它在包含image.mask.andcloud01.not的行中显示语法错误。我想知道如何在python中指定相同的条件 我们将非常感谢您的帮助 提前谢谢 我的python代码如下所示: 导入日期时间 进口ee 初始化 表=ee.FeatureCollectionusers/nbiswas/Buffered\u

我有一个功能集合,需要从陆地卫星图像中提取NDWI的时间序列

下面是我用来提取timeseries的javascript函数代码:

现在我尝试在python中复制相同的脚本,如下所示,但它在包含image.mask.andcloud01.not的行中显示语法错误。我想知道如何在python中指定相同的条件

我们将非常感谢您的帮助

提前谢谢

我的python代码如下所示:

导入日期时间 进口ee 初始化 表=ee.FeatureCollectionusers/nbiswas/Buffered\u seasia L8=ee.ImageCollectionLANDSAT/LC08/C01/T2, 表2=ee.FeatureCollectionusers/nbiswas/Madushan, 表3=ee.FeatureCollectionusers/nbiswas/india\u水库\u缓冲区\u 3km; 储层类别: 定义初始自我: self.table=表2 self.geometry=表2.geometry; self.Date_Start=ee.Date'2008-01-01'; 自我日期=ee日期'2018-07-31'; self.cloud_thresh=20; def clipimageself,img: 返回img.clipself.geometry; def cloudfunctionself,图像: 使用“将云可能性带添加到图像” CloudScore=ee.Algorithms.Landsat.simpleCloudScoreimage; 分离云的可能性带 质量=云分数。选择“云”; 获取高于阈值的像素 cloud01=quality.gtself.cloud\u thresh; 从高可能性像素创建遮罩 cloudmask=image.mask.andcloud01.not; 遮罩图像中的像素 返回image.updateMaskcloudmask; def l8Ndwiself,进气歧管: ndwi=img.normalizedDifference['B3','B5']。重命名为'ndwi'; 返回img.addBandsndwi; def areadateself,img: area=img.gt0.multiplyee.Image.pixelArea.divide1000000.reduceRegionee.Reducer.sum,self.geometry,30.获取“NDWI”; 返回img.set'area',area.set'date',img.get'system:time_start'; def extentseriesself,储液罐: l8images=L8.filterDateself.Date\u Start,self.Date\u End.filterBoundsself.geometry; 打印18幅图像; l8images=l8images.mapself.clipimages; l8images=l8images.mapself.cloud函数; l8images=l8images。选择[B3,B5]; 计算imagecollection中每个图像的ndwi l8ndwi=l8images.mapself.l8ndwi; 马赛克=l8ndwi.mapself.areadate 马赛克=ee.ImageCollectionmosaics; 马赛克=马赛克。排序“系统:开始时间”,false; list=mosaic.reduceColumnsee.Reducer.toList2,['date','area'].获取'list'; 打印列表; 返回reservator.setee.Dictionaryee.Listlist.flatte; 如果uuuu name uuuuuu='\uuuuuuu main\uuuuuuu': 预测=储量 ppp=forecast.extenseriestable2; printpp.getInfo; 尝试和,而不是和:

image.mask.Andcloud01.not

为了将Python和运算符与Google Earth引擎中的and函数区分开来,只需对语法做一些小小的修改

希望有帮助