Skip to content

Commit 65e3fc2

Browse files
jcsegoviabsipocz
authored andcommitted
Added doc. Updated get_product_list query.
1 parent 8e407ef commit 65e3fc2

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

astroquery/jwst/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ def get_product_list(self, observation_id=None, cal_level=None, product_type=Non
858858
str(self.JWST_ARTIFACT_TABLE) + " AS a, " +\
859859
str(self.JWST_MAIN_TABLE) + " AS m " +\
860860
"WHERE a.obsid = m.obsid AND " +\
861-
"a.obsid = '"+observation_id+"' " +\
861+
"m.observationid = '"+observation_id+"' " +\
862862
cal_level_condition +\
863863
prodtype_condition +\
864864
" ORDER BY a.producttype ASC"

astroquery/jwst/tests/test_jwsttap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ def test_get_products_list(self):
636636
"jwst.artifact AS a, " +\
637637
"jwst.main AS m " + \
638638
"WHERE a.obsid = m.obsid AND " + \
639-
"a.obsid = '" + observation_id + "' " + \
639+
"m.observationid = '" + observation_id + "' " + \
640640
cal_level_condition + \
641641
prodtype_condition + \
642642
" ORDER BY a.producttype ASC"
@@ -664,7 +664,7 @@ def test_get_products_list(self):
664664
"jwst.artifact AS a, " +\
665665
"jwst.main AS m " + \
666666
"WHERE a.obsid = m.obsid AND " + \
667-
"a.obsid = '" + observation_id + "' " + \
667+
"m.observationid = '" + observation_id + "' " + \
668668
cal_level_condition + \
669669
prodtype_condition + \
670670
" ORDER BY a.producttype ASC"

docs/jwst/jwst.rst

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -151,26 +151,30 @@ To query the data products associated with a certain plane ID
151151
.. code-block:: python
152152
153153
>>> from astroquery.jwst import Jwst
154-
>>> product_list = Jwst.get_product_list('00000000-0000-0000-aa9c-541cc6e5ff87')
155-
>>> print(product_list.group_by(['artifactid', 'filename']).groups.keys)
154+
>>> product_list = Jwst.get_product_list(observation_id='jw97012001001_02101_00001_guider1')
155+
>>> for row in result:
156+
>>> print("artifactid: %s\tfilename: %s" % (row['artifactid'].decode('UTF-8'), row['filename'].decode('UTF-8')))
156157
157-
artifactid filename
158-
------------------------------------ -----------------------------------------
159-
00000000-0000-0000-81df-1e50349b9801 jw10006010001_01_msa.fits
160-
00000000-0000-0000-95e8-4d5c47e0d19f jw10006010001_01101_00002_nrs2_uncal.jpg
161-
00000000-0000-0000-af91-b0375f07283b jw10006010001_01101_00002_nrs2_uncal.fits
162158
163-
To query the science data products associated with a certain plane ID
159+
artifactid: 00000000-0000-0000-b774-8f78db4cb6cd file: jw97012001001_02101_00001_guider1_rateints.fits
160+
artifactid: 00000000-0000-0000-a09d-13769875a033 file: jw97012001001_02101_00001_guider1_rate.fits
161+
artifactid: 00000000-0000-0000-8e72-d874267e0c68 file: jw97012001001_02101_00001_guider1_trapsfilled.fits
162+
artifactid: 00000000-0000-0000-8ac0-62f0af170c96 file: jw97012001001_02101_00001_guider1_uncal.jpg
163+
artifactid: 00000000-0000-0000-8d00-ec105bf49e9e file: jw97012001001_02101_00001_guider1_cal.jpg
164+
artifactid: 00000000-0000-0000-9c58-5d15fd353a73 file: jw97012001001_02101_00001_guider1_cal.fits
165+
artifactid: 00000000-0000-0000-8424-8a9bc0f8301c file: jw97012001001_02101_00001_guider1_uncal.fits
166+
167+
You can filter by product type (calibration level is also available)
164168

165169
.. code-block:: python
166170
167171
>>> from astroquery.jwst import Jwst
168-
>>> product_list = Jwst.get_product_list('00000000-0000-0000-aa9c-541cc6e5ff87', 'science')
169-
>>> print(product_list.group_by(['artifactid', 'filename']).groups.keys)
172+
>>> product_list = Jwst.get_product_list(observation_id='jw97012001001_02101_00001_guider1', product_type='science')
173+
>>> for row in result:
174+
>>> print("artifactid: %s\tfilename: %s" % (row['artifactid'].decode('UTF-8'), row['filename'].decode('UTF-8')))
170175
171-
artifactid filename
172-
------------------------------------ -----------------------------------------
173-
00000000-0000-0000-af91-b0375f07283b jw10006010001_01101_00002_nrs2_uncal.fits
176+
artifactid: 00000000-0000-0000-9c58-5d15fd353a73 file: jw97012001001_02101_00001_guider1_cal.fits
177+
artifactid: 00000000-0000-0000-8424-8a9bc0f8301c file: jw97012001001_02101_00001_guider1_uncal.fits
174178
175179
To download a data product
176180

@@ -194,6 +198,9 @@ To download a data product
194198
>>> output_file = Jwst.get_product(artifact_id='00000000-0000-0000-9335-09ff0e02f06b')
195199
>>> output_file = Jwst.get_product(file_name='jw00601004001_02102_00001_nrcb1_uncal.fits')
196200
201+
To download products by observation identifier
202+
203+
TODO
197204

198205

199206
1.4 Getting public tables

0 commit comments

Comments
 (0)