Update cloudiness with batching and multi-threading #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goal of these updates is to significantly reduce the current computational cost of cloudiness calculations for both forecasted (future) and archived (historical) data.
The code updates mainly impacted utils/cloudiness.py, and included:
We also updated the main py file next_pass.py to include a 1 minute waiting time between Sentinel-1 and Sentinel-2 when cloudiness is requested, to avoid hitting the weather API minute usage limits (600 calls / min).
Without cloudiness, the next-pass computation completes in 3 minutes and 55 seconds. Enabling the cloudiness option (-c) with the previous implementation increased the runtime to 15 minutes and 47 seconds. With the present updates, the runtime is reduced to 4 minutes and 52 seconds (including the mandatory 1-minute wait to avoid rate limiting), corresponding to a gain of approximately 11 minutes, or a ~69% reduction in runtime compared to the previous cloudiness-enabled version.