Open etboudreau opened 2 months ago
Looks like it's related to https://forum.earthdata.nasa.gov/viewtopic.php?t=5917! I was able to get rid of that error by modifying "HLSS30.v2.0" -> "HLSS30_2.0" and "HLSL30.v2.0" -> "HLSL30_2.0" in a couple of places, but now I'm running into an issue like the other person on the forum post where the metadata isn't accessible! My current issue....
hls = easysnowdata.remote_sensing.HLS(
bbox_input=bbox_gdf, start_date="2022-07-01", end_date="2022-07-31"
)
Data searched. Access the returned seach with the .search_landsat or .search_sentinel attribute.
Data retrieved. Access with the .data attribute. Data CRS: WGS 84 / UTM zone 10N.
Nodata values removed from the data. In doing so, all bands converted to float32. To turn this behavior off, set remove_nodata=False.
Data scaled to reflectance. Access with the .data attribute. To turn this behavior off, set scale_data=False.
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
Cell In[113], line 1
----> 1 hls = easysnowdata.remote_sensing.HLS(
2 bbox_input=bbox_gdf, start_date="2022-07-01", end_date="2022-07-31"
3 )
File ~/repos/easysnowdata/easysnowdata/remote_sensing.py:1898, in HLS.__init__(self, bbox_input, start_date, end_date, bands, resolution, crs, remove_nodata, scale_data, add_metadata, add_platform, groupby)
1896 self.scale_data_inplace()
1897 if self.add_metadata:
-> 1898 self.get_combined_metadata()
1899 if self.add_platform:
1900 self.add_platform_inplace()
File ~/repos/easysnowdata/easysnowdata/remote_sensing.py:2141, in HLS.get_combined_metadata(self)
2140 def get_combined_metadata(self):
-> 2141 L30_metadata = self.get_metadata(self.search_landsat.item_collection())
2142 S30_metadata = self.get_metadata(self.search_sentinel.item_collection())
2143 combined_metadata_gdf = (
2144 pd.concat([L30_metadata, S30_metadata])
2145 .sort_values("datetime")
2146 .reset_index(drop=True)
2147 )
File ~/repos/easysnowdata/easysnowdata/remote_sensing.py:2109, in HLS.get_metadata(self, item_collection)
2107 series_list = []
2108 for item in item_collection:
-> 2109 url = item.assets["metadata"].href
2110 series = HLS_xml_url_to_metadata_df(url)
2111 series_list.append(series)
KeyError: 'metadata'
Will update once I hear something!
Sounds like this will be fixed in the next release of CMR STAC as per https://forum.earthdata.nasa.gov/viewtopic.php?t=5917&sid=b4b06789ded40a458da294708f21e7d5&start=10
We'll see how long that takes! For now you can pass in add_metadata=False, add_platform=False, and it should work!
Environment Information
Description
I was trying to load the Harmonized Landsat Sentinel-2 v2.0 and got an error about no coastal aerosol band existing.
What I Did