Convert virtual bands to real ones from GPT

I see you are planning to make conversion of virtual bands to real bands more accessible: https://senbox.atlassian.net/browse/SNAP-625

But are you also planning to make a function for that in gpt?

I know the bands get converted when I write to any format other than DIMAP. But for GeoTIFF, I get a single file with a lot of bands, where it is impossible to know which band corresponds to which product. And with NetCDF-CF, the data is reprojected to WGS84.

I can see it can be done with snappy, but I don’t have access to that from my workflow.

Also, reproject converts, but I would rather not use that just for this purpose, if I can avoid it.

tl;dr +1 for a gpt function for converting virtual bands

So what you are suggesting is a GPF operator that writes virtual bands as “real” bands and saves them as DIMAP? This is not planned (and right now to me this seems to be a rather special case). However, when the conversion is available writing such an operator would be very easy.

Exactly.

I can see that. To explain my case: I am using a SNAP algorithm that produces a lot of data products as virtual bands (C2RCC). I want to take some of these bands and work with them in another software. So either I export the whole to .dim file to GeoTIFF and figure out which of the 100 bands is the one I need, or I convert the virtual bands to proper .img files in the .data folder that accompanies my .dim output file, from where I can acess them by name.

I prefer the second option (extract bands by name), because it seems more sane. But maybe it is not, since the names of the output files probably can change as easily as the number/order of the bands.

Hi Jonas,

I think you can do the conversion with the BandMaths operator and merge the result with the original C2RCC ouptut by using the Merge operator afterwards.

Thanks @marpet, I will try that. I do not even need the combined output, so if BandMaths works, that would satisfy my needs.