With this graph.xml file, the Graph Builder GUI used to show this error:
Could not parse expression: 'Sigma0_VV * ST20150315_Extent'. Numeric operands expected for binary '*' operator..
Then it transformed to this one: Expression is invalid. Undefined symbol 'Sigma0_VV.
Please note that this same process works perfectly well, when I do it manually (step by step using the GUI). And, I needed to uncheck virtual band in the band maths to save the result in a separate band in the new product.
I wonder if it’s just a bug or a step is missing in my process (between the import vector and the band maths).
You mention GeoTiffs - are you sure that you are at all times working with the full satellite product (contains full metadata) instead of the .tif measurement datasets? In practical terms you should never need to open the tiff-files themselves, but instead work with the full product (originally a .zip) and after subsetting save as Dimap as is customary inside SNAP.
I don’t think this issue has to do with the type of the input product. I tried as you suggested to give as an input a BEAM-DIMAP instead of a GeoTiff and I’m still getting the same outcome.
There is another error message that appears when I load the graph.xml file inside the graph builder: java.lang.String cannot be cast to org.esa.snap.gpf.operators.standard.BandMathsOp$BandDescriptor.
Maybe this could be helpful to track what’s missing in my graph.xml.
If I remove the BandMaths node from the graph.xml and keep only the ImportVector node, it works on the Graph Builder Gui, but not on the command line with gpt. I got this error on the command line with gpt:
+1 for getting the band maths operator to work in graph builder. It somehow disappeared from the bottom part of graph builder (when I reloaded a graph.xml) where you enter the parameters. In addition it would be great to 1) avoid cryptic (for the normal user) error messages like the one below and 2) the error messages should have a copy/paste option (i don’t like to write all the text to google it or to copy it to this forum)
The error is saying you are trying to do something with a band called Sigma0_VV but it can’t be found. Are you sure for your current product the band exists? I’m guessing it’s possible you saved the graph from a product which had VV and now may be running it on a different product without VV.
It doesn’t exist - but the previous graph step (Calibration) should have created it.
I think I found the problem - when changing the ‘Source Product’ in Graph ‘Read’ input it does not update some of the outputs and that causes the broken link - either that or it is linked to working with a subset?
If you subset an area and then working from that
Calibrate - Speckle - Band maths
The sigma0_VV will not be there in the band maths, but is for the larger, unsubsetted file.
Changing back and forth between the windws a few times and switching product types seems to trick it into seeing the correct file.
Haven’t tried the command line yet but will also give that a go too.
that’s a surprising bug. I have tried exactly the same expression in bandmath operator once separately and once inside a graph builder (to hopefully get the new band separated from the source product) and yet the band-math operator worked flawlessly on its own. I really really appreciate pointing this out