Skip to content

Commit f39b197

Browse files
committed
Cleanup docstring examples
1 parent d4df844 commit f39b197

File tree

2 files changed

+15
-73
lines changed

2 files changed

+15
-73
lines changed

astroquery/esa/xmm_newton/core.py

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -346,17 +346,6 @@ def get_epic_spectra(self, filename, source_number, *,
346346
are described in details in the Pipeline Products Description
347347
[XMM-SOC-GEN-ICD-0024](https://xmm-tools.cosmos.esa.int/external/xmm_obs_info/odf/data/docs/XMM-SOC-GEN-ICD-0024.pdf).
348348
349-
Examples
350-
--------
351-
Extracting all bands and instruments:
352-
353-
>>> result = XMM.get_epic_spectra(tarfile,83, instrument=['M1','M2','PN'])
354-
355-
To retrieve the source spectrum of the instrument PN.
356-
(The full path of the extracted FTZ file is returned.)
357-
358-
>>> fits_image = result['PN']
359-
360349
"""
361350
_instrument = ["M1", "M2", "PN", "EP"]
362351
_product_type = ["SRSPEC", "BGSPEC", "SRCARF"]
@@ -488,32 +477,6 @@ def get_epic_images(self, filename, band=[], instrument=[],
488477
are described in details in the Pipeline Products Description
489478
[XMM-SOC-GEN-ICD-0024](https://xmm-tools.cosmos.esa.int/external/xmm_obs_info/odf/data/docs/XMM-SOC-GEN-ICD-0024.pdf).
490479
491-
Examples
492-
--------
493-
494-
Extract all bands and instruments:
495-
496-
>>> result = XMM.get_epic_images(tarfile, band=[1,2,3,4,5,8], instrument=['M1','M2','PN'])
497-
498-
To retrieve the band 3 for the instrument PN (p-n junction):
499-
500-
>>> fits_image = result[3]['PN']
501-
502-
Extract the exposure and detector maps:
503-
504-
>>> result = XMM.get_epic_images(tarfile, band=[1, 2, 3, 4, 5, 8],
505-
instrument=['M1', 'M2', 'PN'],
506-
get_detmask=True,
507-
get_exposure_map=True)
508-
509-
To retrieve exposure map in the band 3 for the instrument PN:
510-
511-
>>> fits_image = result[3]['PN_expo']
512-
513-
To retrieve the detector mask in the band 3 for the instrument PN:
514-
515-
>>> fits_image = result[3]['PN_det']
516-
517480
"""
518481

519482
_product_type = ["IMAGE_"]
@@ -664,8 +627,7 @@ def get_epic_lightcurve(self, filename, source_number, *,
664627
instrument=[], path=""):
665628
"""Extracts the EPIC sources light curve products from a given TAR file
666629
667-
For a given TAR file obtained with:
668-
XMM.download_data(OBS_ID,level="PPS",extension="FTZ",filename=tarfile)
630+
For a given TAR file obtained with ``XMMNewton.download_data``.
669631
670632
This function extracts the EPIC sources light curve products in a given
671633
instrument (or instruments) from said TAR file
@@ -701,17 +663,6 @@ def get_epic_lightcurve(self, filename, source_number, *,
701663
are described in details in the Pipeline Products Description
702664
[XMM-SOC-GEN-ICD-0024](https://xmm-tools.cosmos.esa.int/external/xmm_obs_info/odf/data/docs/XMM-SOC-GEN-ICD-0024.pdf).
703665
704-
Examples
705-
--------
706-
707-
Extracting all instruments:
708-
709-
>>> result = XMM.get_epic_lightcurve(tarfile, 146, instrument=['M1','M2', 'PN'])
710-
711-
To retrieve the light curve of the instrument PN:
712-
713-
>>> fits_image = result['PN']
714-
715666
"""
716667
_instrumnet = ["M1", "M2", "PN", "EP"]
717668
_band = [8]

astroquery/esasky/core.py

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -599,12 +599,9 @@ def query_ids_maps(self, observation_ids, *, missions=__ALL_STRING, row_limit=DE
599599
600600
Examples
601601
--------
602-
>>> query_ids_maps(observation_ids=['lbsk03vbq', 'ieag90010'], missions="HST-UV")
603-
604-
>>> query_ids_maps(observation_ids='lbsk03vbq')
605-
606-
>>> query_ids_maps(observation_ids=['lbsk03vbq', 'ieag90010', '1342221275', '1342221848'],
607-
... missions=["Herschel", "HST-UV"])
602+
query_ids_maps(observation_ids=['lbsk03vbq', 'ieag90010'], missions="HST-UV")
603+
query_ids_maps(observation_ids='lbsk03vbq')
604+
query_ids_maps(observation_ids=['lbsk03vbq', '1342221848'], missions=["Herschel", "HST-UV"])
608605
"""
609606
sanitized_observation_ids = self._sanitize_input_ids(observation_ids)
610607
sanitized_missions = self._sanitize_input_mission(missions)
@@ -655,12 +652,9 @@ def query_ids_catalogs(self, source_ids, *, catalogs=__ALL_STRING, row_limit=DEF
655652
656653
Examples
657654
--------
658-
>>> query_ids_catalogs(source_ids=['2CXO J090341.1-322609', '2CXO J090353.8-322642'], catalogs="CHANDRA-SC2")
659-
660-
>>> query_ids_catalogs(source_ids='2CXO J090341.1-322609')
661-
662-
>>> query_ids_catalogs(source_ids=['2CXO J090341.1-322609', '2CXO J090353.8-322642', '44899', '45057'],
663-
... catalogs=["CHANDRA-SC2", "Hipparcos-2"])
655+
query_ids_catalogs(source_ids=['2CXO J090341.1-322609', '2CXO J090353.8-322642'], catalogs="CHANDRA-SC2")
656+
query_ids_catalogs(source_ids='2CXO J090341.1-322609')
657+
query_ids_catalogs(source_ids=['2CXO J090341.1-322609', '45057'], catalogs=["CHANDRA-SC2", "Hipparcos-2"])
664658
"""
665659
sanitized_catalogs = self._sanitize_input_catalogs(catalogs)
666660
sanitized_row_limit = self._sanitize_input_row_limit(row_limit)
@@ -851,13 +845,11 @@ def get_images(self, *, position=None, observation_ids=None, radius=__ZERO_ARCMI
851845
852846
Examples
853847
--------
854-
>>> get_images(position="m101", radius="14'", missions="all")
848+
get_images(position="m101", radius="14'", missions="all")
855849
856-
>>> missions = ["SUZAKU", "ISO-IR", "Chandra", "XMM-OM-OPTICAL", "XMM", "XMM-OM-UV", "HST-IR", "Herschel",
857-
... "Spitzer", "HST-UV", "HST-OPTICAL"]
858-
>>> observation_ids = ["100001010", "01500403", "21171", "0852000101", "0851180201", "0851180201", "n3tr01c3q",
859-
... "1342247257", "30002561-25100", "hst_07553_3h_wfpc2_f160bw_pc", "ocli05leq"]
860-
>>> get_images(observation_ids=observation_ids, missions=missions)
850+
missions = ["SUZAKU", "ISO-IR", "Chandra", "XMM-OM-OPTICAL", "XMM", "XMM-OM-UV", "HST-IR", "Herschel", "Spitzer", "HST-UV", "HST-OPTICAL"]
851+
observation_ids = ["100001010", "01500403", "21171", "0852000101", "0851180201", "0851180201", "n3tr01c3q", "1342247257", "30002561-25100", "hst_07553_3h_wfpc2_f160bw_pc", "ocli05leq"]
852+
get_images(observation_ids=observation_ids, missions=missions)
861853
"""
862854
if position is None and observation_ids is None:
863855
raise ValueError("An input is required for either position or observation_ids.")
@@ -948,12 +940,11 @@ def get_spectra(self, *, position=None, observation_ids=None, radius=__ZERO_ARCM
948940
Examples
949941
--------
950942
951-
>>> get_spectra(position="m101", radius="14'", missions=["HST-IR", "XMM-NEWTON", "HERSCHEL"])
943+
get_spectra(position="m101", radius="14'", missions=["HST-IR", "XMM-NEWTON", "HERSCHEL"])
952944
953-
>>> missions = ["ISO-IR", "Chandra", "IUE", "XMM-NEWTON", "HST-IR", "Herschel", "HST-UV", "HST-OPTICAL"]
954-
>>> observation_ids = ["02101201", "1005", "LWR13178", "0001730201", "ibh706cqq",
955-
... "1342253595", "z1ax0102t", "oeik2s020"]
956-
>>> get_spectra(observation_ids=observation_ids, missions=missions)
945+
missions = ["ISO-IR", "Chandra", "IUE", "XMM-NEWTON", "HST-IR", "Herschel", "HST-UV", "HST-OPTICAL"]
946+
observation_ids = ["02101201", "1005", "LWR13178", "0001730201", "ibh706cqq", "1342253595", "z1ax0102t", "oeik2s020"]
947+
get_spectra(observation_ids=observation_ids, missions=missions)
957948
958949
"""
959950
if position is None and observation_ids is None:

0 commit comments

Comments
 (0)