Subset export format geotiff with specific path

hello

i use subset python script like this link ( snap-engine/snappy_subset.py at master · senbox-org/snap-engine · GitHub ) and work correct .

When the process is complete, a file and a folder are created :

  1. snappy_subset_output.dim
    2.snappy_subset_output.data (with raster with extension .img )

My question is how can i get results with geotiff format and how can i define specific path in snappy_subset_output.data folder with results ?

if i use something like this :

sub_product = GPF.createProduct("Subset", parameters, product)
ProductIO.writeProduct(sub_product,  out, 'GeoTIFF-BigTIFF’)

then i take error :

RuntimeError: org.esa.snap.core.dataio.ProductIOException: Product writer is unable to write product:
Cannot write multisize products. Consider resampling the product first.

thanks

The error tells you already what you need to do.
In GeoTiff bands with different sizes cannot be written.
You need to resample all bands to a common size first or you tailor your subset that it only contains bands of the same size.
For an example for the resampling you can have a look here:

This question I don’t understand.
You actually don’t need to specify a path within the data folder.
You should not write additional data into it. It will not break the BEAM-DIMAP format but it is not a good habbit.