Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

247
Visualizações
Map a function with more than one argument

I have a function that I would like to map over an image collection:

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()

How can I pass driest and wettest? I tryed

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

but it doesn't seem to work. Or, even better, is there a way to define dry2014 and wet2014 inside the function? Thank you :)

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You're binding the 1st and 2nd arguments, but driest and wettest are the 2nd and 3rd arguments. There is no way to skip arguments when using bind().

So use an anonymous function with map()

var moisture2014 = coll2014.map(img => moisture(img, dry2014, wet2014));
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda