diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..9dac20064f18286478fd3c490e33747824a74d12
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.fits.gz
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..01cd05ba3468f0beb4f3a10bbcccfcfd4b9b115f
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2024 CAVITY Team
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/README.md b/README.md
index 8ea85d4b9c5db75961280e03ef77356622b763a1..659c989d7dd54f3a149c624a2080a51de908f78e 100644
--- a/README.md
+++ b/README.md
@@ -1,92 +1,5 @@
# DR1 tutorials
+[](https://mybinder.org/v2/git/https%3A%2F%2Fgloton.ugr.es%2Fgitlab%2Fcavity%2Fdr1-tutorials)
-
-## Getting started
-
-To make it easy for you to get started with GitLab, here's a list of recommended next steps.
-
-Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
-
-## Add your files
-
-- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
-- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
-
-```
-cd existing_repo
-git remote add origin https://gloton.ugr.es/gitlab/cavity/dr1-tutorials.git
-git branch -M main
-git push -uf origin main
-```
-
-## Integrate with your tools
-
-- [ ] [Set up project integrations](https://gloton.ugr.es/gitlab/cavity/dr1-tutorials/-/settings/integrations)
-
-## Collaborate with your team
-
-- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
-- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
-- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
-- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
-- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
-
-## Test and Deploy
-
-Use the built-in continuous integration in GitLab.
-
-- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
-- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
-- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
-- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
-- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
-
-***
-
-# Editing this README
-
-When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
-
-## Suggestions for a good README
-Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
-
-## Name
-Choose a self-explaining name for your project.
-
-## Description
-Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
-
-## Badges
-On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
-
-## Visuals
-Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
-
-## Installation
-Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
-
-## Usage
-Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
-
-## Support
-Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
-
-## Roadmap
-If you have ideas for releases in the future, it is a good idea to list them in the README.
-
-## Contributing
-State if you are open to contributions and what your requirements are for accepting them.
-
-For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
-
-You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
-
-## Authors and acknowledgment
-Show your appreciation to those who have contributed to the project.
-
-## License
-For open source projects, say how it is licensed.
-
-## Project status
-If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
+This repository contains basic tutorials showing the CAVITY TAP service functionalities.
\ No newline at end of file
diff --git a/files/galaxies_votable_example.xml b/files/galaxies_votable_example.xml
new file mode 100644
index 0000000000000000000000000000000000000000..757d029c3f9dc430ae214595233d1ab63011164a
--- /dev/null
+++ b/files/galaxies_votable_example.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+ 1 |
+ 116.102013 |
+ 33.342975 |
+
+
+ 2 |
+ 222.141865 |
+ 31.935599 |
+
+
+ 3 |
+ 184.360931 |
+ 44.521568 |
+
+
+ 4 |
+ 15.234771 |
+ -10.004942 |
+
+
+ 5 |
+ 129.820053 |
+ 50.685875 |
+
+
+
+
+
+
diff --git a/notebooks/tutorial_DR1.ipynb b/notebooks/tutorial_DR1.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..d1438f1aafc65f6f6cf8fec04d0f2bd33f0fc947
--- /dev/null
+++ b/notebooks/tutorial_DR1.ipynb
@@ -0,0 +1,439 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "4580630b-87de-4270-809f-d386ab81266c",
+ "metadata": {},
+ "source": [
+ "# TAP service tutorial and data download"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "23bd1ad1",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import glob\n",
+ "\n",
+ "import requests\n",
+ "import pyvo"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "89694ef4",
+ "metadata": {},
+ "source": [
+ "# Connect to the CAVITY TAP service"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "bc54a8ca",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "url = \"https://cavity.caha.es/tap\"\n",
+ "token = 'cf16899d345b765aba64b63ec0a92700a00beb36'"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "405d81a5",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "CONNECTED: https://cavity.caha.es/tap\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Setup authorization\n",
+ "tap_session = requests.Session()\n",
+ "tap_session.headers['Authorization'] = f'Token {token}'\n",
+ "\n",
+ "# Init service\n",
+ "tap_service = pyvo.dal.TAPService(url, session=tap_session)\n",
+ "\n",
+ "if tap_service.availability:\n",
+ " print(f\"CONNECTED: {url}\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9e17162b",
+ "metadata": {},
+ "source": [
+ "# Get catalogues"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "6e6808b4",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "lang = \"ADQL\"\n",
+ "\n",
+ "query_group = 'DR1_Demo'"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "id": "c8161bdb",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Master catalogue + ALFALFA MPA and Mophology data for al DR1 galaxies\n",
+ "table_name='dr1_catalogues'\n",
+ "\n",
+ "query = \"\"\"-- PPAK cubes subselection\n",
+ "\n",
+ "SELECT * from dr1.Master\n",
+ "JOIN dr1.ALFALFA_SDSS USING (galaxy)\n",
+ "JOIN dr1.MPA USING (galaxy)\n",
+ "JOIN dr1.Morpho USING (galaxy)\n",
+ "\"\"\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "id": "ca900c5e",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# syncronous (only for very small queries)\n",
+ "tap_result = tap_service.run_sync(query, runid=query_group, table_name=table_name, language=lang)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "id": "91c92ae6",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
Table length=100\n",
+ "
\n",
+ "galaxy | void | ra | dec | redshift | effr_frac | morphology | d25 | incl | pa | rabsmag | sb | g-r | Av | M_star | fluxHI | vmaxg | log(SFR) | SDSS_ID | AGC | HIflux | sigflux | logMHI | logMHI_err | logMstarTaylor | logMstarTaylor_err | logMstarMcGaugh | logMstarMcGaugh_err | logMstarGSWLC | logMstarGSWLC_err | logSFR22 | logSFR22_err | logSFRNUVIR | logSFRNUVIR_err | logSFRGSWLC | logSFRGSWLC_err | specObjID | bestobjID | oh_p50 | lgm_tot_p50 | sfr_tot_p50 | specsfr_tot_p50 | sn_median | h_alpha_flux | h_alpha_flux_err | h_beta_flux | h_beta_flux_err | oiii_5007_flux | oiii_5007_flux_err | nii_6584_flux | nii_6584_flux_err | oii_3726_flux | oii_3726_flux_err | oii_3729_flux | oii_3729_flux_err | h_alpha_cont | h_alpha_cont_err | h_alpha_reqw | h_alpha_reqw_err | h_alpha_eqw | h_alpha_eqw_err | probaSab | probaScd | probaEll | probaS0 | probaEarly | probaLate | GZ2class | pnobulge | pobvious | pdominant | GZ2formula | GZ1S | GZ1Ell | GZ1U | TType_DS |
\n",
+ " | | dex(deg) | dex(deg) | | | | dex(arcsec) | dex(deg) | dex(deg) | [mag] | [mag·arcsec⁻²] | [mag] | [mag] | [log(M☉)] | [Jy·km·s⁻¹] | [km·s⁻¹] | [log(M☉·yr⁻¹)] | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
\n",
+ "int32 | int32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | str19 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | str19 | str19 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | str8 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 |
\n",
+ "3430 | 654 | 132.4546 | 51.09398 | 0.044739 | 0.512825 | -2.44 | 26.394318 | 56.07484 | 87.16 | -20.065 | 23.207045 | 0.908 | 0.055701 | 10.53708 | -- | -- | -1.255461 | 1237651249875255579 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 503292408134395904 | 1237651249875255579 | -9999.0 | 10.53708 | -1.255461 | -11.84293 | 30.08854 | 8.133125 | 5.961778 | 9.890788 | 6.003214 | 3.409627 | 2.90654 | 5.359654 | 2.883173 | 1.665248 | 4.840681 | -12.26812 | 4.569426 | 45.0214 | 0.756332 | 1.66552 | 0.132222 | -0.174099 | 0.132222 | 0.06 | 0.03 | 0.08 | 0.82 | 0.9 | 0.09 | Ei | 0.0 | 1.0 | 0.0 | 2.36 | 0.0 | 1.0 | 0.0 | -2.44 |
\n",
+ "3666 | 654 | 129.82005 | 50.685875 | 0.044856 | 0.680431 | 5.07 | 22.560259 | 58.641518 | 67.07 | -18.714 | 24.288118 | 0.461 | 0.069253 | 9.476982 | -- | -- | -0.157294 | 1237651250948407434 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 501167326968702976 | 1237651250948407434 | 8.810315 | 9.476982 | -0.157294 | -9.690399 | 8.851635 | 175.2168 | 2.899168 | 48.28789 | 2.14631 | 28.24212 | 2.008974 | 47.07142 | 1.90306 | 63.13743 | 4.760993 | 61.10303 | 4.655201 | 5.915043 | 1.105944 | -28.06753 | 0.616602 | -30.23859 | 0.616602 | 0.14 | 0.76 | 0.02 | 0.08 | 0.1 | 0.9 | Sc?t | 0.4 | 0.07 | 0.0 | 6.15 | 1.0 | 0.0 | 0.0 | 5.07 |
\n",
+ "3670 | 654 | 131.11559 | 51.447163 | 0.044909 | 0.636889 | 1.16 | 23.968254 | 68.06106 | 167.25 | -19.737 | 23.112167 | 0.738 | 0.055859 | 10.26946 | -- | -- | -0.094841 | 1237651250948866261 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 503357004442527744 | 1237651250948866261 | 8.91535 | 10.26946 | -0.094841 | -10.40809 | 24.99552 | 147.9379 | 3.553866 | 35.20347 | 2.533432 | 17.58016 | 2.649211 | 68.68002 | 3.153805 | 41.60938 | 5.233574 | 31.24595 | 5.051237 | 26.29336 | 1.186777 | -3.568692 | 0.178928 | -5.468268 | 0.178928 | 0.67 | 0.23 | 0.01 | 0.08 | 0.09 | 0.9 | Ser | 0.0 | 0.75 | 0.0 | 2.93 | 0.0 | 0.0 | 1.0 | 1.16 |
\n",
+ "7906 | 654 | 140.62584 | 52.740112 | 0.042289 | 0.754228 | 4.38 | 27.626522 | 42.418346 | 41.4 | -19.44 | 24.265188 | 0.497 | 0.033257 | 9.784942 | -- | -- | 0.088669 | 1237653612111003882 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 623766998765037568 | 1237653612111003882 | -9999.0 | 9.784942 | 0.088669 | -9.758005 | 15.40933 | 73.66251 | 2.345748 | 24.13827 | 2.511712 | 10.12315 | 2.307822 | 28.64282 | 2.286174 | 26.97317 | 5.8039 | 24.46866 | 5.838085 | 13.05387 | 0.588017 | -3.402354 | 0.256267 | -5.688882 | 0.256267 | 0.27 | 0.66 | 0.01 | 0.06 | 0.07 | 0.93 | Sc(i) | 0.07 | 0.0 | 0.07 | 4.33 | 0.0 | 0.0 | 1.0 | 4.38 |
\n",
+ "7926 | 654 | 136.4517 | 51.103626 | 0.045503 | 0.398741 | 3.25 | 30.56949 | 68.53098 | 153.88 | -20.453 | 22.870562 | 0.828 | 0.044418 | 10.72322 | -- | -- | 0.30679 | 1237653612646564142 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 621530866857830400 | 1237653612646564142 | -9999.0 | 10.72322 | 0.30679 | -10.4681 | 38.10157 | 406.4828 | 4.14774 | 81.08394 | 2.262734 | 45.28421 | 2.266736 | 185.994 | 3.004811 | 52.76922 | 4.520315 | 56.93532 | 4.384454 | 33.78474 | 0.925195 | -10.15549 | 0.139637 | -12.26131 | 0.139637 | 0.66 | 0.3 | 0.01 | 0.03 | 0.04 | 0.96 | SBb | 0.1 | 0.57 | 0.05 | 3.33 | 1.0 | 0.0 | 0.0 | 3.25 |
\n",
+ "8556 | 654 | 134.75067 | 49.17309 | 0.040627 | 0.694755 | -0.51 | 33.7983 | 38.18258 | 121.26 | -19.637 | 24.296238 | 0.91 | 0.051503 | 10.3405 | -- | -- | -0.780256 | 1237654380902613219 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 861408024550467584 | 1237654380902613219 | -9999.0 | 10.3405 | -0.780256 | -11.15621 | 22.18637 | 26.64392 | 2.925196 | 2.63583 | 2.46217 | 13.77234 | 3.449105 | 15.71924 | 3.214167 | 22.78518 | 5.401163 | 12.29691 | 5.18655 | 29.94741 | 1.120939 | 0.849928 | 0.174906 | -0.897932 | 0.174906 | 0.04 | 0.02 | 0.8 | 0.13 | 0.94 | 0.06 | Sb | 0.0 | 0.75 | 0.0 | 2.93 | 0.0 | 0.0 | 1.0 | -0.51 |
\n",
+ "8595 | 654 | 135.23158 | 50.235413 | 0.041231 | 0.618108 | 2.5 | 23.171535 | 49.630222 | 31.48 | -19.89 | 23.291155 | 0.604 | 0.052046 | 10.11973 | -- | -- | 0.157388 | 1237654381439877336 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 620383526491023360 | 1237654381439877336 | -9999.0 | 10.11973 | 0.157388 | -10.01697 | 29.06968 | 344.8817 | 4.998841 | 84.78842 | 3.293067 | 47.59914 | 3.396052 | 170.7391 | 3.928551 | 78.52741 | 9.157406 | 131.3441 | 10.10559 | 32.73447 | 2.487818 | -8.487193 | 0.167418 | -10.48329 | 0.167418 | 0.58 | 0.24 | 0.02 | 0.17 | 0.19 | 0.82 | Sc?m | 0.06 | 0.24 | 0.24 | 2.37 | 1.0 | 0.0 | 0.0 | 2.5 |
\n",
+ "8646 | 654 | 136.35133 | 51.460213 | 0.040646 | 0.767809 | 1.42 | 24.66393 | 53.55121 | 178.31 | -20.047 | 23.111301 | 0.667 | 0.0427 | 10.3204 | -- | -- | 0.26967 | 1237654381977337926 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 621533615636899840 | 1237654381977337926 | 9.110266 | 10.3204 | 0.26967 | -10.09584 | 38.29351 | 634.8694 | 5.241685 | 146.5921 | 2.930708 | 32.77389 | 2.588801 | 236.3104 | 3.2656 | 50.5781 | 5.698673 | 61.79903 | 6.007641 | 34.68615 | 0.634051 | -16.09662 | 0.163445 | -18.27572 | 0.163445 | 0.6 | 0.27 | 0.01 | 0.12 | 0.13 | 0.87 | Sc?m | 0.0 | 0.2 | 0.0 | 4.18 | 0.0 | 0.0 | 1.0 | 1.42 |
\n",
+ "10595 | 139 | 121.45962 | 37.460052 | 0.034214 | 0.62556 | -1.75 | 28.360695 | 24.365297 | 71.03 | -20.085 | 23.408087 | 0.98 | 0.122681 | 10.67273 | -- | -- | -1.820528 | 1237654652561653831 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 853474773261379584 | 1237654652561653831 | -9999.0 | 10.67273 | -1.820528 | -12.56712 | 40.00527 | 44.0839 | 11.8371 | 38.57415 | 9.777253 | 25.35348 | 7.129503 | 22.57474 | 8.44396 | -19.54924 | 14.58545 | 15.18234 | 14.30314 | 74.91106 | 1.206195 | 1.026559 | 0.1039 | -0.481944 | 0.1039 | 0.05 | 0.03 | 0.77 | 0.15 | 0.92 | 0.08 | Er | 0.0 | 0.8 | 0.2 | 1.14 | 0.0 | 1.0 | 0.0 | -1.75 |
\n",
+ "... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
\n",
+ "62480 | 482 | 190.40115 | 23.425161 | 0.028727 | 0.416105 | 4.16 | 47.62704 | 34.707954 | 133.29 | -20.566 | 23.434908 | 0.775 | 0.051575 | 10.64411 | 1.53 | 119.11 | -0.490619 | 1237667783910686726 | 220929.0 | 1.53 | 0.08 | 9.77 | 0.05 | 10.623435 | 0.03922 | 10.76615 | 0.015649 | 10.816 | 0.016 | 0.050976 | 0.026715 | 0.233333 | 0.023948 | 0.061 | 0.045 | 2981483359001143296 | 1237667783910686726 | -9999.0 | 10.64411 | -0.490619 | -11.20174 | 44.015 | 291.3399 | 8.608905 | 88.46881 | 5.506065 | 599.7098 | 9.522441 | 560.8103 | 9.736795 | 167.2276 | 8.503058 | 215.0311 | 8.427526 | 81.37656 | 7.906726 | -2.193873 | 0.118677 | -3.999475 | 0.118677 | 0.25 | 0.4 | 0.11 | 0.25 | 0.35 | 0.65 | Sb3t | 0.02 | 0.56 | 0.0 | 3.46 | 1.0 | 0.0 | 0.0 | 4.16 |
\n",
+ "63083 | 482 | 190.50949 | 18.98778 | 0.027007 | 0.245535 | 4.4 | 34.2882 | 51.72811 | 37.35 | -18.883 | 24.091295 | 0.508 | 0.048717 | 9.563904 | 0.65 | 82.15 | -0.265909 | 1237667914348888201 | 742557.0 | 0.65 | 0.07 | 9.35 | 0.07 | 9.595614 | 0.072312 | 9.901246 | 0.016018 | 9.729 | 0.031 | -0.76389 | 0.109864 | -0.354363 | 0.035239 | -0.402 | 0.058 | 2941981479560833024 | 1237667914348888201 | 9.004096 | 9.563904 | -0.265909 | -9.894175 | 18.39063 | 128.1393 | 2.254565 | 40.39094 | 1.897565 | 11.02239 | 1.717388 | 46.38817 | 1.661778 | 26.27469 | 5.05907 | 32.09042 | 5.063984 | 11.60258 | 0.465341 | -8.698895 | 0.243697 | -11.29204 | 0.243697 | 0.35 | 0.62 | 0.01 | 0.03 | 0.03 | 0.97 | Sc?t | 0.03 | 0.09 | 0.0 | 4.55 | 1.0 | 0.0 | 0.0 | 4.4 |
\n",
+ "65288 | 622 | 235.6254 | 15.790563 | 0.042083 | 0.730964 | 2.95 | 26.64453 | 63.44614 | 53.12 | -19.454 | 23.585749 | 0.627 | 0.079757 | 10.06541 | -- | -- | 0.05 | 1237667783929561241 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 2835102073400354816 | 1237667783929561241 | 9.014234 | 10.06541 | 0.05 | -10.07751 | 13.64873 | 243.0598 | 3.567536 | 54.96368 | 2.285946 | 11.36443 | 2.073316 | 89.51247 | 2.430249 | 19.11991 | 4.84659 | 37.13896 | 5.298258 | 10.45117 | 0.531287 | -21.19096 | 0.405792 | -23.45661 | 0.405792 | 0.58 | 0.19 | 0.05 | 0.19 | 0.23 | 0.77 | SBc | 0.21 | 0.0 | 0.0 | 5.51 | 1.0 | 0.0 | 0.0 | 2.95 |
\n",
+ "65303 | 622 | 234.51367 | 16.401506 | 0.042464 | 0.777043 | -2.2 | 32.99358 | 42.987675 | 38.63 | -20.089 | 23.792648 | 0.934 | 0.098445 | 10.63776 | -- | -- | -1.165286 | 1237668336321036598 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 3132408923894605824 | 1237668336321036598 | -9999.0 | 10.63776 | -1.165286 | -11.84095 | 28.77011 | 46.53311 | 4.774382 | 20.65129 | 3.907099 | 23.86948 | 3.97428 | 53.08123 | 4.984046 | 19.90494 | 6.304945 | 33.49825 | 6.334911 | 39.95285 | 1.79973 | 0.469134 | 0.138883 | -1.220298 | 0.138883 | 0.07 | 0.04 | 0.77 | 0.12 | 0.89 | 0.11 | Ei | 0.0 | 0.0 | 0.5 | 0.44 | 0.0 | 0.0 | 1.0 | -2.2 |
\n",
+ "65716 | 622 | 235.81642 | 11.808072 | 0.037216 | 0.678523 | 5.15 | 30.06654 | 75.72208 | 128.41 | -19.525 | 22.934147 | 0.592 | 0.106596 | 10.10708 | -- | -- | 0.134432 | 1237668350292394458 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 2832897827431016448 | 1237668350292394458 | 8.955486 | 10.10708 | 0.134432 | -10.02346 | 21.93751 | 555.0091 | 4.496197 | 115.6619 | 2.351028 | 38.99422 | 1.983845 | 179.9932 | 2.621095 | 84.7338 | 5.346751 | 109.0197 | 5.485673 | 16.1138 | 0.882569 | -31.94006 | 0.304468 | -34.57116 | 0.304468 | 0.39 | 0.53 | 0.02 | 0.06 | 0.07 | 0.92 | Ec | 0.25 | 0.0 | 0.0 | 5.67 | 1.0 | 0.0 | 0.0 | 5.15 |
\n",
+ "65887 | 622 | 237.4744 | 15.415592 | 0.038231 | 0.67817 | 2.17 | 28.689972 | 68.18503 | 131.98 | -19.494 | 23.328276 | 0.7 | 0.089449 | 10.1579 | -- | -- | -0.073941 | 1237668367997206823 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 2835044349039896576 | 1237668367997206823 | -9999.0 | 10.1579 | -0.073941 | -10.2722 | 16.91634 | 175.1393 | 3.250913 | 37.13228 | 2.219924 | 8.288683 | 2.110012 | 67.28678 | 2.641611 | 22.22827 | 5.503527 | 18.22864 | 5.165263 | 15.4274 | 0.522751 | -9.188746 | 0.257701 | -11.13402 | 0.257701 | 0.35 | 0.61 | 0.01 | 0.03 | 0.04 | 0.96 | Sc | 0.12 | 0.12 | 0.0 | 4.87 | 1.0 | 0.0 | 0.0 | 2.17 |
\n",
+ "66239 | 487 | 170.40993 | 16.03152 | 0.031609 | 0.604816 | 3.68 | 45.4326 | 46.939857 | 168.8 | -20.396 | 23.634453 | 0.611 | 0.056639 | 10.25439 | 1.89 | 130.4 | -0.035576 | 1237668584359723105 | 212184.0 | 1.89 | 0.09 | 9.95 | 0.05 | 10.314624 | 0.059758 | 10.638981 | 0.013571 | 10.446 | 0.036 | 0.126244 | 0.027944 | 0.246485 | 0.031825 | 0.3 | 0.07 | 2808021925484324864 | 1237668584359723105 | -9999.0 | 10.25439 | -0.035576 | -10.33304 | 19.68472 | 328.9491 | 5.427939 | 80.62089 | 3.658881 | 11.68233 | 3.222977 | 114.7002 | 3.95683 | 11.4279 | 8.567916 | 38.61607 | 8.635287 | 26.33066 | 0.983906 | -10.33678 | 0.24048 | -12.44173 | 0.24048 | 0.16 | 0.82 | 0.0 | 0.01 | 0.01 | 0.98 | Sc?t | 0.08 | 0.1 | 0.04 | 4.4 | 1.0 | 0.0 | 0.0 | 3.68 |
\n",
+ "66400 | 487 | 174.5076 | 18.34128 | 0.029515 | 0.412765 | 3.51 | 29.428257 | 53.64475 | 126.39 | -19.421 | 23.46071 | 0.484 | 0.058902 | 9.846592 | -- | -- | 0.021264 | 1237668587045847259 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 2821584401496827904 | 1237668587045847259 | 8.961183 | 9.846592 | 0.021264 | -9.86949 | 23.97344 | 394.03 | 4.561218 | 105.7605 | 2.900097 | 41.66074 | 2.668586 | 150.3142 | 2.875388 | 89.17506 | 8.227464 | 102.932 | 8.659683 | 20.47608 | 0.677176 | -16.81231 | 0.251788 | -19.34202 | 0.251788 | 0.32 | 0.53 | 0.03 | 0.12 | 0.15 | 0.85 | SBc(r) | 0.2 | 0.14 | 0.03 | 4.9 | 1.0 | 0.0 | 0.0 | 3.51 |
\n",
+ "66803 | 482 | 188.27193 | 17.403131 | 0.026819 | 0.417084 | 5.07 | 51.89739 | 39.59816 | 26.7 | -20.114 | 23.964361 | 0.665 | 0.059035 | 10.14623 | 2.51 | 126.14 | -0.146308 | 1237668624087580715 | 220765.0 | 2.51 | 0.1 | 9.92 | 0.05 | 10.235491 | 0.046102 | 10.538002 | 0.016086 | 10.428 | 0.025 | 0.0084 | 0.028413 | 0.230834 | 0.028943 | 0.081 | 0.07 | 2925118815303919616 | 1237668624087580715 | -9999.0 | 10.14623 | -0.146308 | -10.33045 | 19.39374 | 237.3707 | 4.250463 | 62.07621 | 3.087481 | 11.07143 | 2.733043 | 85.37064 | 3.11945 | -5.201427 | 13.70762 | 16.47461 | 8.220942 | 21.13801 | 0.56184 | -9.18102 | 0.238556 | -11.15812 | 0.238556 | 0.35 | 0.63 | 0.0 | 0.01 | 0.02 | 0.98 | Sb4m | 0.03 | 0.46 | 0.0 | 3.69 | 1.0 | 0.0 | 0.0 | 5.07 |
\n",
+ "67290 | 405 | 155.29887 | 17.610922 | 0.03289 | 0.786289 | -2.08 | 28.171766 | 52.155533 | 124.25 | -18.762 | 24.155478 | 0.782 | 0.075992 | 9.917935 | -- | -- | -1.531668 | 1237670965392048338 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 2915097040721569792 | 1237670965392048338 | -9999.0 | 9.917935 | -1.531668 | -11.48032 | 25.1994 | 643.8994 | 6.79659 | 131.9119 | 3.641351 | 1267.984 | 10.56825 | 437.346 | 5.245484 | 229.7415 | 9.736882 | 141.1686 | 9.426397 | 24.15042 | 6.663629 | -26.14074 | 0.287101 | -28.09456 | 0.287101 | 0.19 | 0.08 | 0.08 | 0.66 | 0.73 | 0.27 | Sb?m | 0.0 | 0.5 | 0.0 | 3.5 | 0.0 | 0.0 | 1.0 | -2.08 |
\n",
+ "
"
+ ],
+ "text/plain": [
+ "\n",
+ "galaxy void ra dec redshift ... GZ1S GZ1Ell GZ1U TType_DS\n",
+ " dex(deg) dex(deg) ... \n",
+ "int32 int32 float32 float32 float32 ... float32 float32 float32 float32 \n",
+ "------ ----- --------- --------- -------- ... ------- ------- ------- --------\n",
+ " 3430 654 132.4546 51.09398 0.044739 ... 0.0 1.0 0.0 -2.44\n",
+ " 3666 654 129.82005 50.685875 0.044856 ... 1.0 0.0 0.0 5.07\n",
+ " 3670 654 131.11559 51.447163 0.044909 ... 0.0 0.0 1.0 1.16\n",
+ " 7906 654 140.62584 52.740112 0.042289 ... 0.0 0.0 1.0 4.38\n",
+ " 7926 654 136.4517 51.103626 0.045503 ... 1.0 0.0 0.0 3.25\n",
+ " 8556 654 134.75067 49.17309 0.040627 ... 0.0 0.0 1.0 -0.51\n",
+ " 8595 654 135.23158 50.235413 0.041231 ... 1.0 0.0 0.0 2.5\n",
+ " 8646 654 136.35133 51.460213 0.040646 ... 0.0 0.0 1.0 1.42\n",
+ " 10595 139 121.45962 37.460052 0.034214 ... 0.0 1.0 0.0 -1.75\n",
+ " ... ... ... ... ... ... ... ... ... ...\n",
+ " 62480 482 190.40115 23.425161 0.028727 ... 1.0 0.0 0.0 4.16\n",
+ " 63083 482 190.50949 18.98778 0.027007 ... 1.0 0.0 0.0 4.4\n",
+ " 65288 622 235.6254 15.790563 0.042083 ... 1.0 0.0 0.0 2.95\n",
+ " 65303 622 234.51367 16.401506 0.042464 ... 0.0 0.0 1.0 -2.2\n",
+ " 65716 622 235.81642 11.808072 0.037216 ... 1.0 0.0 0.0 5.15\n",
+ " 65887 622 237.4744 15.415592 0.038231 ... 1.0 0.0 0.0 2.17\n",
+ " 66239 487 170.40993 16.03152 0.031609 ... 1.0 0.0 0.0 3.68\n",
+ " 66400 487 174.5076 18.34128 0.029515 ... 1.0 0.0 0.0 3.51\n",
+ " 66803 482 188.27193 17.403131 0.026819 ... 1.0 0.0 0.0 5.07\n",
+ " 67290 405 155.29887 17.610922 0.03289 ... 0.0 0.0 1.0 -2.08"
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "tap_result.to_table()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "caaffa2e",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "markdown",
+ "id": "5fd670ed",
+ "metadata": {},
+ "source": [
+ "# Get PPAK files"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "id": "45d415ec",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "table_name = 'PPAK_cubes_filtered'\n",
+ "\n",
+ "query = \"\"\"-- PPAK cubes subselection\n",
+ "\n",
+ "SELECT galaxy, file FROM dr1.PPAK_cubes\n",
+ "WHERE galaxy IN (\n",
+ " SELECT galaxy FROM dr1.Master\n",
+ " WHERE morphology > 0 \n",
+ " AND redshift <= 0.030 \n",
+ " AND void = 482\n",
+ ")\n",
+ "\"\"\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "id": "5aa7f50b",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# syncronous (only for very small queries)\n",
+ "tap_result = tap_service.run_sync(query, runid=query_group, table_name=table_name, language=lang)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "id": "8770df66",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "Table length=3\n",
+ "
\n",
+ "galaxy | file |
\n",
+ "int32 | str300 |
\n",
+ "62480 | https://cavity.caha.es/files/PPAK/DR1/reduced/CAVITY62480_PPAK_V500_v12.fits.gz |
\n",
+ "63083 | https://cavity.caha.es/files/PPAK/DR1/reduced/CAVITY63083_PPAK_V500_v12.fits.gz |
\n",
+ "66803 | https://cavity.caha.es/files/PPAK/DR1/reduced/CAVITY66803_PPAK_V500_v12.fits.gz |
\n",
+ "
"
+ ],
+ "text/plain": [
+ "\n",
+ "galaxy ...\n",
+ "int32 ...\n",
+ "------ ...\n",
+ " 62480 ...\n",
+ " 63083 ...\n",
+ " 66803 ..."
+ ]
+ },
+ "execution_count": 10,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "tap_result.to_table()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d642ca7f",
+ "metadata": {},
+ "source": [
+ "# Download files"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "id": "6939bae6",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "from pathlib import Path\n",
+ "\n",
+ "def download_file(url:str, token:str, folder: str = None) -> str:\n",
+ " filepath = url.split('/')[-1]\n",
+ " if folder is not None:\n",
+ " if Path(folder).exists:\n",
+ " filepath = Path(folder).joinpath(filepath)\n",
+ "\n",
+ " with requests.get(url, stream=True, headers={\"Authorization\": f'Token {token}'} ) as r:\n",
+ " r.raise_for_status()\n",
+ " with open(filepath, 'wb') as f:\n",
+ " for chunk in r.iter_content(chunk_size=8192):\n",
+ " f.write(chunk)\n",
+ " return filepath"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "id": "c9c9d631",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "[PosixPath('CAVITY62480_PPAK_V500_v12.fits.gz')]"
+ ]
+ },
+ "execution_count": 12,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "files = []\n",
+ "# download the first file\n",
+ "for row in tap_result.to_table()[:1]:\n",
+ " files.append(download_file(row['file'], tap_session, ''))\n",
+ "files"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "id": "3d287c63",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "['tutorial_DR1.ipynb', 'CAVITY62480_PPAK_V500_v12.fits.gz']"
+ ]
+ },
+ "execution_count": 13,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "glob.glob('*')"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "da5b2122",
+ "metadata": {},
+ "source": [
+ "# Archive jobs"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "id": "c2a02754",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "WARNING: UnknownElementWarning: None:2:0: UnknownElementWarning: Unknown element jobs [pyvo.utils.xml.elements]\n"
+ ]
+ }
+ ],
+ "source": [
+ "#\n",
+ "# Archiving COMPLETED jobs with a target_runid\n",
+ "#\n",
+ "\n",
+ "target_runid = 'DR1_Demo'\n",
+ "\n",
+ "# obtain the list of completed job_descriptions\n",
+ "completed_job_descriptions = tap_service.get_job_list(phases='COMPLETED')\n",
+ "\n",
+ "# Archiving each of them\n",
+ "for job_description in completed_job_descriptions:\n",
+ " if job_description.runid == target_runid:\n",
+ " print(job_description.jobid)\n",
+ " # # get the jobid\n",
+ " jobid = job_description.jobid\n",
+ "\n",
+ " # # recreate the url by hand\n",
+ " job_url = tap_service.baseurl + '/async/' + jobid\n",
+ "\n",
+ " # # recreate the job\n",
+ " job = pyvo.dal.AsyncTAPJob(job_url, session=tap_session)\n",
+ "\n",
+ " print(f'Archiving: {job_url}')\n",
+ " job.delete() # archive job"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "72d3c608",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3.9.2 ('QCONTROL')",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.9.2"
+ },
+ "toc-autonumbering": true,
+ "vscode": {
+ "interpreter": {
+ "hash": "ef8d2a8c771d36027734b5d9b80bf9780f088fbc8610cf9b587dbbffa1bbfe55"
+ }
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/notebooks/tutorial_DR1_xmatch.ipynb b/notebooks/tutorial_DR1_xmatch.ipynb
new file mode 100644
index 0000000000000000000000000000000000000000..4c50d9c75363163c3e7ed3ce025f2c6bf8d4e285
--- /dev/null
+++ b/notebooks/tutorial_DR1_xmatch.ipynb
@@ -0,0 +1,437 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "4580630b-87de-4270-809f-d386ab81266c",
+ "metadata": {},
+ "source": [
+ "# TAP service tutorial and data download"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "23bd1ad1",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import glob\n",
+ "\n",
+ "import requests\n",
+ "import pyvo\n",
+ "\n",
+ "import astropy.units as u\n",
+ "from astropy.coordinates import SkyCoord\n",
+ "from astropy.table import Table, join, hstack"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "89694ef4",
+ "metadata": {},
+ "source": [
+ "# Connect to the CAVITY TAP service"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "bc54a8ca",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "url = \"https://cavity.caha.es/tap\"\n",
+ "token = 'cf16899d345b765aba64b63ec0a92700a00beb36'"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "405d81a5",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "CONNECTED: https://cavity.caha.es/tap\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Setup authorization\n",
+ "tap_session = requests.Session()\n",
+ "tap_session.headers['Authorization'] = f'Token {token}'\n",
+ "\n",
+ "# Init service\n",
+ "tap_service = pyvo.dal.TAPService(url, session=tap_session)\n",
+ "\n",
+ "if tap_service.availability:\n",
+ " print(f\"CONNECTED: {url}\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9e17162b",
+ "metadata": {},
+ "source": [
+ "# Get catalogues"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "6e6808b4",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "lang = \"ADQL\"\n",
+ "\n",
+ "query_group = 'DR1_Demo'"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "id": "c8161bdb",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Master catalogue + ALFALFA MPA and Mophology data for al DR1 galaxies\n",
+ "table_name='dr1_catalogues'\n",
+ "\n",
+ "query = \"\"\"-- PPAK cubes subselection\n",
+ "\n",
+ "SELECT * from dr1.Master\n",
+ "JOIN dr1.ALFALFA_SDSS USING (galaxy)\n",
+ "JOIN dr1.MPA USING (galaxy)\n",
+ "JOIN dr1.Morpho USING (galaxy)\n",
+ "\"\"\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "id": "ca900c5e",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# syncronous (only for very small queries)\n",
+ "tap_result = tap_service.run_sync(query, runid=query_group, table_name=table_name, language=lang)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "id": "91c92ae6",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "Table length=100\n",
+ "
\n",
+ "galaxy | void | ra | dec | redshift | effr_frac | morphology | d25 | incl | pa | rabsmag | sb | g-r | Av | M_star | fluxHI | vmaxg | log(SFR) | SDSS_ID | AGC | HIflux | sigflux | logMHI | logMHI_err | logMstarTaylor | logMstarTaylor_err | logMstarMcGaugh | logMstarMcGaugh_err | logMstarGSWLC | logMstarGSWLC_err | logSFR22 | logSFR22_err | logSFRNUVIR | logSFRNUVIR_err | logSFRGSWLC | logSFRGSWLC_err | specObjID | bestobjID | oh_p50 | lgm_tot_p50 | sfr_tot_p50 | specsfr_tot_p50 | sn_median | h_alpha_flux | h_alpha_flux_err | h_beta_flux | h_beta_flux_err | oiii_5007_flux | oiii_5007_flux_err | nii_6584_flux | nii_6584_flux_err | oii_3726_flux | oii_3726_flux_err | oii_3729_flux | oii_3729_flux_err | h_alpha_cont | h_alpha_cont_err | h_alpha_reqw | h_alpha_reqw_err | h_alpha_eqw | h_alpha_eqw_err | probaSab | probaScd | probaEll | probaS0 | probaEarly | probaLate | GZ2class | pnobulge | pobvious | pdominant | GZ2formula | GZ1S | GZ1Ell | GZ1U | TType_DS |
\n",
+ " | | dex(deg) | dex(deg) | | | | dex(arcsec) | dex(deg) | dex(deg) | [mag] | [mag·arcsec⁻²] | [mag] | [mag] | [log(M☉)] | [Jy·km·s⁻¹] | [km·s⁻¹] | [log(M☉·yr⁻¹)] | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
\n",
+ "int32 | int32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | str19 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | str19 | str19 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | str8 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 |
\n",
+ "3430 | 654 | 132.4546 | 51.09398 | 0.044739 | 0.512825 | -2.44 | 26.394318 | 56.07484 | 87.16 | -20.065 | 23.207045 | 0.908 | 0.055701 | 10.53708 | -- | -- | -1.255461 | 1237651249875255579 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 503292408134395904 | 1237651249875255579 | -9999.0 | 10.53708 | -1.255461 | -11.84293 | 30.08854 | 8.133125 | 5.961778 | 9.890788 | 6.003214 | 3.409627 | 2.90654 | 5.359654 | 2.883173 | 1.665248 | 4.840681 | -12.26812 | 4.569426 | 45.0214 | 0.756332 | 1.66552 | 0.132222 | -0.174099 | 0.132222 | 0.06 | 0.03 | 0.08 | 0.82 | 0.9 | 0.09 | Ei | 0.0 | 1.0 | 0.0 | 2.36 | 0.0 | 1.0 | 0.0 | -2.44 |
\n",
+ "3666 | 654 | 129.82005 | 50.685875 | 0.044856 | 0.680431 | 5.07 | 22.560259 | 58.641518 | 67.07 | -18.714 | 24.288118 | 0.461 | 0.069253 | 9.476982 | -- | -- | -0.157294 | 1237651250948407434 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 501167326968702976 | 1237651250948407434 | 8.810315 | 9.476982 | -0.157294 | -9.690399 | 8.851635 | 175.2168 | 2.899168 | 48.28789 | 2.14631 | 28.24212 | 2.008974 | 47.07142 | 1.90306 | 63.13743 | 4.760993 | 61.10303 | 4.655201 | 5.915043 | 1.105944 | -28.06753 | 0.616602 | -30.23859 | 0.616602 | 0.14 | 0.76 | 0.02 | 0.08 | 0.1 | 0.9 | Sc?t | 0.4 | 0.07 | 0.0 | 6.15 | 1.0 | 0.0 | 0.0 | 5.07 |
\n",
+ "3670 | 654 | 131.11559 | 51.447163 | 0.044909 | 0.636889 | 1.16 | 23.968254 | 68.06106 | 167.25 | -19.737 | 23.112167 | 0.738 | 0.055859 | 10.26946 | -- | -- | -0.094841 | 1237651250948866261 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 503357004442527744 | 1237651250948866261 | 8.91535 | 10.26946 | -0.094841 | -10.40809 | 24.99552 | 147.9379 | 3.553866 | 35.20347 | 2.533432 | 17.58016 | 2.649211 | 68.68002 | 3.153805 | 41.60938 | 5.233574 | 31.24595 | 5.051237 | 26.29336 | 1.186777 | -3.568692 | 0.178928 | -5.468268 | 0.178928 | 0.67 | 0.23 | 0.01 | 0.08 | 0.09 | 0.9 | Ser | 0.0 | 0.75 | 0.0 | 2.93 | 0.0 | 0.0 | 1.0 | 1.16 |
\n",
+ "7906 | 654 | 140.62584 | 52.740112 | 0.042289 | 0.754228 | 4.38 | 27.626522 | 42.418346 | 41.4 | -19.44 | 24.265188 | 0.497 | 0.033257 | 9.784942 | -- | -- | 0.088669 | 1237653612111003882 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 623766998765037568 | 1237653612111003882 | -9999.0 | 9.784942 | 0.088669 | -9.758005 | 15.40933 | 73.66251 | 2.345748 | 24.13827 | 2.511712 | 10.12315 | 2.307822 | 28.64282 | 2.286174 | 26.97317 | 5.8039 | 24.46866 | 5.838085 | 13.05387 | 0.588017 | -3.402354 | 0.256267 | -5.688882 | 0.256267 | 0.27 | 0.66 | 0.01 | 0.06 | 0.07 | 0.93 | Sc(i) | 0.07 | 0.0 | 0.07 | 4.33 | 0.0 | 0.0 | 1.0 | 4.38 |
\n",
+ "7926 | 654 | 136.4517 | 51.103626 | 0.045503 | 0.398741 | 3.25 | 30.56949 | 68.53098 | 153.88 | -20.453 | 22.870562 | 0.828 | 0.044418 | 10.72322 | -- | -- | 0.30679 | 1237653612646564142 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 621530866857830400 | 1237653612646564142 | -9999.0 | 10.72322 | 0.30679 | -10.4681 | 38.10157 | 406.4828 | 4.14774 | 81.08394 | 2.262734 | 45.28421 | 2.266736 | 185.994 | 3.004811 | 52.76922 | 4.520315 | 56.93532 | 4.384454 | 33.78474 | 0.925195 | -10.15549 | 0.139637 | -12.26131 | 0.139637 | 0.66 | 0.3 | 0.01 | 0.03 | 0.04 | 0.96 | SBb | 0.1 | 0.57 | 0.05 | 3.33 | 1.0 | 0.0 | 0.0 | 3.25 |
\n",
+ "8556 | 654 | 134.75067 | 49.17309 | 0.040627 | 0.694755 | -0.51 | 33.7983 | 38.18258 | 121.26 | -19.637 | 24.296238 | 0.91 | 0.051503 | 10.3405 | -- | -- | -0.780256 | 1237654380902613219 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 861408024550467584 | 1237654380902613219 | -9999.0 | 10.3405 | -0.780256 | -11.15621 | 22.18637 | 26.64392 | 2.925196 | 2.63583 | 2.46217 | 13.77234 | 3.449105 | 15.71924 | 3.214167 | 22.78518 | 5.401163 | 12.29691 | 5.18655 | 29.94741 | 1.120939 | 0.849928 | 0.174906 | -0.897932 | 0.174906 | 0.04 | 0.02 | 0.8 | 0.13 | 0.94 | 0.06 | Sb | 0.0 | 0.75 | 0.0 | 2.93 | 0.0 | 0.0 | 1.0 | -0.51 |
\n",
+ "8595 | 654 | 135.23158 | 50.235413 | 0.041231 | 0.618108 | 2.5 | 23.171535 | 49.630222 | 31.48 | -19.89 | 23.291155 | 0.604 | 0.052046 | 10.11973 | -- | -- | 0.157388 | 1237654381439877336 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 620383526491023360 | 1237654381439877336 | -9999.0 | 10.11973 | 0.157388 | -10.01697 | 29.06968 | 344.8817 | 4.998841 | 84.78842 | 3.293067 | 47.59914 | 3.396052 | 170.7391 | 3.928551 | 78.52741 | 9.157406 | 131.3441 | 10.10559 | 32.73447 | 2.487818 | -8.487193 | 0.167418 | -10.48329 | 0.167418 | 0.58 | 0.24 | 0.02 | 0.17 | 0.19 | 0.82 | Sc?m | 0.06 | 0.24 | 0.24 | 2.37 | 1.0 | 0.0 | 0.0 | 2.5 |
\n",
+ "8646 | 654 | 136.35133 | 51.460213 | 0.040646 | 0.767809 | 1.42 | 24.66393 | 53.55121 | 178.31 | -20.047 | 23.111301 | 0.667 | 0.0427 | 10.3204 | -- | -- | 0.26967 | 1237654381977337926 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 621533615636899840 | 1237654381977337926 | 9.110266 | 10.3204 | 0.26967 | -10.09584 | 38.29351 | 634.8694 | 5.241685 | 146.5921 | 2.930708 | 32.77389 | 2.588801 | 236.3104 | 3.2656 | 50.5781 | 5.698673 | 61.79903 | 6.007641 | 34.68615 | 0.634051 | -16.09662 | 0.163445 | -18.27572 | 0.163445 | 0.6 | 0.27 | 0.01 | 0.12 | 0.13 | 0.87 | Sc?m | 0.0 | 0.2 | 0.0 | 4.18 | 0.0 | 0.0 | 1.0 | 1.42 |
\n",
+ "10595 | 139 | 121.45962 | 37.460052 | 0.034214 | 0.62556 | -1.75 | 28.360695 | 24.365297 | 71.03 | -20.085 | 23.408087 | 0.98 | 0.122681 | 10.67273 | -- | -- | -1.820528 | 1237654652561653831 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 853474773261379584 | 1237654652561653831 | -9999.0 | 10.67273 | -1.820528 | -12.56712 | 40.00527 | 44.0839 | 11.8371 | 38.57415 | 9.777253 | 25.35348 | 7.129503 | 22.57474 | 8.44396 | -19.54924 | 14.58545 | 15.18234 | 14.30314 | 74.91106 | 1.206195 | 1.026559 | 0.1039 | -0.481944 | 0.1039 | 0.05 | 0.03 | 0.77 | 0.15 | 0.92 | 0.08 | Er | 0.0 | 0.8 | 0.2 | 1.14 | 0.0 | 1.0 | 0.0 | -1.75 |
\n",
+ "... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
\n",
+ "62480 | 482 | 190.40115 | 23.425161 | 0.028727 | 0.416105 | 4.16 | 47.62704 | 34.707954 | 133.29 | -20.566 | 23.434908 | 0.775 | 0.051575 | 10.64411 | 1.53 | 119.11 | -0.490619 | 1237667783910686726 | 220929.0 | 1.53 | 0.08 | 9.77 | 0.05 | 10.623435 | 0.03922 | 10.76615 | 0.015649 | 10.816 | 0.016 | 0.050976 | 0.026715 | 0.233333 | 0.023948 | 0.061 | 0.045 | 2981483359001143296 | 1237667783910686726 | -9999.0 | 10.64411 | -0.490619 | -11.20174 | 44.015 | 291.3399 | 8.608905 | 88.46881 | 5.506065 | 599.7098 | 9.522441 | 560.8103 | 9.736795 | 167.2276 | 8.503058 | 215.0311 | 8.427526 | 81.37656 | 7.906726 | -2.193873 | 0.118677 | -3.999475 | 0.118677 | 0.25 | 0.4 | 0.11 | 0.25 | 0.35 | 0.65 | Sb3t | 0.02 | 0.56 | 0.0 | 3.46 | 1.0 | 0.0 | 0.0 | 4.16 |
\n",
+ "63083 | 482 | 190.50949 | 18.98778 | 0.027007 | 0.245535 | 4.4 | 34.2882 | 51.72811 | 37.35 | -18.883 | 24.091295 | 0.508 | 0.048717 | 9.563904 | 0.65 | 82.15 | -0.265909 | 1237667914348888201 | 742557.0 | 0.65 | 0.07 | 9.35 | 0.07 | 9.595614 | 0.072312 | 9.901246 | 0.016018 | 9.729 | 0.031 | -0.76389 | 0.109864 | -0.354363 | 0.035239 | -0.402 | 0.058 | 2941981479560833024 | 1237667914348888201 | 9.004096 | 9.563904 | -0.265909 | -9.894175 | 18.39063 | 128.1393 | 2.254565 | 40.39094 | 1.897565 | 11.02239 | 1.717388 | 46.38817 | 1.661778 | 26.27469 | 5.05907 | 32.09042 | 5.063984 | 11.60258 | 0.465341 | -8.698895 | 0.243697 | -11.29204 | 0.243697 | 0.35 | 0.62 | 0.01 | 0.03 | 0.03 | 0.97 | Sc?t | 0.03 | 0.09 | 0.0 | 4.55 | 1.0 | 0.0 | 0.0 | 4.4 |
\n",
+ "65288 | 622 | 235.6254 | 15.790563 | 0.042083 | 0.730964 | 2.95 | 26.64453 | 63.44614 | 53.12 | -19.454 | 23.585749 | 0.627 | 0.079757 | 10.06541 | -- | -- | 0.05 | 1237667783929561241 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 2835102073400354816 | 1237667783929561241 | 9.014234 | 10.06541 | 0.05 | -10.07751 | 13.64873 | 243.0598 | 3.567536 | 54.96368 | 2.285946 | 11.36443 | 2.073316 | 89.51247 | 2.430249 | 19.11991 | 4.84659 | 37.13896 | 5.298258 | 10.45117 | 0.531287 | -21.19096 | 0.405792 | -23.45661 | 0.405792 | 0.58 | 0.19 | 0.05 | 0.19 | 0.23 | 0.77 | SBc | 0.21 | 0.0 | 0.0 | 5.51 | 1.0 | 0.0 | 0.0 | 2.95 |
\n",
+ "65303 | 622 | 234.51367 | 16.401506 | 0.042464 | 0.777043 | -2.2 | 32.99358 | 42.987675 | 38.63 | -20.089 | 23.792648 | 0.934 | 0.098445 | 10.63776 | -- | -- | -1.165286 | 1237668336321036598 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 3132408923894605824 | 1237668336321036598 | -9999.0 | 10.63776 | -1.165286 | -11.84095 | 28.77011 | 46.53311 | 4.774382 | 20.65129 | 3.907099 | 23.86948 | 3.97428 | 53.08123 | 4.984046 | 19.90494 | 6.304945 | 33.49825 | 6.334911 | 39.95285 | 1.79973 | 0.469134 | 0.138883 | -1.220298 | 0.138883 | 0.07 | 0.04 | 0.77 | 0.12 | 0.89 | 0.11 | Ei | 0.0 | 0.0 | 0.5 | 0.44 | 0.0 | 0.0 | 1.0 | -2.2 |
\n",
+ "65716 | 622 | 235.81642 | 11.808072 | 0.037216 | 0.678523 | 5.15 | 30.06654 | 75.72208 | 128.41 | -19.525 | 22.934147 | 0.592 | 0.106596 | 10.10708 | -- | -- | 0.134432 | 1237668350292394458 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 2832897827431016448 | 1237668350292394458 | 8.955486 | 10.10708 | 0.134432 | -10.02346 | 21.93751 | 555.0091 | 4.496197 | 115.6619 | 2.351028 | 38.99422 | 1.983845 | 179.9932 | 2.621095 | 84.7338 | 5.346751 | 109.0197 | 5.485673 | 16.1138 | 0.882569 | -31.94006 | 0.304468 | -34.57116 | 0.304468 | 0.39 | 0.53 | 0.02 | 0.06 | 0.07 | 0.92 | Ec | 0.25 | 0.0 | 0.0 | 5.67 | 1.0 | 0.0 | 0.0 | 5.15 |
\n",
+ "65887 | 622 | 237.4744 | 15.415592 | 0.038231 | 0.67817 | 2.17 | 28.689972 | 68.18503 | 131.98 | -19.494 | 23.328276 | 0.7 | 0.089449 | 10.1579 | -- | -- | -0.073941 | 1237668367997206823 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 2835044349039896576 | 1237668367997206823 | -9999.0 | 10.1579 | -0.073941 | -10.2722 | 16.91634 | 175.1393 | 3.250913 | 37.13228 | 2.219924 | 8.288683 | 2.110012 | 67.28678 | 2.641611 | 22.22827 | 5.503527 | 18.22864 | 5.165263 | 15.4274 | 0.522751 | -9.188746 | 0.257701 | -11.13402 | 0.257701 | 0.35 | 0.61 | 0.01 | 0.03 | 0.04 | 0.96 | Sc | 0.12 | 0.12 | 0.0 | 4.87 | 1.0 | 0.0 | 0.0 | 2.17 |
\n",
+ "66239 | 487 | 170.40993 | 16.03152 | 0.031609 | 0.604816 | 3.68 | 45.4326 | 46.939857 | 168.8 | -20.396 | 23.634453 | 0.611 | 0.056639 | 10.25439 | 1.89 | 130.4 | -0.035576 | 1237668584359723105 | 212184.0 | 1.89 | 0.09 | 9.95 | 0.05 | 10.314624 | 0.059758 | 10.638981 | 0.013571 | 10.446 | 0.036 | 0.126244 | 0.027944 | 0.246485 | 0.031825 | 0.3 | 0.07 | 2808021925484324864 | 1237668584359723105 | -9999.0 | 10.25439 | -0.035576 | -10.33304 | 19.68472 | 328.9491 | 5.427939 | 80.62089 | 3.658881 | 11.68233 | 3.222977 | 114.7002 | 3.95683 | 11.4279 | 8.567916 | 38.61607 | 8.635287 | 26.33066 | 0.983906 | -10.33678 | 0.24048 | -12.44173 | 0.24048 | 0.16 | 0.82 | 0.0 | 0.01 | 0.01 | 0.98 | Sc?t | 0.08 | 0.1 | 0.04 | 4.4 | 1.0 | 0.0 | 0.0 | 3.68 |
\n",
+ "66400 | 487 | 174.5076 | 18.34128 | 0.029515 | 0.412765 | 3.51 | 29.428257 | 53.64475 | 126.39 | -19.421 | 23.46071 | 0.484 | 0.058902 | 9.846592 | -- | -- | 0.021264 | 1237668587045847259 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 2821584401496827904 | 1237668587045847259 | 8.961183 | 9.846592 | 0.021264 | -9.86949 | 23.97344 | 394.03 | 4.561218 | 105.7605 | 2.900097 | 41.66074 | 2.668586 | 150.3142 | 2.875388 | 89.17506 | 8.227464 | 102.932 | 8.659683 | 20.47608 | 0.677176 | -16.81231 | 0.251788 | -19.34202 | 0.251788 | 0.32 | 0.53 | 0.03 | 0.12 | 0.15 | 0.85 | SBc(r) | 0.2 | 0.14 | 0.03 | 4.9 | 1.0 | 0.0 | 0.0 | 3.51 |
\n",
+ "66803 | 482 | 188.27193 | 17.403131 | 0.026819 | 0.417084 | 5.07 | 51.89739 | 39.59816 | 26.7 | -20.114 | 23.964361 | 0.665 | 0.059035 | 10.14623 | 2.51 | 126.14 | -0.146308 | 1237668624087580715 | 220765.0 | 2.51 | 0.1 | 9.92 | 0.05 | 10.235491 | 0.046102 | 10.538002 | 0.016086 | 10.428 | 0.025 | 0.0084 | 0.028413 | 0.230834 | 0.028943 | 0.081 | 0.07 | 2925118815303919616 | 1237668624087580715 | -9999.0 | 10.14623 | -0.146308 | -10.33045 | 19.39374 | 237.3707 | 4.250463 | 62.07621 | 3.087481 | 11.07143 | 2.733043 | 85.37064 | 3.11945 | -5.201427 | 13.70762 | 16.47461 | 8.220942 | 21.13801 | 0.56184 | -9.18102 | 0.238556 | -11.15812 | 0.238556 | 0.35 | 0.63 | 0.0 | 0.01 | 0.02 | 0.98 | Sb4m | 0.03 | 0.46 | 0.0 | 3.69 | 1.0 | 0.0 | 0.0 | 5.07 |
\n",
+ "67290 | 405 | 155.29887 | 17.610922 | 0.03289 | 0.786289 | -2.08 | 28.171766 | 52.155533 | 124.25 | -18.762 | 24.155478 | 0.782 | 0.075992 | 9.917935 | -- | -- | -1.531668 | 1237670965392048338 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 2915097040721569792 | 1237670965392048338 | -9999.0 | 9.917935 | -1.531668 | -11.48032 | 25.1994 | 643.8994 | 6.79659 | 131.9119 | 3.641351 | 1267.984 | 10.56825 | 437.346 | 5.245484 | 229.7415 | 9.736882 | 141.1686 | 9.426397 | 24.15042 | 6.663629 | -26.14074 | 0.287101 | -28.09456 | 0.287101 | 0.19 | 0.08 | 0.08 | 0.66 | 0.73 | 0.27 | Sb?m | 0.0 | 0.5 | 0.0 | 3.5 | 0.0 | 0.0 | 1.0 | -2.08 |
\n",
+ "
"
+ ],
+ "text/plain": [
+ "\n",
+ "galaxy void ra dec redshift ... GZ1S GZ1Ell GZ1U TType_DS\n",
+ " dex(deg) dex(deg) ... \n",
+ "int32 int32 float32 float32 float32 ... float32 float32 float32 float32 \n",
+ "------ ----- --------- --------- -------- ... ------- ------- ------- --------\n",
+ " 3430 654 132.4546 51.09398 0.044739 ... 0.0 1.0 0.0 -2.44\n",
+ " 3666 654 129.82005 50.685875 0.044856 ... 1.0 0.0 0.0 5.07\n",
+ " 3670 654 131.11559 51.447163 0.044909 ... 0.0 0.0 1.0 1.16\n",
+ " 7906 654 140.62584 52.740112 0.042289 ... 0.0 0.0 1.0 4.38\n",
+ " 7926 654 136.4517 51.103626 0.045503 ... 1.0 0.0 0.0 3.25\n",
+ " 8556 654 134.75067 49.17309 0.040627 ... 0.0 0.0 1.0 -0.51\n",
+ " 8595 654 135.23158 50.235413 0.041231 ... 1.0 0.0 0.0 2.5\n",
+ " 8646 654 136.35133 51.460213 0.040646 ... 0.0 0.0 1.0 1.42\n",
+ " 10595 139 121.45962 37.460052 0.034214 ... 0.0 1.0 0.0 -1.75\n",
+ " ... ... ... ... ... ... ... ... ... ...\n",
+ " 62480 482 190.40115 23.425161 0.028727 ... 1.0 0.0 0.0 4.16\n",
+ " 63083 482 190.50949 18.98778 0.027007 ... 1.0 0.0 0.0 4.4\n",
+ " 65288 622 235.6254 15.790563 0.042083 ... 1.0 0.0 0.0 2.95\n",
+ " 65303 622 234.51367 16.401506 0.042464 ... 0.0 0.0 1.0 -2.2\n",
+ " 65716 622 235.81642 11.808072 0.037216 ... 1.0 0.0 0.0 5.15\n",
+ " 65887 622 237.4744 15.415592 0.038231 ... 1.0 0.0 0.0 2.17\n",
+ " 66239 487 170.40993 16.03152 0.031609 ... 1.0 0.0 0.0 3.68\n",
+ " 66400 487 174.5076 18.34128 0.029515 ... 1.0 0.0 0.0 3.51\n",
+ " 66803 482 188.27193 17.403131 0.026819 ... 1.0 0.0 0.0 5.07\n",
+ " 67290 405 155.29887 17.610922 0.03289 ... 0.0 0.0 1.0 -2.08"
+ ]
+ },
+ "execution_count": 7,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "catalogue_CAVITY = tap_result.to_table()\n",
+ "catalogue_CAVITY"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ae4f3ef1",
+ "metadata": {},
+ "source": [
+ "# Crossmatch catalogues"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "id": "14edbd3f",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "radius = 10 # in arsec"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "id": "cd86c6a1",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "Table length=5\n",
+ "
\n",
+ "ID | ra | dec |
\n",
+ "int16 | float64 | float64 |
\n",
+ "1 | 116.102013 | 33.342975 |
\n",
+ "2 | 222.141865 | 31.935599 |
\n",
+ "3 | 184.360931 | 44.521568 |
\n",
+ "4 | 15.234771 | -10.004942 |
\n",
+ "5 | 129.820053 | 50.685875 |
\n",
+ "
"
+ ],
+ "text/plain": [
+ "\n",
+ " ID ra dec \n",
+ "int16 float64 float64 \n",
+ "----- ---------- ----------\n",
+ " 1 116.102013 33.342975\n",
+ " 2 222.141865 31.935599\n",
+ " 3 184.360931 44.521568\n",
+ " 4 15.234771 -10.004942\n",
+ " 5 129.820053 50.685875"
+ ]
+ },
+ "execution_count": 9,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "catalogue_source = Table.read('../files/galaxies_votable_example.xml')\n",
+ "catalogue_source"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "id": "f6281189",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "coords_source = SkyCoord(catalogue_source['ra'].value, catalogue_source['dec'].value, unit=(u.deg, u.deg))\n",
+ "coords_CAVITY = SkyCoord(catalogue_CAVITY['ra'].value, catalogue_CAVITY['dec'].value, unit=(u.deg, u.deg))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "id": "67cb073d",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "idx, d2d, _ = coords_source.match_to_catalog_sky(coords_CAVITY)\n",
+ "sep_constraint = d2d.arcsec < radius\n",
+ "idx_constraint = idx[sep_constraint]\n",
+ "\n",
+ "separation = d2d[sep_constraint].arcsec.round(6)\n",
+ "\n",
+ "match_source = catalogue_source[sep_constraint]\n",
+ "match_CAVITY = catalogue_CAVITY[idx_constraint]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "id": "c47aa067",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "Table length=5\n",
+ "
\n",
+ "separation |
\n",
+ "float64 |
\n",
+ "21098.699291 |
\n",
+ "6598.974401 |
\n",
+ "0.003601 |
\n",
+ "392075.568176 |
\n",
+ "0.001759 |
\n",
+ "
"
+ ],
+ "text/plain": [
+ "\n",
+ " separation \n",
+ " float64 \n",
+ "-------------\n",
+ " 21098.699291\n",
+ " 6598.974401\n",
+ " 0.003601\n",
+ "392075.568176\n",
+ " 0.001759"
+ ]
+ },
+ "execution_count": 12,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "Table([d2d.arcsec.round(6)],names=['separation'])"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "id": "d1b5af9b",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "Table length=2\n",
+ "
\n",
+ "ID | galaxy | void | ra | dec | redshift | effr_frac | morphology | d25 | incl | pa | rabsmag | sb | g-r | Av | M_star | fluxHI | vmaxg | log(SFR) | SDSS_ID | AGC | HIflux | sigflux | logMHI | logMHI_err | logMstarTaylor | logMstarTaylor_err | logMstarMcGaugh | logMstarMcGaugh_err | logMstarGSWLC | logMstarGSWLC_err | logSFR22 | logSFR22_err | logSFRNUVIR | logSFRNUVIR_err | logSFRGSWLC | logSFRGSWLC_err | specObjID | bestobjID | oh_p50 | lgm_tot_p50 | sfr_tot_p50 | specsfr_tot_p50 | sn_median | h_alpha_flux | h_alpha_flux_err | h_beta_flux | h_beta_flux_err | oiii_5007_flux | oiii_5007_flux_err | nii_6584_flux | nii_6584_flux_err | oii_3726_flux | oii_3726_flux_err | oii_3729_flux | oii_3729_flux_err | h_alpha_cont | h_alpha_cont_err | h_alpha_reqw | h_alpha_reqw_err | h_alpha_eqw | h_alpha_eqw_err | probaSab | probaScd | probaEll | probaS0 | probaEarly | probaLate | GZ2class | pnobulge | pobvious | pdominant | GZ2formula | GZ1S | GZ1Ell | GZ1U | TType_DS | separation |
\n",
+ " | | | dex(deg) | dex(deg) | | | | dex(arcsec) | dex(deg) | dex(deg) | [mag] | [mag·arcsec⁻²] | [mag] | [mag] | [log(M☉)] | [Jy·km·s⁻¹] | [km·s⁻¹] | [log(M☉·yr⁻¹)] | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
\n",
+ "int16 | int32 | int32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | str19 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | str19 | str19 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | str8 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float32 | float64 |
\n",
+ "3 | 33005 | 921 | 184.36093 | 44.52157 | 0.037983 | 0.775238 | 4.23 | 36.65973 | 40.93053 | 175.14 | -19.668 | 24.364313 | 0.58 | 0.028659 | 10.05042 | -- | -- | 0.044623 | 1237661850395476104 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 1543694306638850048 | 1237661850395476104 | -9999.0 | 10.05042 | 0.044623 | -10.05926 | 12.3 | 100.9082 | 2.759601 | 29.08918 | 2.403734 | 6.710645 | 2.767122 | 34.55568 | 2.571727 | 26.17171 | 6.49094 | 38.78974 | 6.637816 | 11.97513 | 0.839663 | -6.934666 | 0.29948 | -8.570003 | 0.29948 | 0.15 | 0.84 | 0.0 | 0.01 | 0.01 | 0.99 | Sc2m | 0.06 | 0.19 | 0.03 | 4.19 | 1.0 | 0.0 | 0.0 | 4.23 | 0.003601 |
\n",
+ "5 | 3666 | 654 | 129.82005 | 50.685875 | 0.044856 | 0.680431 | 5.07 | 22.560259 | 58.641518 | 67.07 | -18.714 | 24.288118 | 0.461 | 0.069253 | 9.476982 | -- | -- | -0.157294 | 1237651250948407434 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | 501167326968702976 | 1237651250948407434 | 8.810315 | 9.476982 | -0.157294 | -9.690399 | 8.851635 | 175.2168 | 2.899168 | 48.28789 | 2.14631 | 28.24212 | 2.008974 | 47.07142 | 1.90306 | 63.13743 | 4.760993 | 61.10303 | 4.655201 | 5.915043 | 1.105944 | -28.06753 | 0.616602 | -30.23859 | 0.616602 | 0.14 | 0.76 | 0.02 | 0.08 | 0.1 | 0.9 | Sc?t | 0.4 | 0.07 | 0.0 | 6.15 | 1.0 | 0.0 | 0.0 | 5.07 | 0.001759 |
\n",
+ "
"
+ ],
+ "text/plain": [
+ "\n",
+ " ID galaxy void ra dec ... GZ1Ell GZ1U TType_DS separation\n",
+ " dex(deg) dex(deg) ... \n",
+ "int16 int32 int32 float32 float32 ... float32 float32 float32 float64 \n",
+ "----- ------ ----- --------- --------- ... ------- ------- -------- ----------\n",
+ " 3 33005 921 184.36093 44.52157 ... 0.0 0.0 4.23 0.003601\n",
+ " 5 3666 654 129.82005 50.685875 ... 0.0 0.0 5.07 0.001759"
+ ]
+ },
+ "execution_count": 13,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# full table source id + CAVITY\n",
+ "hstack([hstack([match_source['ID'], match_CAVITY]), Table([separation],names=['separation'])])"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "id": "0c1ac631",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "Table length=3\n",
+ "
\n",
+ "ID | ra | dec |
\n",
+ "int16 | float64 | float64 |
\n",
+ "1 | 116.102013 | 33.342975 |
\n",
+ "2 | 222.141865 | 31.935599 |
\n",
+ "4 | 15.234771 | -10.004942 |
\n",
+ "
"
+ ],
+ "text/plain": [
+ "\n",
+ " ID ra dec \n",
+ "int16 float64 float64 \n",
+ "----- ---------- ----------\n",
+ " 1 116.102013 33.342975\n",
+ " 2 222.141865 31.935599\n",
+ " 4 15.234771 -10.004942"
+ ]
+ },
+ "execution_count": 14,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "catalogue_source[~sep_constraint] # not found in xmatch"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "6cbe31f8",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3.9.2 ('QCONTROL')",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.9.2"
+ },
+ "toc-autonumbering": true,
+ "vscode": {
+ "interpreter": {
+ "hash": "ef8d2a8c771d36027734b5d9b80bf9780f088fbc8610cf9b587dbbffa1bbfe55"
+ }
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000000000000000000000000000000000000..542a5a7d994305417063656af11a10026f06b2df
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,3 @@
+pyvo>=1.0
+astropy
+scipy
\ No newline at end of file
diff --git a/runtime.txt b/runtime.txt
new file mode 100644
index 0000000000000000000000000000000000000000..f31904fcb9165e71f5777bee4b1b5dc1cd22b4b7
--- /dev/null
+++ b/runtime.txt
@@ -0,0 +1 @@
+python-3.10
\ No newline at end of file