# Access Planetary Computing during Submission

**URL:** <https://community.drivendata.org/t/access-planetary-computing-during-submission/6951>\
**Category:** On Cloud N\
**Created:** [December 27, 2021, 8:42am UTC](https://community.drivendata.org/t/access-planetary-computing-during-submission/6951 "2021-12-27T08:42:48Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsensio](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@jsensio](https://community.drivendata.org/u/jsensio)\
**Post date:** [December 27, 2021, 8:42am UTC](https://community.drivendata.org/t/access-planetary-computing-during-submission/6951/1 "2021-12-27T08:42:48Z")

</div>

Hello, [here](https://www.drivendata.org/competitions/83/cloud-cover/page/412/) 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 ?

Thanks.

---

<div class="post-metadata">

**Author:** ![kwetstone](https://avatars.discourse-cdn.com/v4/letter/k/ee7513/32.png) [@kwetstone](https://community.drivendata.org/u/kwetstone)\
**Post date:** [December 31, 2021, 6:50pm UTC](https://community.drivendata.org/t/access-planetary-computing-during-submission/6951/2 "2021-12-31T18:50:22Z")

</div>

@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](https://github.com/microsoft/PlanetaryComputerExamples/blob/main/competitions/cloud-cover/additional-bands-tutorial.ipynb) for pulling additional bands. The method shown there should work in a submission. I hope that helps!

---

<div class="post-metadata">

**Author:** ![jsensio](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@jsensio](https://community.drivendata.org/u/jsensio)\
**Post date:** [January 2, 2022, 9:23am UTC](https://community.drivendata.org/t/access-planetary-computing-during-submission/6951/3 "2022-01-02T09:23:48Z")

</div>

Well, I think is clear from the last line:

> [@jsensio](#):
>
> pystac\_client.exceptions.APIError: (‘Connection aborted.’, RemoteDisconnected(‘Remote end closed connection without response’))

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 ?

Thanks.

---

<div class="post-metadata">

**Author:** ![motoki](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@motoki](https://community.drivendata.org/u/motoki)\
**Post date:** [January 3, 2022, 9:50am UTC](https://community.drivendata.org/t/access-planetary-computing-during-submission/6951/4 "2022-01-03T09:50:18Z")

</div>

I tried to use new bands, everything worked fine except that it did not really help.

---

<div class="post-metadata">

**Author:** ![motoki](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@motoki](https://community.drivendata.org/u/motoki)\
**Post date:** [January 3, 2022, 9:52am UTC](https://community.drivendata.org/t/access-planetary-computing-during-submission/6951/5 "2022-01-03T09:52:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jsensio](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@jsensio](https://community.drivendata.org/u/jsensio)\
**Post date:** [January 3, 2022, 2:31pm UTC](https://community.drivendata.org/t/access-planetary-computing-during-submission/6951/6 "2022-01-03T14:31:41Z")

</div>

Thanks for your reply, that must be the issue.

---

<div class="post-metadata">

**Author:** ![ials](https://avatars.discourse-cdn.com/v4/letter/i/46a35a/32.png) [@ials](https://community.drivendata.org/u/ials)\
**Post date:** [January 4, 2022, 9:29pm UTC](https://community.drivendata.org/t/access-planetary-computing-during-submission/6951/7 "2022-01-04T21:29:34Z")

</div>

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’_.

---

<div class="post-metadata">

**Author:** ![loweew](https://avatars.discourse-cdn.com/v4/letter/l/bc79bd/32.png) [@loweew](https://community.drivendata.org/u/loweew)\
**Post date:** [January 5, 2022, 2:03am UTC](https://community.drivendata.org/t/access-planetary-computing-during-submission/6951/8 "2022-01-05T02:03:58Z")

</div>

there’s an open PR to add rioxarray in the cloud-cover-runtime, hopefully it gets merged soon

---

<div class="post-metadata">

**Author:** ![jsensio](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@jsensio](https://community.drivendata.org/u/jsensio)\
**Post date:** [January 5, 2022, 7:46am UTC](https://community.drivendata.org/t/access-planetary-computing-during-submission/6951/9 "2022-01-05T07:46:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![motoki](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@motoki](https://community.drivendata.org/u/motoki)\
**Post date:** [January 5, 2022, 8:12am UTC](https://community.drivendata.org/t/access-planetary-computing-during-submission/6951/10 "2022-01-05T08:12:12Z")

</div>

Should we team up so you could focus on the real work? I am tired of getting same scores after many tries.

BTW, I have some interesting findings.

---

<div class="post-metadata">

**Author:** ![motoki](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@motoki](https://community.drivendata.org/u/motoki)\
**Post date:** [January 5, 2022, 8:13am UTC](https://community.drivendata.org/t/access-planetary-computing-during-submission/6951/11 "2022-01-05T08:13:03Z")

</div>

Then I don’t have any better idea. I don’t have connection issues.

---

<div class="post-metadata">

**Author:** ![rbgb](https://avatars.discourse-cdn.com/v4/letter/r/898d66/32.png) [@rbgb](https://community.drivendata.org/u/rbgb)\
**Post date:** [January 5, 2022, 2:03pm UTC](https://community.drivendata.org/t/access-planetary-computing-during-submission/6951/12 "2022-01-05T14:03:59Z")

</div>

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](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.
