Skip to content

Commit f486eac

Browse files
authored
Merge pull request #45 from bsipocz/ENH_async_cosmodc2
ENH: switching to use async TAP cosmodc2
2 parents 95b4c1d + 2671604 commit f486eac

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tutorials/cosmodc2/cosmoDC2_TAP_access.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,13 @@ adql
7575

7676
```{code-cell} ipython3
7777
# In order to use TAP with this ADQL string using pyvo, you can do the following:
78-
result = service.search(adql)
78+
result = service.run_async(adql)
7979
result
8080
```
8181

82-
The above query shows that there are 597,488,849 redshifts in this table.
82+
The above query shows that there are 597,488,849 redshifts in this table.
83+
Running ``count`` on an entire table is an expensive operation, therefore we ran it asynchronously to avoid any potential timeout issues.
84+
To learn more about synchronous versus asynchronous PyVO queries please read the [relevant PyVO documentation](https://pyvo.readthedocs.io/en/latest/dal/index.html#synchronous-vs-asynchronous-query).
8385

8486
+++
8587

@@ -125,7 +127,7 @@ adql
125127
Now we can use the previously-defined service to execute the query with the spatial contraint.
126128

127129
```{code-cell} ipython3
128-
cone_results = service.search(adql)
130+
cone_results = service.run_sync(adql)
129131
```
130132

131133
```{code-cell} ipython3
@@ -151,7 +153,7 @@ We can easily see form this plot that the simulated galaxies go out to z = 3.
151153

152154
Now let's visualize the galaxy main sequence at z = 2.0. First, we'll do a narrow redshift cut with no spatial constraint.
153155

154-
Let's do it as an asynchronous search since this might take awhile.
156+
Let's do it as an asynchronous search since this might take awhile, too.
155157

156158
```{code-cell} ipython3
157159
service = vo.dal.TAPService("https://irsa.ipac.caltech.edu/TAP")
@@ -188,4 +190,4 @@ plt.show()
188190

189191
**Updated:** 2024-07-24
190192

191-
**Contact:** [the IRSA Helpdesk](https://irsa.ipac.caltech.edu/docs/help_desk.html) with questions or reporting problems.
193+
**Contact:** [the IRSA Helpdesk](https://irsa.ipac.caltech.edu/docs/help_desk.html) with questions or reporting problems.

0 commit comments

Comments
 (0)