.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_tutorials/spectra/spectrum_query.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_tutorials_spectra_spectrum_query.py: #################### Working with Spectra #################### Performing a Spectrum Query =========================== To perform a spectrum query to SDSS and plot the result: .. GENERATED FROM PYTHON SOURCE LINES 9-16 .. code-block:: Python from ATK import query sdss_query = query("spectrum", targets=587316166180416640, survey="sdss", path="example_spectrum.fits.gz") sdss_query.show(show_types=True) sdss_query.open() .. rst-class:: sphx-glr-script-out .. code-block:: none .kind (str): Spectrum .targets (list): 587316166180416640 | 141.185° 8.031° (icrs, 2016-01-01T00:00:00.000, 3.0″) .exception (bool): False .data (list): survey (str): sdss correction (str): full search_pos (astropy.SkyCoord): 141.185° 8.031° (icrs, 2017-01-01T00:00:00.000) separation (astropy.Quantity): 0.387″ exposure (astropy.Quantity): 10505.0 s wavelength (astropy.Quantity): [3803.64501953125, 3804.52197265625, ..., 9210.853515625, 9212.978515625] Å flux (astropy.Quantity): [20.667999267578125, 18.420000076293945, ..., 9.447999954223633, 10.515999794006348] 1×10⁻¹⁷ erg Å⁻¹ s⁻¹ cm⁻² survey (str): sdss correction (str): full search_pos (astropy.SkyCoord): 141.185° 8.031° (icrs, 2017-01-01T00:00:00.000) separation (astropy.Quantity): 0.422″ exposure (astropy.Quantity): 2300.3 s wavelength (astropy.Quantity): [3801.89306640625, 3802.77001953125, ..., 9212.978515625, 9215.09765625] Å flux (astropy.Quantity): [19.785999298095703, 16.702999114990234, ..., 11.475000381469727, 8.510000228881836] 1×10⁻¹⁷ erg Å⁻¹ s⁻¹ cm⁻² Available Methods: .add(), .apply(), .from_target(), .merge(), .open(), .plot(), .save(), .show(), .split(), .store() .. raw:: html
Bokeh Figure


.. GENERATED FROM PYTHON SOURCE LINES 38-53 | The returned :class:`~ATK.Models.DataSet`'s :attr:`~ATK.Models.DataSet.data` attribute is a list of :class:`~ATK.Models.Spectrum` objects (**one or multiple per target, subject to data availability**). If multiple :class:`~ATK.Models.Spectrum` objects are returned for a single target, these will be arranged in order of decreasing exposure. | .. note:: ATK supports queries to the following spectra surveys: .. include:: supported_spectrum_surveys.rst For a refresher on :func:`~ATK.Tools.query` fundamentals, see :doc:`here <../getting_started/data_query>`. For a refresher on plotting fundamentals, see :doc:`here <../images/image_query>`. If the desired survey is not listed above, see :doc:`here <../extension/external_data>` for a tutorial on utilising external data. .. GENERATED FROM PYTHON SOURCE LINES 55-60 | | | .. rubric:: Download this Tutorial .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.691 seconds) .. _sphx_glr_download_auto_tutorials_spectra_spectrum_query.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: spectrum_query.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: spectrum_query.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: spectrum_query.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_