-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix lint errors in datacube script #36
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7fd0939
:rotating_light: Fix E501 Line too long
weiji14 cc99ae4
:recycle: Refactor best_nodata and best_clouds into single sort function
weiji14 262aaa6
:ambulance: Quickfix with getting the STAC item with a specific datetime
weiji14 2af24be
:label: Rename variables to ds_ (xr.Dataset) or da (xr.DataArray)
weiji14 4664b59
:wrench: Set pylint max-args to 6
weiji14 a396c5d
:wastebasket: Replace .get_all_items() with .item_collection()
weiji14 f65e34a
:fire: Remove sorting by nodata and just sort by least cloud cover
weiji14 7b20878
:memo: More DataArray to Dataset renames
weiji14 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lillythomas, the linter was picking up that the
best_nodata
variable wasn't used. I've refactored this to sort based on lowests2:nodata_pixel_percentage
first, and then lowesteo:cloud_cover
, so the resulting dataframe (searching between dates2020-01-13/2020-01-19
) would look something like this:And we would pick the first row here (datetime:
2020-01-17T18:47:09.024000Z
). Does this look ok? Or should we change the logic a bit (e.g. as long as the nodata_pixel_percentage is <20%, we just pick the lowest cloud cover, which would then be datetime:2020-02-01T18:46:11.024000Z
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I knew that
best_nodata
wasn't being used because I was mainly thinking that optimizing for least cloud cover is our best bet given that there is a pre-existing filter for nodata by way of{"op": "<=", "args": [{"property": "s2:nodata_pixel_percentage"}, nodata_pixel_percentage]}
in the search query. I think this is a good alternative, but in some/many cases it won't optimize for cloud cover (as this example shows where the first row has a nontrivial amount of cloudy pixels - 33 %).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so we would just pick the least cloudy image then, as long as the
nodata_pixel_percentage
is below the 20% threshold? I.e. simply remove thebest_nodata
variable and stick to having justbest_clouds
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think the best call is for us to just remove the
best_nodata
variable 👍There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done at f65e34a!