Hello, here it is stated that access to the Planetary Computer is allowed during evaluation of a submission. I am trying to download extra bands but having connection issues:
[…]
File “/srv/conda/envs/condaenv/lib/python3.9/site-packages/pystac_client/item_search.py”, line 436, in get_items
for item_collection in self.get_item_collections():
File “/srv/conda/envs/condaenv/lib/python3.9/site-packages/pystac_client/item_search.py”, line 424, in get_item_collections
for page in self._stac_io.get_pages(self.url, self.method, self.get_parameters()):
File “/srv/conda/envs/condaenv/lib/python3.9/site-packages/pystac_client/stac_api_io.py”, line 209, in get_pages
page = self.read_json(url, method=method, parameters=parameters)
File “/srv/conda/envs/condaenv/lib/python3.9/site-packages/pystac/stac_io.py”, line 197, in read_json
txt = self.read_text(source, *args, **kwargs)
File “/srv/conda/envs/condaenv/lib/python3.9/site-packages/pystac_client/stac_api_io.py”, line 77, in read_text
return self.request(href, *args, parameters=parameters, **kwargs)
File “/srv/conda/envs/condaenv/lib/python3.9/site-packages/pystac_client/stac_api_io.py”, line 139, in request
raise APIError(str(err))
pystac_client.exceptions.APIError: (‘Connection aborted.’, RemoteDisconnected(‘Remote end closed connection without response’))
Do we have to do something special to have connection to the STAC API ?
@jsensio It’s hard to tell just from the stack trace what the issue may be. If you haven’t, I’d recommend looking at the tutorial for pulling additional bands. The method shown there should work in a submission. I hope that helps!
There is a connection error to the API from the evaluation environment. I am using the same code from the tutorials. Locally everything works fine. So my impression is that the problem comes from internet connection being disabled during evaluation. Have you tried and validated that access to the planetary computer works fine during evaluation ?
Also, we have to put query code in a try except block. Not all images have new bands in 60-minute interval. I need to increase to 180 minutes to have them. Also the query is so slow.
Thanks @motoki for the tip. In any case, I would to know if you or @jsensio used the rioxarray for loading additional PySTAC assets in your submissions — I ask this to you because I am getting an error message stating No module named ‘rioxarray’.
I raised the time window to 180 minutes but still having connection issues 🥲 @ials I am using rasterio over rioxarray since I m not familiar with the later. That is the only change I made to the tutorial code. Nevertheless making a PR to add a new library is very easy and fast, I did it for the flooding competition and the team was very responsive in adding the new library.
There are restrictions on internet access in the code execution environment, but we allow the Planetary Computer STAC API (https://planetarycomputer.microsoft.com/api/stac/v1). I’ve confirmed that all of the compute resources can access that URL, so I’m not sure what it could be.
Also I just merged the PR that adds rioxarray, so it should be available in the code execution environment in a few minutes.