Skip to content
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

Better date handling with missing LS8 bands #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dshean
Copy link
Member

@dshean dshean commented Feb 19, 2019

Fixes error that I encountered using LS8 row,path (46, 27) with example notebook. There was one missing B4.TIF file, which produced inconsistent number of datasets and dates (when extracted from original df).

@dshean
Copy link
Member Author

dshean commented Feb 19, 2019

Now realizing this might not be repo for latest example notebooks. @scottyhq, maybe you can integrate wherever appropriate?

@scottyhq
Copy link
Member

Sorry for the confusion @dshean, there are now a few versions of this notebook with a few fixes as you've picked up. the search was set up without date bounds and it seems like that was causing the issue. See also a slightly modified notebook from the December 2018 AGU tutorial (https://github.com/pangeo-data/pangeo-tutorial-agu-2018), and a demonstration of accessing the same Landsat8 data on AWS as of Feb 2019 (https://github.com/scottyhq/esip-tech-dive).

@dshean
Copy link
Member Author

dshean commented Feb 19, 2019

OK, thanks for the links. It's still an issue in the updated notebooks. Issue is:
index = gpd.pd.DatetimeIndex(items.dates(), name='time')
You're assuming all items have valid datasets. My case with a different path/row had one missing B4.tif, so index contained 112 items.dates(), but datasets lists contained only 111 datasets from the for loop in the cell above with the try/except. So the mismatch causes concatenate step to fail (da = xr.concat(datasets, dim=index)). I just created another list to store dates and used that to create the Datetimeindex, but could also pull out directly from the datasets list. Should be a simple fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants