I have a list of files that need to be preprocessed using just one command before being mosaicked together. This preprocessing command uses third-party software via system call to write to a geoTIFF. I wanted to use multi-threading so that the individual files can be pre-processed at the same time and then, once all individual files are processed, the results can be mosaicked together.
I have never used multi-threading/parallel processing before, and after hours of searching on the internet, I still have no clue what the best, simplest way to go about this is.
Basically, something like this:
files_list = # list of .tif files that need to be mosaicked together but first, need to be individually pre-processed
for tif_file in files_list:
# kick the pre-processing step out to the system, but don't wait for it to finish before moving to preprocess the next tif_file
# wait for all tiffs in files_list to finish pre-processing
# then mosaick together
How could I achieve this?