Skip to content

Commit 293617e

Browse files
jespinosaar“Javier
authored andcommitted
download_product with type and HAP observations
1 parent 2417b16 commit 293617e

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

astroquery/esa/hubble/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ def get_hap_proposals(self, async_job=True, output_file=None,
544544
try:
545545
table = job.get_results()
546546
except Exception:
547-
raise ValueError('There are not HAP observations in this DB')
547+
raise ValueError('There are not HAP proposals in this DB')
548548
return table
549549

550550
def get_hap_publications(self, async_job=False, output_file=None,
@@ -586,7 +586,7 @@ def get_hap_publications(self, async_job=False, output_file=None,
586586
try:
587587
table = job.get_results()
588588
except Exception:
589-
raise ValueError('There are not HAP observations in this DB')
589+
raise ValueError('There are not HAP publications in this DB')
590590
return table
591591

592592
def get_tables(self, only_names=True, verbose=False):

docs/esa/hubble.rst

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,36 @@ Examples
2929
1. Getting Hubble products
3030
--------------------------
3131

32+
This function allows the user to download products based on their observation ID (mandatory) and
33+
a required calibration_level (RAW, CALIBRATED, PRODUCT or AUXILIARY) and/or product type (PRODUCT,
34+
SCIENCE_PRODUCT or POSTCARD).
35+
36+
This will download all files for the raw calibration level of the observation 'J6FL25S4Q' and it will store them in a tar called
37+
'raw_data_for_J6FL25S4Q.tar'.
38+
3239
.. code-block:: python
3340
3441
>>> from astroquery.esa.hubble import ESAHubble
3542
>>> esahubble = ESAHubble()
36-
>>> esahubble.download_product("J6FL25S4Q", "RAW", "raw_data_for_J6FL25S4Q.tar")
43+
>>> esahubble.download_product(observation_id="J6FL25S4Q", calibration_level="RAW", filename="raw_data_for_J6FL25S4Q.tar")
3744
38-
This will download all files for the raw calibration level of the
39-
observation 'J6FL25S4Q' and it will store them in a tar called
40-
'raw_data_for_J6FL25S4Q.tar'.
45+
This will download the science files associated to the observation 'J6FL25S4Q' and it will store them in a file called
46+
'science_data_for_J6FL25S4Q.tar.fits.gz', modifying the filename provided to ensure that the extension of the file is correct.
47+
48+
.. code-block:: python
49+
50+
>>> from astroquery.esa.hubble import ESAHubble
51+
>>> esahubble = ESAHubble()
52+
>>> esahubble.download_product(observation_id="J6FL25S4Q", product_type="SCIENCE_PRODUCT", filename="science_data_for_J6FL25S4Q.tar")
53+
54+
This third case will download the science files associated to the observation 'J6FL25S4Q' in raw calibration level and it will store them in a file called
55+
'science_raw_data_for_J6FL25S4Q.fits.gz', modifying the filename provided to ensure that the extension of the file is correct.
56+
57+
.. code-block:: python
58+
59+
>>> from astroquery.esa.hubble import ESAHubble
60+
>>> esahubble = ESAHubble()
61+
>>> esahubble.download_product(observation_id="J6FL25S4Q", calibration_level="RAW", product_type="SCIENCE_PRODUCT", filename="science_raw_data_for_J6FL25S4Q")
4162
4263
---------------------------
4364
2. Getting Hubble postcards

0 commit comments

Comments
 (0)