Hi Agustin,

The BandMath tool only processes the images of equal sizes. So I would go with creating an image with repeated lines, and I think the VRT format can do that.

After a quick search here, I think you can create :

  • a VRT with the size of A,
  • put inside a single 'SimpleSource' which is your one-line image B
  • set the 'DstRect' parameter to the full dimension, it will stretch the one-line image to fit the full image
  • you tell GDAL to use nearest neighbor interpolation : <SimpleSource resampling="nearest">
Regards,
Guillaume

On 11/05/2018 06:40 PM, Agustin Lobo wrote:
In order to calculate reflectance from a multi-spectral radiance image
acquired with a linear scanner, I also have a 1-row array of white
reference values,
that is:

multi-spectral image A: x rows, y cols, z bands
multi-spectral white reference image B: 1 row, y cols, z bands

I would need to divide each row of A by B.

In a simple notation:
res <- a
for(i in 1:nrow(a)){
  res[i,,] <- a[i,,]*b
}

I'd like to this for relatively large images (x=969, y=640, z=224),
avoiding any loop if possible.
The most obvious strategy would be to create a b2 image by repeating the
row of b x times and then use the otb raster arithmetic for a/b2. But is there
an otb way to create such a b2? or perhaps another approach (I.e using
the BandMath tool?)
Thanks
Agus


--
Guillaume PASERO
Responsable technique
Business Unit ESPACE & GeoInformation - Département Payload Data & Applications

CS Systèmes d'Information
Parc de la Grande Plaine - 5, Rue Brindejonc des Moulinais - BP 15872
31506 Toulouse Cedex 05 - FRANCE
+33 561 17 64 21 - [email protected]

--
--
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html
 
You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
---
You received this message because you are subscribed to the Google Groups "otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to