Snappy WindField csv file

Hi everybody,

I have a quick question about the generation of the csv Wind Field file by the snappy module:
The input file already passed by the calibration, Apply Orbit File and Multilook processes. I am trying to generate the csv Wind Field file (“vector_data/WindField.csv”) but after the processing finishes I can’t find the file in the folder. This is the test code that I am using:

>>>> import jpy
>>>> from snappy import ProductIO, GPF, HashMap
>>>> HashMap = jpy.get_type('java.util.HashMap')
>>>> p = ProductIO.readProduct(ifile)
>>>> params = HashMap()
>>>> params_wind = HashMap()
>>>> params_wind.put('windowSizeInKm', 3.0)
>>>> data = GPF.createProduct('Land-Sea-Mask', params, p)
>>>> result = GPF.createProduct('Wind-Field-Estimation', params_wind, data)
>>>> ProductIO.writeProduct(result, "wind_csv_test", "BEAM-DIMAP")

On the other hand when do it via SNAP Desktop I am able to generate this file normally. Is there any special configuration to generate the csv by snappy?

Thank you!

Edit.: I’m using SNAP 5.0 version

Hi again,

I just discovered that If I do the follow command TWO times, the file WindField.csv is mysteriously created:
ProductIO.writeProduct(result, "wind_csv_test", "BEAM-DIMAP")

So to obtain the file I need always to use this line of code twice. Probably it is a bug.

Thanks!

Is it possible that it just takes a while till the file shows up?
If I understand the source code correctly the file is written when the operator is disposed. This happens when the product is disposed and this happens when the JVM is shutdown or it is called explicitly on the product.
If writeProduct is you last statement then you should only need to wait a bit till the JVM is shut down.
If there is more code to come you can call result.dispose().
But afterwards the product isn’t usable anymore.