Google Earth Engine(GEE)——sentinel-1数据中乌克兰附近数据缺失轨道36缺失

ee.Filter.maxDifference(difference, leftField, rightValue, rightField, leftValue)
创建一个一元或二元过滤器,如果左和右操作数都在给定的最大差值内,则通过。如果作为一个连接条件,这个数字的差异被用作一个连接措施。

参数。
difference (Float):
过滤器将返回真值的最大差异。

leftField (String, default: null):
左边操作数的选择器。如果指定了leftValue,就不应该指定。

rightValue(对象,默认:null)。
右边操作数的值。如果指定了rightField,则不应该指定。

rightField(字符串,默认:null)。
右边操作数的选择器。如果指定了rightValue,则不应该指定。

leftValue(对象,默认:null)。
左边操作数的值。如果指定了leftField,则不应该指定。

返回。过滤器

ee.Join.saveBest(matchKey, measureKey, outer)
返回一个连接,将第一个集合中的每个元素与第二个集合中的匹配元素配对。具有最佳连接度量的匹配被作为一个额外的属性添加到每个结果中。当 withinDistance 或 maxDifference 过滤器被用作连接条件时,会产生连接测量。

参数。
matchKey(字符串)。
用来保存匹配的键。

measureKey (String)。
用于保存匹配的连接条件的措施的键。

outer(布尔值,默认:false)。
如果为真,没有匹配的主行将被包括在结果中。

返回。连接

filterMetadata(name, operator, value)
已删除。使用 filter() 与 ee.Filter.eq(), ee.Filter.gte() 等。

通过元数据来过滤一个集合的快捷方式。这相当于this.filter(ee.Filter.metadata(..))。

返回过滤后的集合。

参数。
this:collection(集合)。
集合实例。

name(字符串)。
要过滤的属性名称。

operator (String):
比较运算符的名称。可能的值是。"等于"、"小于"、"大于"。

"not_equals", "not_less_than", "not_greater_than", "start_with",

"end_with", "not_starts_with", "not_ends_with", " contains",

"不包含"。

value(对象)。
  - 要比较的值。

返回。集合

 

代码:

//乌克兰哨兵1A一致性:请看这里的细节。
// https://medium.com/@gglemoine62/12-day-sentinel-1-coherence-a-test-case for-ukrain-998488bf589

// 问题报告。
// 由于ALU软件的一个错误,相对轨道36的一致性错过了IW2的中心子路径。
// 但是,由于IW1和IW3没有问题,我们没有将它们排除在外。
// 我们打算在该错误修复后立即替换它们。

// COH12测试集有混合的VV(多数)和VH图像,都是单带的。
// 这就是为什么ee.Image.select('VV')不起作用。按偏振过滤如下。
var c12 = ee.ImageCollection('JRC/S1_COH_TEST').
  filterMetadata('system:index', 'ends_with', '_VV_coh12')

print(c12.size())
print(c12.first())
Map.addLayer(c12, null, 'Mosaic', false)

// 用S1_GRD_FLOAT加入COH12主站

var s0 = ee.ImageCollection('COPERNICUS/S1_GRD_FLOAT').
  filterDate('2021-09-01', '2022-09-02').filterBounds(geometry)

var masterDiffFilter = ee.Filter.maxDifference({
  difference: 10 * 1000,
  leftField: 'system:time_start',
  rightField: 'system:time_start'
});

var slaveDiffFilter = ee.Filter.maxDifference({
  difference: 10 * 1000,
  leftField: 'system:time_end',
  rightField: 'system:time_start'
});

// Define the join.
var saveMasterJoin = ee.Join.saveBest({
  matchKey: 'masterImage',
  measureKey: 'timeDiff'
});

var saveSlaveJoin = ee.Join.saveBest({
  matchKey: 'slaveImage',
  measureKey: 'timeDiff'
});

// Apply the joins.
var c12_joined = ee.ImageCollection(saveMasterJoin.apply(c12, s0, masterDiffFilter))

// Promote the relativeOrbitNumber_start 
c12_joined = c12_joined.map(function(f) { 
  return f.set('relativeOrbitNumber', ee.Image(f.get('masterImage')).get('relativeOrbitNumber_start'))
})

// Show the issue with relativeOrbitnumber 36
Map.addLayer(c12_joined.filterMetadata('relativeOrbitNumber', 'equals', 36), {min: 0.2, max: 1}, "IW2 missing for rel orbit 36")
Map.centerObject(geometry, 6)

猜你喜欢

转载自blog.csdn.net/qq_31988139/article/details/126407184