Obtaining multiple variables

Hey @jeroen.dries or others.

Would it be possible to obtain simultaneously two files (distinct files) when we create and send a job?

Basically includes two variables in this part:

        output_save = output.save_result(format='GTiff') #GTiff #netCDF
        my_job  = output_save.create_job(title= output_name, job_options=job_options)
        results = my_job.start_and_wait().get_results()

Currenlty there is only one output variable, which is a bit mask but we would like to download an RGB image (s2_cube_median) for the same area. Thus, we send only one job but we will get two ouputs (2 separate files) at once.

This is a full code where you can see the s2_cube_median and output variables defined.

Sometimes only one file will be needed, so it will be great to have an option to choose if two or one file will be obtained.

Hi Andrea,
so if I understand correctly, the key thing is to get two separate files right? Because we now indeed return always all variables/bands in a single file.
Are s2_cube_median and output sufficiently compatible to combine in a single datacube (with merge_cubes) or would these have to remain separate cubes?

If it’s separate cubes, than we would need to allow multiple save_result processes in a single graph.
The other option would perhaps be an output format parameter that simply creates separate files per variable/band.

Any idea what would be better for your use case?


Hi Jeroen,

Thanks for the quick response. It should remain two separate files.

I just explain a bit more about the purpose of files:

  • the 1st file (output) should show a water extent which is a binary raster. This file should be obtained always from processing as a main result.
  • the 2nd file (s2_cube_median) should show the RGB bands (B2, B3, B4) so we can depict this file as a background map of a water extent for the validation. This should be optional to obtain as a user might be not interested in this file.

I am not really sure which options (either mutlple save_result or output format parameter) is better for this purpose. Will they have the same processing time?
The main priority should be that the second file can be optional for a user and the processing time should be still decent.

@sulova.andrea it would be possible to have a single geoTIFF with the water extent binary image + RGB bands and the option would just trigger two differrent process graphs no?
So if the user wants just the binary mask it runs the simple process graph, if he needs both the other one.

We would rather keep only one process graphs which can provide the two files prefarably

ok, so this is clearly a new feature, we’ve logged it, it’s also requested by one other user already, so good candidate for implementation via the new user voting user mechanism.

1 Like