The QueryWidget
from hetdex_api.query_widget import QueryWidget
Intro to the QueryWidget Class
To initiate the QueryWidget you can do a call to the class without any optional parameters. This will open up on a predefined detectid/coordinate as an example. The widget can handle both changes to the detectid or manual changes to the input RA and DEC (in degrees). In order to load the corresponding imaging at the input coordinate you need to press the Pan to Coords button. This will take a couple seconds to load so be patient.
The QueryWidget is created using the astrowidgets interface to ginga. In many ways ginga is like ds9 providing interactive capabilities with astronomical images. If your cursor is not producing changes to the output under the image, then its not working properly. Ginga is very interactive with mouse and trackpad changes. Many of the things that took menu switches in ds9 can be done with keyboard shortcuts. See this page for a summary of changes. You should be able to pan around with your trackpad and scroll in and out with +/-. Changes in contrast and scale are also available through keyboard/mouse clicks.
https://ginga.readthedocs.io/en/stable/quickref.html#ginga-quick-reference
They can also be entered in as attributes and some examples will follow below. To learn the full extent you can read about ginga and astrowidgets here:
https://astrowidgets.readthedocs.io/ https://ginga.readthedocs.io/
How initiate the QueryWidget and grab HETDEX sources
The widget will bring up any r-band ancillary HETDEX imaging data we have around a coordinate/detectid. If there is no g-band, it will get the r-band data and if there is no r-band, it will get an image from SDSS. You can attempt to extract HETDEX spectra at any coordinate using the “Mark Sources” button. Once done selecting regions, press Stop Marking. A table of coordinates will show up below the buttons. Then you can press the Extract Object button to grab HETDEX spectra. This will extract 3” radius aperures (or change this using the aperture= “astropy unit” option). Then spectra will be retrieved from HDR1. This will take about a minute (it will speed up soon hopefully). Once the spectra is retrieved (one spectra for each separate shotid/observation of the source), they are displayed in tabs on the right hand of the widget.
QW = QueryWidget(detectid=3011595360)
The spectra table can be found as an attribute to the QueryWidget class:
if QW.spec_table is None:
print('Mark Sources, Stop Marking and Extract Objects above to extract spectra')
else:
print(QW.spec_table)
Mark Sources, Stop Marking and Extract Objects above to extract spectra
Extract on an input coordinate
Open directly on a desired coordinate:
import astropy.units as u
from astropy.coordinates import SkyCoord
coord = SkyCoord(150.025513 * u.deg, 2.087767 * u.deg, frame='icrs')
QW2 = QueryWidget(coords=coord)