Python BandMath "saving" option for multiple?

Hello !

When I use the GUI to perform some band math, resulting created bands are saved in the current product under the folder “sun” inside the main “Bands” folder. Good.

When I use python to do so, the GPF.createProduct or writeProduct only create a product with my new created band, and I loose all other ones in the process so can’t perform multiple processes. I’ve tried to look for exisiting parameters for “BandMath” but to no avail.

The only one I know of is :

parameters = HashMap()
parameters.put(‘targetBands’, All_sung_ln)

Is there a way to just add new created bands to current product?

Thanks

Hi,

a new band can be added to an existing product by using

product.addBand("bandName", "the expression")