Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

245
Views
Mapear una función con más de un argumento

Tengo una función que me gustaría mapear sobre una colección de imágenes:

 var moisture = function (img, driest, wettest){ var img = img.clip(table).select('VV') var sensitivity = wettest.subtract(driest); var SMmax=0.32; var SMmin=0.05; var calculateSSM = function (image){ return image.addBands(((image.subtract(driest)).divide(sensitivity)) .multiply(SMmax-SMmin).add(SMmin)); }; var ssm = calculateSSM(img) var ssm = ssm.select('VV_1').rename('moisture'); return ssm} var coll2014 = ee.ImageCollection('COPERNICUS/S1_GRD_FLOAT') .filterBounds(table) .filterDate('2014-08-15','2014-12-31') .map(function (img) {return ee.Image(img).log10().multiply(10.0)}); var dry2014 = coll2014.min() var wet2014 = coll2014.max()

¿Cómo puedo pasar driest y wettest ? lo intenté

 var add = moisture.bind (null, dry2014, wet2014) var moisture2014 = coll2014.map(add)

pero no parece funcionar. O, mejor aún, ¿hay alguna forma de definir dry2014 y wet2014 dentro de la función? Gracias :)

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Está vinculando los argumentos 1 y 2, pero los driest y wettest son los argumentos 2 y 3. No hay forma de omitir argumentos cuando se usa bind() .

Así que usa una función anónima con map()

 var moisture2014 = coll2014.map(img => moisture(img, dry2014, wet2014));
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!