2
2
3
3
.. _astroquery.utils.tap :
4
4
5
+ .. Warning ::
6
+ This module is for internal astroquery use only with the purpose to
7
+ support the modules developed and maintained by ESA (``astroquery.gaia ``,
8
+ ``astroquery.esasky ``, and modules within ``astroquery.esa ``).
9
+ If you need a TAP implementation, especially to access non-ESA services,
10
+ we recommend to use `pyVO <https://pyvo.readthedocs.io/en/latest/ >`__ instead.
11
+ Our intention is to merge the functionalities and remove TAP/TAP+ from astroquery.
12
+
13
+
5
14
*********************************
6
15
TAP/TAP+ (`astroquery.utils.tap `)
7
16
*********************************
@@ -452,7 +461,7 @@ If you do not provide any parameters at all, a prompt will ask for user name and
452
461
>> > from astroquery.gaia import Gaia
453
462
>> > Gaia.login()
454
463
>> > User: user
455
- >> > Password: pwd (not visible)
464
+ >> > Password: pwd (not visible)
456
465
457
466
458
467
To perform a logout
@@ -549,7 +558,7 @@ Now, you can query your table as follows:
549
558
Now, you can query your table as follows:
550
559
551
560
.. code-block :: python
552
-
561
+
553
562
>> > full_qualified_table_name = ' user_<your_login_name>.table_test_from_file'
554
563
>> > query = ' select * from ' + full_qualified_table_name
555
564
>> > job = gaia.launch_job(query = query)
@@ -566,13 +575,13 @@ Now, you can query your table as follows:
566
575
>> > gaia.login()
567
576
>> > j1 = gaia.launch_job_async(" select top 10 * from gaiadr2.gaia_source" )
568
577
>> > job = gaia.upload_table_from_job(j1)
569
-
578
+
570
579
Created table ' t1539932994481O' from job: ' 1539932994481O' .
571
580
572
581
Now, you can query your table as follows:
573
582
574
583
.. code-block :: python
575
-
584
+
576
585
>> > full_qualified_table_name = ' user_<your_login_name>.t1539932994481O'
577
586
>> > query = ' select * from ' + full_qualified_table_name
578
587
>> > job = gaia.launch_job(query = query)
@@ -599,7 +608,7 @@ Now, you can query your table as follows:
599
608
Now, you can query your table as follows:
600
609
601
610
.. code-block :: python
602
-
611
+
603
612
>> > full_qualified_table_name = ' user_<your_login_name>.my_table'
604
613
>> > query = ' select * from ' + full_qualified_table_name
605
614
>> > job = gaia.launch_job(query = query)
@@ -615,9 +624,9 @@ Now, you can query your table as follows:
615
624
>> > gaia = TapPlus(url = " http://gea.esac.esa.int/tap-server/tap" )
616
625
>> > gaia.login_gui()
617
626
>> > job = gaia.delete_user_table(" table_test_from_file" )
618
-
627
+
619
628
Table ' table_test_from_file' deleted.
620
-
629
+
621
630
2.4. Updating metadata of table in user space
622
631
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
623
632
@@ -637,7 +646,7 @@ values for 'utype' and 'ucd' are free text
637
646
value for 'flags' can be 'Ra', 'Dec', 'Mag', 'Flux' and 'PK'
638
647
value for 'indexed' is a boolean indicating if the column is indexed
639
648
640
- It is possible to specify a list of those changes for them to be applied at once.
649
+ It is possible to specify a list of those changes for them to be applied at once.
641
650
This is done by putting each of the changes in a list. See example below.
642
651
643
652
.. code-block :: python
@@ -646,11 +655,11 @@ This is done by putting each of the changes in a list. See example below.
646
655
>> > gaia = TapPlus(url = " http://gea.esac.esa.int/tap-server/tap" )
647
656
>> > gaia.login_gui()
648
657
>> > gaia.update_user_table(table_name = " user_<user_login_name>.my_table" , list_of_changes = [[" recno" , " ucd" , " ucd sample" ], [" nobs" ," utype" ," utype sample" ], [" raj2000" ," flags" ," Ra" ], [" dej2000" ," flags" ," Dec" ]])
649
-
658
+
650
659
Retrieving table ' user_<user_login_name>.my_table'
651
660
Parsing table ' user_<user_login_name>.my_table' ...
652
661
Done.
653
- Table ' user_<user_login_name>.my_table' updated.
662
+ Table ' user_<user_login_name>.my_table' updated.
654
663
655
664
2.5. Tables sharing
656
665
^^^^^^^^^^^^^^^^^^^
@@ -733,15 +742,15 @@ TAP+ services may provide a data access entry point.
733
742
>> > gaia = TapPlus(url = " http://gea.esac.esa.int/tap-server/tap" )
734
743
>> > params_dict = {}
735
744
>> > params_dict[' VALID_DATA' ] = " true"
736
- >> > params_dict[' ID' ] = " 1000103304040175360"
745
+ >> > params_dict[' ID' ] = " 1000103304040175360"
737
746
>> > params_dict[' FORMAT' ] = " votable"
738
747
>> > params_dict[' RETRIEVAL_TYPE' ] = " epoch_photometry"
739
748
>> > gaia.load_data(params_dict = params_dict, output_file = " results.vot" )
740
749
741
750
You may download data into memory:
742
751
743
752
.. code-block :: python
744
-
753
+
745
754
>> > results = gaia.load_data(params_dict = params_dict)
746
755
747
756
@@ -751,7 +760,7 @@ You may download data into memory:
751
760
This service provides links to data:
752
761
753
762
.. code-block :: python
754
-
763
+
755
764
>> > from astroquery.utils.tap.core import TapPlus
756
765
>> > gaia = TapPlus(url = " http://gea.esac.esa.int/tap-server/tap" )
757
766
>> > ids= " 1000103304040175360,1000117258390464896"
0 commit comments