Subset export format geotiff with specific path


i use subset python script like this link ( snap-engine/ 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 (with raster with extension .img )

My question is how can i get results with geotiff format and how can i define specific path in 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.


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.