0

my code looks like this.

Function:

    s2SrWithCloudMask = ee.Join.saveFirst('cloud_mask').apply({
      'primary': s2Sr,
      'secondary': s2Clouds,
      'condition': ee.Filter.equals({'leftField': 'system:index', 
      'rightField': 'system:index'})
     })

Error i got when I try to run my code as follows:

Unrecognized argument type to convert to a FeatureCollection: {'primary': <ee.imagecollection.ImageCollection object at 0x7fda2ad54610>, 'secondary': <ee.imagecollection.ImageCollection object at 0x7fda2aa00e10>, 'condition': <ee.filter.Filter object at 0x7fda2aa0bb50>}

Any suggestions would be helpful. Thanks in advance.

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Sep 20 '22 at 11:23

1 Answers1

0

Python, unlike JavaScript, has dedicated syntax for named function arguments. The Earth Engine client follows this difference, so you need to use named argument syntax instead of dictionary syntax. This means:

  • No {}
  • Use = instead of :
  • Do not quote the parameter names
    s2SrWithCloudMask = ee.Join.saveFirst('cloud_mask').apply(
      primary=s2Sr,
      secondary=s2Clouds,
      condition=ee.Filter.equals(leftField='system:index', rightField='system:index')
    )
Kevin Reid
  • 37,492
  • 13
  • 80
  • 108