# Band Maths - reading in a non-constant multiplier

Hi there,
I was wondering if someone would be able to help.

I have a number of Sentinel 1 sigma0 products, which I am trying to remove the dependency of the look angle, through the equation below:

I have the pre-processed products of , as well as the exported Local Incidence Angles, , and I have calculated values of B. The values of B are different for each product. If the value of B was constant (e.g. -0.15), I would use the band maths tool, as shown below:

and use the xml file with the gpt to batch process. However, with varying values of B, I want to try to include them as an input file (such as through a third â€śReadâ€ť tool, but with a single value rather than a product).

Currently, the B values are within a separate .txt document (just as a placeholder, to make sure that the other batch of code works). This can be changed to other formats (.csv, etc).

Any help would be greatly appreciated.

Thanks

I think in your case you have n. of products sigma0 and the variable factor is B, in this case using gpt as mentioned above doesnâ€™t solve the problem, but you could use,

Bulk Processing with GPT, to set loop of different input products and also, set the many parameters,

Hi falahfakhri,

Iâ€™m already using gpt to batch process the products from the GRD products to the pre-processed level. Iâ€™ve already used the bulk processing with GPT link to help with the current batch processing.

Ideally, I would use the gpt to process this band math step. Iâ€™ve attached the xml file that I would use (A8_BandMaths_VVCorr.xml (1.7 KB)), which is ready to work with a gpt file. The value of B that I would want to change with each pre-processed step would be on Line 28 (-0.15 in the example).

For the Local Incidence Angles and the Sigma_0 values, I use \$input_LIA and \$input_VV (line 7 and line 14 respectively), as part of the â€śReadâ€ť tool. Ideally, I would use something like â€ś\$Betaâ€ť, for the value of B. Would I be able to set it up in some way, similar to the â€śresample_20m.propertiesâ€ť file in the Bulk Processing with GPT example?

Thanks

As I mentioned above the loop should be created using *bat file for windows and bash for linux,

Focus at this post in the above thread, how to create the loop, Source of the post

With regarding to your *xml file, actually should be edited by adding up multi band math according to how many times you want the Beta value to be changed,

Iâ€™ve already cracked how to get the gpt batch process working, through running bash script, as I have already written bash script for the preprocessing stages (Applying Orbital Files through the calibration and subsetting the products). Getting the gpt working isnâ€™t the issue.

My main issue was regarding if variables could be defined within the expression part of band maths (the same way in which the file names are defined in the processDataset.bash file). Having done some more digging on the forums, Iâ€™ve come across what I believe is the solution to my problem Bandmath xml gpt, however I am yet to test this.

Yes indeed this could be the solution, well done, and thank you , that you brought my attention to it, please let me know if it works for you or not, But still my concerns, how you could run it over multiple products since you already defined the input in your *xml as Read1, Read2?

In my bash script, I have an embedded FOR loop, that looks at every .zip file (Sen1 GRD file) and processes it, using the date and relative orbit file to define the processed filenames and file paths.

I define my filenames using StartTime as the defining feature (organised in folders named by relative orbit number).

Iâ€™ve attached my bash script that I am using for my preprocessing (has commented steps for completion).

Bash File: 190820_gpt_batch_singletile.bash (4.0 KB)

1 Like