Skip to content

Commit 4fe761b

Browse files
tinuademargaretbsipocz
authored andcommitted
added remote data directive
1 parent fac66a1 commit 4fe761b

File tree

1 file changed

+98
-95
lines changed

1 file changed

+98
-95
lines changed

docs/cadc/cadc.rst

Lines changed: 98 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. doctest-skip-all
2-
31
.. _astroquery.cadc:
42

53
************************
@@ -28,6 +26,7 @@ The CADC hosts a number of collections and
2826
these collections:
2927

3028
.. code-block:: python
29+
.. doctest-remote-data::
3130

3231
>>> from astroquery.cadc import Cadc
3332
>>> cadc = Cadc()
@@ -36,8 +35,8 @@ these collections:
3635
...
3736
APASS : {'Description': 'The APASS collection at the CADC', 'Bands': ['Optical', 'Infrared', '']}
3837
BLAST : {'Description': 'The BLAST collection at the CADC', 'Bands': ['', 'Millimeter']}
39-
CFHT : {'Description': 'The CFHT collection at the CADC', 'Bands': ['Infrared|Optical', '', 'Optical', 'Infrared']}
40-
CFHTMEGAPIPE : {'Description': 'The CFHTMEGAPIPE collection at the CADC', 'Bands': ['Infrared', 'Optical']}
38+
CFHT : {'Description': 'The CFHT collection at the CADC', 'Bands': ['Infrared|Optical', 'Infrared|Optical|UV', '', 'Infrared|Optical|UV|EUV|X-ray|Ga', 'Optical', 'Infrared', 'X-ray|Gamma-ray']}
39+
CFHTMEGAPIPE : {'Description': 'The CFHTMEGAPIPE collection at the CADC', 'Bands': ['', 'Infrared|Optical', 'Infrared', 'Optical']}
4140
CFHTTERAPIX : {'Description': 'The CFHTTERAPIX collection at the CADC', 'Bands': ['Optical', 'Infrared']}
4241
CFHTWIRWOLF : {'Description': 'The CFHTWIRWOLF collection at the CADC', 'Bands': ['Infrared']}
4342
CGPS : {'Description': 'The CGPS collection at the CADC', 'Bands': ['Infrared', 'Radio', 'Millimeter', '']}
@@ -63,7 +62,7 @@ these collections:
6362
TESS : {'Description': 'The TESS collection at the CADC', 'Bands': ['Optical']}
6463
UKIRT : {'Description': 'The UKIRT collection at the CADC', 'Bands': ['', 'Optical', 'Infrared']}
6564
VGPS : {'Description': 'The VGPS collection at the CADC', 'Bands': ['Radio']}
66-
VLASS : {'Description': 'The VLASS collection at the CADC', 'Bands': ['', 'Radio']}
65+
VLASS : {'Description': 'The VLASS collection at the CADC', 'Bands': ['Radio']}
6766
XMM : {'Description': 'The XMM collection at the CADC', 'Bands': ['Optical', 'UV', 'X-ray']}
6867

6968

@@ -73,35 +72,37 @@ France Hawaii Telescope (CFHT) data for a given region and resolves
7372
the URLs for downloading the corresponding data.
7473

7574
.. code-block:: python
75+
.. doctest-remote-data::
7676

7777
>>> from astroquery.cadc import Cadc
7878
>>> cadc = Cadc()
7979
>>> result = cadc.query_region('08h45m07.5s +54d18m00s', collection='CFHT')
8080
>>> print(result)
81-
observationURI sequenceNumber metaReadGroups ... accMetaChecksum2 lastModified2 maxLastModified2
82-
...
83-
----------------- -------------- -------------- ... ------------------------------------ ----------------------- -----------------------
84-
caom:CFHT/2366432 2366432 ... md5:2a6a9b9d399b5ef84899f83206eecd0d 2019-01-08T10:03:36.057 2019-01-08T10:17:16.206
85-
caom:CFHT/2366188 2366188 ... md5:af8096be4d9d9186b2cc39fb6bd9914c 2019-01-07T11:27:37.922 2019-01-07T18:25:49.914
86-
caom:CFHT/2480747 2480747 ... md5:c24ace389b760c290a5bf31842fb4ea9 2020-09-09T12:47:39.890 2020-09-09T12:47:39.890
87-
caom:CFHT/2366188 2366188 ... md5:935330f6f4bb8211eaa8d84c76fbec33 2019-02-07T12:41:55.814 2019-11-06T08:37:00.616
88-
caom:CFHT/2376828 2376828 ... md5:7c84ae4b76485a28336f03b2b5af18b3 2019-03-04T08:19:23.766 2019-03-04T10:55:53.572
89-
caom:CFHT/2366432 2366432 ... md5:3bddcbca4ce44a337d6ed2fd7a99507d 2019-02-07T12:24:09.625 2019-11-06T08:37:54.590
90-
caom:CFHT/2376828 2376828 ... md5:a3e8ccba7bc69d14a07d261d8615cc47 2019-04-10T22:14:33.111 2019-11-06T08:56:14.246
91-
caom:CFHT/2480747 2480747 ... md5:a7cccd9710cbca222dc8f8b1eedff3b5 2020-09-09T12:47:39.890 2020-09-09T12:47:39.890
92-
81+
observationURI sequenceNumber ... accMetaChecksum2
82+
...
83+
----------------- -------------- ... ------------------------------------
84+
caom:CFHT/2366432 2366432 ... md5:76a5e97c9d2f726f456c92b6d2303dd3
85+
caom:CFHT/2366432 2366432 ... md5:eff6ecab03761186d6ce699dff43ddc7
86+
caom:CFHT/2366188 2366188 ... md5:896250159a7e80eecdad34150201f361
87+
caom:CFHT/2376828 2376828 ... md5:1c9008a82af8e5b0ed377c8544ded497
88+
caom:CFHT/2376828 2376828 ... md5:297b56e1f2e80602e0cb0cc901505108
89+
caom:CFHT/2366188 2366188 ... md5:f0ec6252250a86963a102351c23d0ca7
90+
caom:CFHT/2480747 2480747 ... md5:a7cccd9710cbca222dc8f8b1eedff3b5
91+
caom:CFHT/2480747 2480747 ... md5:c24ace389b760c290a5bf31842fb4ea9
92+
93+
.. doctest-skip::
9394
>>> urls = cadc.get_data_urls(result)
9495
>>> for url in urls:
9596
... print(url)
9697
...
97-
https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/data/pub/CFHT/2366432o.fits.fz?RUNID=njvos75ijcw0vo4r
98-
https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/data/pub/CFHT/2366188o.fits.fz?RUNID=njvos75ijcw0vo4r
99-
https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/data/pub/CFHT/2480747p.fits.fz?RUNID=njvos75ijcw0vo4r
100-
https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/data/pub/CFHT/2366188p.fits.fz?RUNID=njvos75ijcw0vo4r
101-
https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/data/pub/CFHT/2376828o.fits.fz?RUNID=njvos75ijcw0vo4r
102-
https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/data/pub/CFHT/2366432p.fits.fz?RUNID=njvos75ijcw0vo4r
103-
https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/data/pub/CFHT/2376828p.fits.fz?RUNID=njvos75ijcw0vo4r
104-
https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/data/pub/CFHT/2480747o.fits.fz?RUNID=njvos75ijcw0vo4r
98+
https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/data/pub/CFHT/2366432o.fits.fz?RUNID=queoo1qg8y4pgiep
99+
https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/data/pub/CFHT/2366432p.fits.fz?RUNID=queoo1qg8y4pgiep
100+
https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/data/pub/CFHT/2366188p.fits.fz?RUNID=queoo1qg8y4pgiep
101+
https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/data/pub/CFHT/2376828o.fits.fz?RUNID=queoo1qg8y4pgiep
102+
https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/data/pub/CFHT/2376828p.fits.fz?RUNID=queoo1qg8y4pgiep
103+
https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/data/pub/CFHT/2366188o.fits.fz?RUNID=queoo1qg8y4pgiep
104+
https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/data/pub/CFHT/2480747o.fits.fz?RUNID=queoo1qg8y4pgiep
105+
https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/data/pub/CFHT/2480747p.fits.fz?RUNID=queoo1qg8y4pgiep
105106

106107

107108
The next example queries all the data in the same region and filters
@@ -110,13 +111,15 @@ filtering possible) and resolves the URLs for both the primary and
110111
auxiliary data (in this case preview files)
111112

112113
.. code-block:: python
114+
.. doctest-remote-data::
113115

114116
>>> from astroquery.cadc import Cadc
115117
>>> cadc = Cadc()
116118
>>> result = cadc.query_region('08h45m07.5s +54d18m00s')
117119
>>> print(len(result))
118-
3032
119-
120+
3034
121+
122+
.. doctest-skip::
120123
>>> urls = cadc.get_data_urls(result[result['target_name'] == 'Nr3491_1'],
121124
... include_auxiliaries=True)
122125
>>> for url in urls:
@@ -137,13 +140,13 @@ is not resolved. Instead it is matched against the target name in
137140
the CADC metadata.
138141

139142
.. code-block:: python
143+
.. doctest-remote-data::
140144

141145
>>> from astroquery.cadc import Cadc
142146
>>> cadc = Cadc()
143147
>>> result = cadc.query_name('M31')
144148
>>> print(len(result))
145149
103949
146-
147150
>>> result = cadc.query_name('Nr3491_1')
148151
>>> print(result)
149152
observationURI sequenceNumber metaReadGroups ... accMetaChecksum2 lastModified2 maxLastModified2
@@ -157,6 +160,8 @@ If only a subsection of the FITS file is needed, CADC can query an
157160
area and resolve the cutout of a result.
158161

159162
.. code-block:: python
163+
.. doctest-skip::
164+
.. doctest-remote-data::
160165

161166
>>> from astropy import units as u
162167
>>> from astroquery.cadc import Cadc
@@ -175,6 +180,8 @@ Alternatively, if the query result is large and data does not need to be
175180
in memory, lazy access to the downloaded FITS file can be used.
176181

177182
.. code-block:: python
183+
.. doctest-skip::
184+
.. doctest-remote-data::
178185

179186
>>> from astropy import units as u
180187
>>> from astropy.coordinates import SkyCoord
@@ -205,6 +212,8 @@ are needed, the result table can be passed into the
205212
cutout coordinates and radius.
206213

207214
.. code-block:: python
215+
.. doctest-skip::
216+
.. doctest-remote-data::
208217

209218
>>> from astroquery.cadc import Cadc
210219
>>> from astropy import units as u
@@ -309,6 +318,8 @@ Examples of TAP access
309318
To get a list of table objects:
310319

311320
.. code-block:: python
321+
.. doctest-remote-data::
322+
312323

313324
>>> from astroquery.cadc import Cadc
314325
>>> cadc = Cadc()
@@ -346,6 +357,7 @@ To get a list of table objects:
346357
To get a single table object:
347358

348359
.. code-block:: python
360+
.. doctest-remote-data::
349361

350362
>>> from astroquery.cadc import Cadc
351363
>>> cadc = Cadc()
@@ -419,49 +431,43 @@ The results can be saved in memory (default) or in a file.
419431
Query without saving results in a file:
420432

421433
.. code-block:: python
434+
.. doctest-remote-data::
422435

423436
>>> from astroquery.cadc import Cadc
424437
>>> cadc = Cadc()
425438
>>> results = cadc.exec_sync("SELECT top 100 observationID, intent FROM caom2.Observation")
426439
>>> print(results)
427-
observationID intent
428-
---------------------------- -------
429-
C090503_0500 science
430-
c4d_151207_032018_opd_u_v3 science
431-
ct3264072 science
432-
tu558265 science
433-
ct2318747 science
434-
tu1826354 science
435-
c4d_150601_015113_ori science
436-
tu212518 science
437-
k4i_041101_174620_zri science
438-
tu072083 science
439-
psg_170118_012214_ori science
440-
k4n_131022_051755_opd_KXs_v3 science
441-
c15s_080828_031158_ori science
442-
c4d_160214_072405_opi_r_v1 science
443-
... ...
444-
c4d_150902_000343_opd_i_v1 science
445-
c09i_141005_231309_sri science
446-
kcfs_081028_074111_ori science
447-
tu802011 science
448-
c4d_141122_004603_oow_u_v3 science
449-
c15s_071230_081528_ori science
450-
c15s_070924_203941_zri science
451-
tu1116697 science
452-
ct3429663 science
453-
dao_c182_2020_005631 science
454-
dao_c182_2020_005632 science
455-
C090317_0114 science
456-
cp828585 science
457-
c09i_060720_044639_ori science
458-
GS-2004A-Q-27-43-006 science
440+
observationID intent
441+
----------------------------------------------- -----------
442+
j8eh03boq science
443+
j8f635020 science
444+
jbfkb1peq science
445+
j8ff06s2q science
446+
icdx40oxq science
447+
j8fd13rgq science
448+
j8ff03020 science
449+
GN-2014B-SV-101-761-010 science
450+
j8ff07020 science
451+
jbfh14020 science
452+
... ...
453+
hst_10476_50_acs_wfc_f850lp_j9fo50ul science
454+
GS-CAL20181018-10-026-G-BIAS calibration
455+
GN-2020B-Q-120-40-050 calibration
456+
GS-CAL20181018-10-021-G-BIAS calibration
457+
GS-CAL20181018-10-036-G-BIAS calibration
458+
GS-CAL20181018-10-061-G-BIAS calibration
459+
icdx13u2q science
460+
GS-CAL20181117-2-046-G-BIAS calibration
461+
tess2019357164649-s0020-0000000159539617-0165-s science
462+
GS-CAL20181117-2-061-G-BIAS calibration
463+
GS-CAL20181018-10-086-G-BIAS calibration
459464
Length = 100 rows
460465

461466

462467
Query saving results in a file:
463468

464469
.. code-block:: python
470+
.. doctest-remote-data::
465471

466472
>>> from astroquery.cadc import Cadc
467473
>>> cadc = Cadc()
@@ -474,6 +480,7 @@ Query saving results in a file:
474480
A table can be uploaded to the server in order to be used in a query.
475481

476482
.. code-block:: python
483+
.. doctest-remote-data::
477484

478485
>>> from astroquery.cadc import Cadc
479486
>>> cadc = Cadc()
@@ -501,48 +508,39 @@ The results can be saved in memory (default) or in a file.
501508
Query without saving results in a file:
502509

503510
.. code-block:: python
511+
.. doctest-skip::
512+
.. doctest-remote-data::
504513

505514
>>> from astroquery.cadc import Cadc
506515
>>> cadc = Cadc()
507516
>>> job = cadc.create_async("SELECT TOP 100 observationID, instrument_name, target_name FROM caom2.Observation AS Observation")
508517
>>> job.run().wait()
509518
>>> job.raise_if_error()
510519
>>> print(job.fetch_result().to_table())
511-
observationID instrument_name target_name
512-
---------------------------- ---------------- --------------------------------
513-
C090503_0500 CPAPIR SH87
514-
c4d_151207_032018_opd_u_v3 decam Field14
515-
ct3264072 andicam 2227-08
516-
tu558265 mosaic_2 xcs0058940301
517-
ct2318747 ccd_spec test
518-
tu1826354 decam B1
519-
c4d_150601_015113_ori decam junk
520-
tu212518 newfirm Mask for K4N09B_20091129_783db2b
521-
k4i_041101_174620_zri ir_imager TEST bias
522-
tu072083 newfirm Mask for K4N07B_20071113_776684b
523-
psg_170118_012214_ori goodman NGC1672
524-
k4n_131022_051755_opd_KXs_v3 newfirm Mask for K4N13B_20131020_89c812c
525-
c15s_080828_031158_ori ccd_spec 082
526-
c4d_160214_072405_opi_r_v1 decam MAGLITES field: 5354-01-r
527-
c4d_141122_004603_oki_u_v3 decam Field4
528-
c4d_140505_000543_opw_VR_v1 decam AiYN1Qv
529-
... ... ...
530-
c09i_140321_044944_ori ccd_imager twhya filter1 = dia, filter2 = g
531-
c4d_150902_000343_opd_i_v1 decam C6p13c1A
532-
c09i_141005_231309_sri ccd_imager sflat
533-
kcfs_081028_074111_ori ccd_spec HD 22780
534-
tu802011 mosaic_1_1 86326
535-
c4d_141122_004603_oow_u_v3 decam Field4
536-
c15s_071230_081528_ori ccd_spec HD 95578
537-
c15s_070924_203941_zri ccd_spec Bias
538-
tu1116697 mosaic_2 sm43
539-
ct3429663 mosaic_2 test
540-
dao_c182_2020_005631 Newtonian Imager s2020ihc(150@0)
541-
dao_c182_2020_005632 Newtonian Imager s2020ihc(150@0)
542-
C090317_0114 CPAPIR 2M1106
543-
cp828585 spartan WISEJ1741+2533 x-6y5
544-
c09i_060720_044639_ori ccd_imager G2239n05d1243
545-
GS-2004A-Q-27-43-006 GMOS-S LMCF4
520+
observationID intent
521+
----------------------------------------------- -----------
522+
j8eh03boq science
523+
j8f635020 science
524+
jbfkb1peq science
525+
j8ff06s2q science
526+
icdx40oxq science
527+
j8fd13rgq science
528+
j8ff03020 science
529+
GN-2014B-SV-101-761-010 science
530+
j8ff07020 science
531+
jbfh14020 science
532+
... ...
533+
hst_10476_50_acs_wfc_f850lp_j9fo50ul science
534+
GS-CAL20181018-10-026-G-BIAS calibration
535+
GN-2020B-Q-120-40-050 calibration
536+
GS-CAL20181018-10-021-G-BIAS calibration
537+
GS-CAL20181018-10-036-G-BIAS calibration
538+
GS-CAL20181018-10-061-G-BIAS calibration
539+
icdx13u2q science
540+
GS-CAL20181117-2-046-G-BIAS calibration
541+
tess2019357164649-s0020-0000000159539617-0165-s science
542+
GS-CAL20181117-2-061-G-BIAS calibration
543+
GS-CAL20181018-10-086-G-BIAS calibration
546544
Length = 100 rows
547545

548546

@@ -554,6 +552,8 @@ the job.
554552

555553

556554
.. code-block:: python
555+
.. doctest-skip::
556+
.. doctest-remote-data::
557557

558558
>>> from astroquery.cadc import Cadc
559559
>>> cadc = Cadc()
@@ -633,6 +633,7 @@ users are applicable for authenticated ones.
633633
Login with username and password:
634634

635635
.. code-block:: python
636+
.. doctest-skip::
636637

637638
>>> from astroquery.cadc import Cadc
638639
>>> cadc = Cadc()
@@ -642,6 +643,7 @@ Login with username and password:
642643
Login with certificate:
643644

644645
.. code-block:: python
646+
.. doctest-skip::
645647

646648
>>> from astroquery.cadc import Cadc
647649
>>> cadc = Cadc()
@@ -652,6 +654,7 @@ To perform a logout:
652654

653655

654656
.. code-block:: python
657+
.. doctest-skip::
655658

656659
>>> from astroquery.cadc import Cadc
657660
>>> cadc = Cadc()

0 commit comments

Comments
 (0)