Skip to content
Snippets Groups Projects
Commit cb16dee7 authored by Pierre Chanial's avatar Pierre Chanial
Browse files

Add notebook for the ESCAPE General Assembly demo.

parent 07c601ee
Branches
No related tags found
No related merge requests found
......@@ -3,5 +3,6 @@
__pycache__/
.mypy_cache/
.ipynb_checkpoints/
.coverage
htmlcov
......@@ -120,3 +120,25 @@ The new table `apertif_table` can be imported by the Python client as Pandas dat
```python
table.aspandas()
```
## Creation of a table from a TAP query
All the TAP services can be accessed through ESAP-DB. Queries can be stored as a table in a user's dataset.
A VO table is referenced in ESAP-DB by `tap_service.schema_name.table_name`. The following example
performs a cone search around an optical source in the Gaia DR3 catalog.
```python
query = """
SELECT *
FROM esavo_gaia_tap.gaiaedr3.gaia_source
WHERE 1 = CONTAINS(
POINT('ICRS', ra, dec),
CIRCLE('ICRS', 207.5, 52.5, 1.)
)
"""
print(f'Cone search around optical source...', end='')
table_optical = dataset.create_table_as(query, 'optical')
print(f' {len(table_optical)} results.')
table_optical.aspandas()
```
This diff is collapsed.
This diff is collapsed.
......@@ -6,20 +6,23 @@ authors = ["Pierre Chanial <pierre.chanial@ego-gw.it>"]
[tool.poetry.dependencies]
python = "^3.9"
trio = "^0.19.0"
trio-websocket = "^0.9.2"
asks = "^2.4.12"
requests = "^2.25.1"
pandas = "^1.2.5"
pydantic = "^1.8.2"
tabulate = "^0.8.9"
termcolor = "^1.1.0"
ipykernel = {version = "^6.8.0", optional = true}
jupyter = {version = "^1.0.0", optional = true}
nbconvert = {extras = ["webpdf"], version = "^6.4.1", optional = true}
[tool.poetry.dev-dependencies]
pytest = "^6.2.4"
pytest-xdist = "^2.3.0"
ipython = "^7.25.0"
pre-commit = "^2.13.0"
pre-commit = "^2.17.0"
[tool.poetry.extras]
jupyter = ["jupyter", "ipykernel", "nbconvert"]
[build-system]
requires = ["poetry-core>=1.0.0a5"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment