Candidate List Solution#

Ogle et al. (2016) mined the NASA/IPAC Extragalactic Database (NED) to identify a new type of galaxy: Superluminous Spiral Galaxies.

Table 1 lists the positions of these Super Spirals. Based on those positions, let’s create multiwavelength cutouts for each super spiral to see what is unique about this new class of objects.

1. Import the Python modules we’ll be using#

# Suppress unimportant warnings.
import warnings
warnings.filterwarnings("ignore", module="astropy.io.votable.*")
warnings.filterwarnings("ignore", module="pyvo.utils.xml.*")
warnings.filterwarnings('ignore', '.*RADECSYS=*', append=True)

import matplotlib.pyplot as plt
import numpy as np

# For downloading files
from astropy.utils.data import download_file

from astropy.coordinates import SkyCoord
from astropy.io import fits
from astropy.nddata import Cutout2D
import astropy.visualization as vis
from astropy.wcs import WCS
from astroquery.ipac.ned import Ned

import pyvo as vo

The next cell prepares the notebook to display our visualizations.

%matplotlib inline

2. Search NED for objects in this paper#

Insert a Code Cell below by clicking on the “Insert” Menu and choosing “Insert Cell Below”. Then consult QuickReference.md to figure out how to use astroquery to search NED for all objects in a paper, based on the refcode of the paper. Inspect the resulting astropy table.

objects_in_paper = Ned.query_refcode('2016ApJ...817..109O')
objects_in_paper.show_in_notebook()
Table length=62
idxNo.Object NameRADECTypeVelocityRedshiftRedshift FlagMagnitude and FilterSeparationReferencesNotesPhotometry PointsPositionsRedshift PointsDiameter PointsAssociations
degreesdegreeskm / sarcmin
01WISEA J001550.14-100242.33.95892-10.04511G52766.00.17601SLS17.5g--1506387100
12WISEA J003807.80-010936.79.53252-1.16024G62442.00.208284SLS18.0g--16072129100
23WISEA J040422.92-054134.861.09548-5.69303G75113.00.250549SLS18.6g--706110780
34WISEA J073806.16+282359.6114.5256828.39995G69225.00.230909SLS18.0g--1006674100
452MASX J07550424+1353261118.7677613.89065G66746.00.22264SLS18.5g--100387660
56WISEA J082655.11+181147.7126.7296918.19665G79580.00.265449SLS18.4g--80467660
672MASX J08542169+0449308133.590334.82511G47005.00.156793SLS16.7g--1805886100
78WHL J090944.8+222607137.436722.43539GClstr88683.00.295813PUN--7004500
892MASX J09094480+2226078137.436722.43538G85557.00.285388SLS19.0g--90305660
9102MASX J09260805+2405242141.5335724.09004G66672.00.222393SLS17.8g--160327960
1011WHL J092608.1+240524141.5335724.09004GClstr66284.00.2211SUN--8006700
1112WISEA J093347.77+211436.7143.4490121.24346G51620.00.172186SLS16.9g--48051201561
1213WISEA J093622.14+390628.9144.0922239.10801G84821.00.282931SLS18.5g--606673100
1314MSPM 05544146.223522.8851GClstr26738.00.08919MUN--3001100
1415CGCG 122-067146.2235122.88512G26686.00.089016SLS15.3g--34049131180
1516WISEA J094700.08+254045.8146.7503525.67938G32690.00.109043SLS15.8g--220468760
1617SDSS J095727.02+083501.7149.362598.58383G76903.00.256521SLS18.3g--80395380
1718WISEA J100356.88+382902.1150.9870338.48391G77525.00.258596SLS17.8g--80577480
1819WISEA J100416.04+295844.1151.0668329.97899G89471.00.298443SLS18.7g--706674100
1920WISEA J100956.35+261132.0152.4847526.19223G72216.00.240886SLS18.1g--130467460
2021GMBCG J152.52936+32.89139152.5293632.89139GClstr95634.00.319PUN--4002200
2122WISEA J101007.05+325329.0152.5293632.89141G86909.00.289896SLS18.7g--1006674100
22232MASS J10160396+3037481154.0165530.62998G75520.00.251906SLS18.7g--60497480
2324WISEA J102154.85+072415.5155.478567.40432G87123.00.290611SLS18.4g--60557380
2425WISEA J103015.74-010607.0157.56561-1.10198G84625.00.282277SLS18.3g--1106296100
25262MASX J10304263+0418219157.677534.30602G48244.00.160924SLS16.8g--2405986100
2627SDSS CE J160.241898-01.069106160.235-1.06611GClstr75548.00.252SUN--8005700
27282MASX J10405643-0103584160.23509-1.06632G75021.00.250242SLS18.2g--1705199100
2829WISEA J104724.97+230917.4161.8543523.15474G54729.00.182556SLS18.46--190468660
2930WISEA J111917.41+141946.5169.822614.3296G43101.00.143771SLS16.6g--2006686100
30312MASS J11292875+0255498172.369782.93055G71830.00.239599SLS17.5g--90497580
3132WISEA J113800.86+521303.8174.5036752.21775G88717.00.295927SLS19.0g--90577380
3233WISEA J114100.04+384807.4175.2502238.80207G80255.00.267701SLS18.5g--706686100
3334WISEA J115052.96+460448.1177.7207646.08006G86778.00.289461SLS18.5g--100539780
3435WISEA J115356.21+492355.4178.4841649.39881G49984.00.166728SLS17.1g--1906796100
35362MASX J11593546+1257080179.8976112.95205G79003.00.263525SLS18.3g--705464100
3637WISEA J120053.92+480007.8180.2247748.00213G83466.00.278413SLS18.4g--807075100
3738GMBCG J180.22479+48.00211180.2247948.00211GClstr74948.00.25PUN--6003400
3839WISEA J121644.33+122450.5184.1847712.41404G77030.00.256944SLS18.3g--50557380
3940WISEA J122100.50+482729.1185.2520948.45807G89836.00.299659SLS18.7g--80618380
4041WISEA J123215.19+102119.1188.0631110.35535G49729.00.165877SLS17.2g--1906696100
4142WISEA J123431.08+515629.7188.6295251.94146G88714.00.295917SLS18.1g--310641112100
4243WISEA J123746.63+481227.5189.4444848.20767G81679.00.272452SLS18.2g--806584100
4344WISEA J131039.32+223502.8197.6638522.58407G69320.00.231225SLS18.1g--120488561
4445WISEA J132757.52+334529.3201.9896933.75806G74623.00.248916SLS17.7g--16088124100
4546WISEA J134228.33+115734.5205.6180611.95954G83561.00.27873SLS19.0g--806674100
4647WISEA J134355.49+244048.1205.9812424.68001G41147.00.13725SLS17.81--2104610860
4748SDSSCGB 16827206.9983332.44039GGroup----18.44--3001000
48492MASX J13475962+3227100206.9984132.45286G66870.00.223055SLS18.1g--1105464100
4950WISEA J135546.08+025456.0208.9422.91553G71602.00.238837SLS18.7g--110517580
5051WISEA J140138.37+263527.6210.4099126.591G85128.00.283958SLS18.7g--80305440
51522MASS J14175497+2704341214.4790527.07624G47226.00.15753SLS16.9g--170256640
5253WISEA J143447.88+020228.8218.699422.04129G83914.00.279907SLS18.6g--100629580
5354WISEA J144728.35+590831.9221.8680759.14209G73602.00.245509SLS18.3g--15070118100
5455WISEA J153619.01+452247.7234.0790945.37968G70804.00.236177SLS18.1g--90577380
5556WISEA J154307.78+193751.7235.7824119.63104G68774.00.229405SLS17.0g--43150211860
5657WISEA J154950.90+234444.0237.4621623.7456G78570.00.262082SLS18.5g--70315440
5758GMBCG J240.41924+27.30444240.4192427.30444GClstr57860.00.193PUN--4002200
58592MASX J16014061+2718161240.4192427.30443G49285.00.164398SLS16.7g--2205477101
5960WISEA J163945.96+460905.8249.9414846.1517G74087.00.247128SLS18.3g--1307084100
6061WISEA J173406.17+602919.1263.5257760.48859G82730.00.275956SLS18.5g--806674100
6162SDSSCGB 59704263.5329260.48197GGroup82743.00.276SST17.20--3001100

3. Filter the NED results#

The results from NED will include galaxies, but also other kinds of objects (e.g. galaxy clusters, galaxy groups). Print the ‘Type’ column to see the full range of classifications and filter the results so that we only keep the galaxies in the list.

objects_in_paper['Type']
<MaskedColumn name='Type' dtype='object' description="NED's Preferred Object Type: G,GPair,GTrpl,GGroup,GClstr,QSO,AbLS,RadioS,IrS,EmLS,UvES,XrayS,SN" length=62>
G
G
G
G
G
G
G
GClstr
G
G
GClstr
G
...
G
G
G
G
G
G
G
GClstr
G
G
G
GGroup
# Keep only the galaxies from the list
galaxies = objects_in_paper[np.array(objects_in_paper['Type']) == 'G']

galaxies.show_in_notebook()
Table length=53
idxNo.Object NameRADECTypeVelocityRedshiftRedshift FlagMagnitude and FilterSeparationReferencesNotesPhotometry PointsPositionsRedshift PointsDiameter PointsAssociations
degreesdegreeskm / sarcmin
01WISEA J001550.14-100242.33.95892-10.04511G52766.00.17601SLS17.5g--1506387100
12WISEA J003807.80-010936.79.53252-1.16024G62442.00.208284SLS18.0g--16072129100
23WISEA J040422.92-054134.861.09548-5.69303G75113.00.250549SLS18.6g--706110780
34WISEA J073806.16+282359.6114.5256828.39995G69225.00.230909SLS18.0g--1006674100
452MASX J07550424+1353261118.7677613.89065G66746.00.22264SLS18.5g--100387660
56WISEA J082655.11+181147.7126.7296918.19665G79580.00.265449SLS18.4g--80467660
672MASX J08542169+0449308133.590334.82511G47005.00.156793SLS16.7g--1805886100
792MASX J09094480+2226078137.436722.43538G85557.00.285388SLS19.0g--90305660
8102MASX J09260805+2405242141.5335724.09004G66672.00.222393SLS17.8g--160327960
912WISEA J093347.77+211436.7143.4490121.24346G51620.00.172186SLS16.9g--48051201561
1013WISEA J093622.14+390628.9144.0922239.10801G84821.00.282931SLS18.5g--606673100
1115CGCG 122-067146.2235122.88512G26686.00.089016SLS15.3g--34049131180
1216WISEA J094700.08+254045.8146.7503525.67938G32690.00.109043SLS15.8g--220468760
1317SDSS J095727.02+083501.7149.362598.58383G76903.00.256521SLS18.3g--80395380
1418WISEA J100356.88+382902.1150.9870338.48391G77525.00.258596SLS17.8g--80577480
1519WISEA J100416.04+295844.1151.0668329.97899G89471.00.298443SLS18.7g--706674100
1620WISEA J100956.35+261132.0152.4847526.19223G72216.00.240886SLS18.1g--130467460
1722WISEA J101007.05+325329.0152.5293632.89141G86909.00.289896SLS18.7g--1006674100
18232MASS J10160396+3037481154.0165530.62998G75520.00.251906SLS18.7g--60497480
1924WISEA J102154.85+072415.5155.478567.40432G87123.00.290611SLS18.4g--60557380
2025WISEA J103015.74-010607.0157.56561-1.10198G84625.00.282277SLS18.3g--1106296100
21262MASX J10304263+0418219157.677534.30602G48244.00.160924SLS16.8g--2405986100
22282MASX J10405643-0103584160.23509-1.06632G75021.00.250242SLS18.2g--1705199100
2329WISEA J104724.97+230917.4161.8543523.15474G54729.00.182556SLS18.46--190468660
2430WISEA J111917.41+141946.5169.822614.3296G43101.00.143771SLS16.6g--2006686100
25312MASS J11292875+0255498172.369782.93055G71830.00.239599SLS17.5g--90497580
2632WISEA J113800.86+521303.8174.5036752.21775G88717.00.295927SLS19.0g--90577380
2733WISEA J114100.04+384807.4175.2502238.80207G80255.00.267701SLS18.5g--706686100
2834WISEA J115052.96+460448.1177.7207646.08006G86778.00.289461SLS18.5g--100539780
2935WISEA J115356.21+492355.4178.4841649.39881G49984.00.166728SLS17.1g--1906796100
30362MASX J11593546+1257080179.8976112.95205G79003.00.263525SLS18.3g--705464100
3137WISEA J120053.92+480007.8180.2247748.00213G83466.00.278413SLS18.4g--807075100
3239WISEA J121644.33+122450.5184.1847712.41404G77030.00.256944SLS18.3g--50557380
3340WISEA J122100.50+482729.1185.2520948.45807G89836.00.299659SLS18.7g--80618380
3441WISEA J123215.19+102119.1188.0631110.35535G49729.00.165877SLS17.2g--1906696100
3542WISEA J123431.08+515629.7188.6295251.94146G88714.00.295917SLS18.1g--310641112100
3643WISEA J123746.63+481227.5189.4444848.20767G81679.00.272452SLS18.2g--806584100
3744WISEA J131039.32+223502.8197.6638522.58407G69320.00.231225SLS18.1g--120488561
3845WISEA J132757.52+334529.3201.9896933.75806G74623.00.248916SLS17.7g--16088124100
3946WISEA J134228.33+115734.5205.6180611.95954G83561.00.27873SLS19.0g--806674100
4047WISEA J134355.49+244048.1205.9812424.68001G41147.00.13725SLS17.81--2104610860
41492MASX J13475962+3227100206.9984132.45286G66870.00.223055SLS18.1g--1105464100
4250WISEA J135546.08+025456.0208.9422.91553G71602.00.238837SLS18.7g--110517580
4351WISEA J140138.37+263527.6210.4099126.591G85128.00.283958SLS18.7g--80305440
44522MASS J14175497+2704341214.4790527.07624G47226.00.15753SLS16.9g--170256640
4553WISEA J143447.88+020228.8218.699422.04129G83914.00.279907SLS18.6g--100629580
4654WISEA J144728.35+590831.9221.8680759.14209G73602.00.245509SLS18.3g--15070118100
4755WISEA J153619.01+452247.7234.0790945.37968G70804.00.236177SLS18.1g--90577380
4856WISEA J154307.78+193751.7235.7824119.63104G68774.00.229405SLS17.0g--43150211860
4957WISEA J154950.90+234444.0237.4621623.7456G78570.00.262082SLS18.5g--70315440
50592MASX J16014061+2718161240.4192427.30443G49285.00.164398SLS16.7g--2205477101
5160WISEA J163945.96+460905.8249.9414846.1517G74087.00.247128SLS18.3g--1307084100
5261WISEA J173406.17+602919.1263.5257760.48859G82730.00.275956SLS18.5g--806674100

4. Search the NAVO Registry for image resources#

The paper selected super spirals using WISE, SDSS, and GALEX images. Search the NAVO registry for all image resources, using the ‘service_type’ search parameter. How many image resources are currently available?

image_services = vo.regsearch(servicetype='image')

print(f'{len(image_services)} result(s) found.')

image_services.to_table()['ivoid', 'short_name', 'res_title']
263 result(s) found.
Table length=263
ivoidshort_nameres_title
objectobjectobject
ivo://3crsnapshots/sia3CRSnap.sia3CRSnapshots Simple Image Access Service
ivo://archive.stsci.edu/borgBoRGBrightest of Reionizing Galaxies (BoRG)
ivo://archive.stsci.edu/ghostsGHOSTSGalaxy Halos, Outer disks, Substructure, Thick disks and Star clusters (GHOSTS)
ivo://archive.stsci.edu/sia/galexGALEXGalaxy Evolution Explorer (GALEX)
ivo://archive.stsci.edu/siap/hlaHLAHubble Legacy Archive
ivo://arvo/siapArVO SIAPArmenian Virtual Observatory SIAP
ivo://astron.nl/apertif_dr_bootes/q/cutoutDR BootesApertif DR Bootes - Mosaic
ivo://astron.nl/hetdex/lotss-dr1-img/cutoutLoTSS-DR1 CutoutLoTSS-DR1 Image Cutout Service
ivo://astron.nl/hetdex/lotss-dr1-img/imgsLoTSS-DR1 imagesLoTSS-DR1 Image Archive
ivo://astron.nl/lofartier1/q_img/cutoutLoTSS-PDR CutoutLoTSS-PDR Image Cutout Service
.........
ivo://wfau.roe.ac.uk/ukidssdr3-siapUKIDSS DR3 SIAPUKIDSS DR3 SIAP Service
ivo://wfau.roe.ac.uk/ukidssdr4-siapUKIDSS DR4 SIAPUKIDSS DR4 SIAP Service
ivo://wfau.roe.ac.uk/ukidssdr5-siapUKIDSS DR5 SIAPUKIDSS DR5 SIAP Service
ivo://wfau.roe.ac.uk/ukidssdr6-siapUKIDSS DR6 SIAPUKIDSS DR6 SIAP Service
ivo://wfau.roe.ac.uk/ukidssdr7-siapUKIDSS DR7 SIAPUKIDSS DR7 SIAP Service
ivo://wfau.roe.ac.uk/ukidssdr8-siapUKIDSS DR8 SIAPUKIDSS DR8 SIAP Service
ivo://wfau.roe.ac.uk/ukidssdr9-siapUKIDSS DR9 SIAPUKIDSS DR9 SIAP Service
ivo://wfau.roe.ac.uk/vhsdr1-siapVHS DR1 SIAPVHS DR1 SIAP Service
ivo://wfau.roe.ac.uk/vista-siapVISTA SIAPVISTA SIAP Service
ivo://xcatdb/3xmmdr7/epicsia3XMM-DR7-SIAEpic Image SIAP of the SSC Interface for the 3XMM-DR7 Catalogue

5. Search the NAVO Registry for image resources that will allow you to search for AllWISE images#

There are hundreds of image resources…too many to quickly read through. Try adding the ‘keywords’ search parameter to your registry search, and find the image resource you would need to search the AllWISE images. Remember from the Known Issues that ‘keywords’ must be a list.

allwise_image_services = vo.regsearch(servicetype='image', keywords=['allwise'])

print(f'{len(allwise_image_services)} result(s) found.')

allwise_image_services.to_table()['ivoid', 'short_name', 'res_title']
1 result(s) found.
Table length=1
ivoidshort_nameres_title
objectobjectobject
ivo://irsa.ipac/wise/images/allwise/l3aAllWISE L3aAllWISE Atlas (L3a) Coadd Images

6. Choose the AllWISE image service that you are interested in#

allwise_image_service = allwise_image_services[0]
allwise_image_service.service
<pyvo.dal.sia.SIAService at 0x7fb6d071e0e0>

7. Choose one of the galaxies in the NED list#

ra = galaxies['RA'][0]
dec = galaxies['DEC'][0]
pos = SkyCoord(ra, dec, unit = 'deg')
ra,dec
(3.95892, -10.04511)

8. Search for a list of AllWISE images that cover this galaxy#

How many images are returned? Which are you most interested in?

allwise_image_table = allwise_image_service.search(pos=pos, size=0)
allwise_image_table
<DALResultsTable length=4>
      sia_title        ...    coadd_id  
                       ...              
        object         ...     object   
---------------------- ... -------------
W1 Coadd 0046m107_ac51 ... 0046m107_ac51
W3 Coadd 0046m107_ac51 ... 0046m107_ac51
W4 Coadd 0046m107_ac51 ... 0046m107_ac51
W2 Coadd 0046m107_ac51 ... 0046m107_ac51

9. Use the .to_table() method to view the results as an Astropy table#

allwise_images = allwise_image_table.to_table()
allwise_images
Table length=4
sia_titlesia_urlcloud_accesssia_naxessia_fmtsia_rasia_decsia_naxissia_crpixsia_crvalsia_projsia_scalesia_cdsia_bp_idsia_bp_refsia_bp_hisia_bp_lomagzpmagzpuncunc_urlcov_urlcoadd_id
degdegpixdegdeg / pixdeg / pix
objectobjectobjectint32objectfloat64float64objectobjectobjectobjectobjectobjectobjectfloat64float64float64float64float64objectobjectobject
W1 Coadd 0046m107_ac51https://irsa.ipac.caltech.edu/ibe/data/wise/allwise/p3am_cdd/00/0046/0046m107_ac51/0046m107_ac51-w1-int-3.fits{"aws": {"bucket_name": "nasa-irsa-wise", "key":"wise/allwise/images/p3am_cdd/00/0046/0046m107_ac51/0046m107_ac51-w1-int-3.fits", "region": "us-west-2"}}2image/fits4.61538-10.601111[4095 4095][2048.0 2048.0][4.61538 -10.601111]SIN[-0.0003819444391411 0.0003819444391411][-0.0003819444391411 -0.0 -0.0 0.0003819444391411]W13.35e-063.78e-063.13e-0620.50.006https://irsa.ipac.caltech.edu/ibe/data/wise/allwise/p3am_cdd/00/0046/0046m107_ac51/0046m107_ac51-w1-unc-3.fits.gzhttps://irsa.ipac.caltech.edu/ibe/data/wise/allwise/p3am_cdd/00/0046/0046m107_ac51/0046m107_ac51-w1-cov-3.fits.gz0046m107_ac51
W3 Coadd 0046m107_ac51https://irsa.ipac.caltech.edu/ibe/data/wise/allwise/p3am_cdd/00/0046/0046m107_ac51/0046m107_ac51-w3-int-3.fits{"aws": {"bucket_name": "nasa-irsa-wise", "key":"wise/allwise/images/p3am_cdd/00/0046/0046m107_ac51/0046m107_ac51-w3-int-3.fits", "region": "us-west-2"}}2image/fits4.61538-10.601111[4095 4095][2048.0 2048.0][4.61538 -10.601111]SIN[-0.0003819444391411 0.0003819444391411][-0.0003819444391411 -0.0 -0.0 0.0003819444391411]W31.156e-051.627e-057.6e-0618.00.012https://irsa.ipac.caltech.edu/ibe/data/wise/allwise/p3am_cdd/00/0046/0046m107_ac51/0046m107_ac51-w3-unc-3.fits.gzhttps://irsa.ipac.caltech.edu/ibe/data/wise/allwise/p3am_cdd/00/0046/0046m107_ac51/0046m107_ac51-w3-cov-3.fits.gz0046m107_ac51
W4 Coadd 0046m107_ac51https://irsa.ipac.caltech.edu/ibe/data/wise/allwise/p3am_cdd/00/0046/0046m107_ac51/0046m107_ac51-w4-int-3.fits{"aws": {"bucket_name": "nasa-irsa-wise", "key":"wise/allwise/images/p3am_cdd/00/0046/0046m107_ac51/0046m107_ac51-w4-int-3.fits", "region": "us-west-2"}}2image/fits4.61538-10.601111[4095 4095][2048.0 2048.0][4.61538 -10.601111]SIN[-0.0003819444391411 0.0003819444391411][-0.0003819444391411 -0.0 -0.0 0.0003819444391411]W42.209e-052.336e-051.984e-0513.00.012https://irsa.ipac.caltech.edu/ibe/data/wise/allwise/p3am_cdd/00/0046/0046m107_ac51/0046m107_ac51-w4-unc-3.fits.gzhttps://irsa.ipac.caltech.edu/ibe/data/wise/allwise/p3am_cdd/00/0046/0046m107_ac51/0046m107_ac51-w4-cov-3.fits.gz0046m107_ac51
W2 Coadd 0046m107_ac51https://irsa.ipac.caltech.edu/ibe/data/wise/allwise/p3am_cdd/00/0046/0046m107_ac51/0046m107_ac51-w2-int-3.fits{"aws": {"bucket_name": "nasa-irsa-wise", "key":"wise/allwise/images/p3am_cdd/00/0046/0046m107_ac51/0046m107_ac51-w2-int-3.fits", "region": "us-west-2"}}2image/fits4.61538-10.601111[4095 4095][2048.0 2048.0][4.61538 -10.601111]SIN[-0.0003819444391411 0.0003819444391411][-0.0003819444391411 -0.0 -0.0 0.0003819444391411]W24.6e-065.19e-064.02e-0619.50.007https://irsa.ipac.caltech.edu/ibe/data/wise/allwise/p3am_cdd/00/0046/0046m107_ac51/0046m107_ac51-w2-unc-3.fits.gzhttps://irsa.ipac.caltech.edu/ibe/data/wise/allwise/p3am_cdd/00/0046/0046m107_ac51/0046m107_ac51-w2-cov-3.fits.gz0046m107_ac51

10. From the result in 8., select the first record for an image taken in WISE band W1 (3.6 micron)#

Hints:

  • Loop over records and test on the .bandpass_id attribute of each record

  • Print the .title and .bandpass_id of the record you find, to verify it is the right one.

for allwise_image_record in allwise_image_table:
    if 'W1' in allwise_image_record.bandpass_id:
        break
print(allwise_image_record.title, allwise_image_record.bandpass_id)
W1 Coadd 0046m107_ac51 W1

11. Visualize this AllWISE image#

## If you only run this once, you can do it in memory in one line:
##  This fetches the FITS as an astropy.io.fits object in memory
#allwise_w1_image = allwise_image_record.getdataobj()
## But if you might run this notebook repeatedly with limited bandwidth,
##  download it once and cache it.
file_name = download_file(allwise_image_record.getdataurl(), cache=True)
allwise_w1_image = fits.open(file_name)
fig = plt.figure()

wcs = WCS(allwise_w1_image[0].header)
ax = fig.add_subplot(1, 1, 1, projection=wcs)
ax.imshow(allwise_w1_image[0].data, cmap='gray_r', origin='lower', vmax = 10)
ax.scatter(ra, dec, transform=ax.get_transform('fk5'), s=500, edgecolor='red', facecolor='none')
<matplotlib.collections.PathCollection at 0x7fb6cfdc1900>
../../_images/88926761088696a84a5443fc969b1499cae72c2355b10eaaed4b1aa481ff7431.png

12. Plot a cutout of the AllWISE image, centered on your position#

Try a 60 arcsecond cutout.

size = 60
cutout = Cutout2D(allwise_w1_image[0].data, pos, (size, size), wcs=wcs)
wcs = cutout.wcs

fig = plt.figure()

ax = fig.add_subplot(1, 1, 1, projection=wcs)
ax.imshow(cutout.data, cmap='gray_r', origin='lower', vmax = 10)
ax.scatter(ra, dec, transform=ax.get_transform('fk5'), s=500, edgecolor='red', facecolor='none')
<matplotlib.collections.PathCollection at 0x7fb6c7bc04f0>
../../_images/7f7768c40ab8e6c435cff1790189f87b0d5c2c11b0c772dea86aa59fab9a4ef3.png

13. Try visualizing a cutout of a GALEX image that covers your position#

Repeat steps 4, 5, 6, 8 through 12 for GALEX.

galex_image_services = vo.regsearch(keywords=['galex'], servicetype='image')
print(f'{len(galex_image_services)} result(s) found.')
galex_image_services.to_table()['ivoid', 'short_name', 'res_title']
3 result(s) found.
Table length=3
ivoidshort_nameres_title
objectobjectobject
ivo://archive.stsci.edu/sia/galexGALEXGalaxy Evolution Explorer (GALEX)
ivo://mast.stsci/siap/galex_atlasGALEX_AtlasGALEX Atlas of Nearby Galaxies
ivo://nasa.heasarc/skyview/galexGALEXGalaxy Explorer All Sky Survey: Near UV
galex_image_service = galex_image_services[0]
galex_image_table = galex_image_service.search(pos=pos, size=0.0, intersect='covers')
for i in range(len(galex_image_table)):
    if (('image/fits' in galex_image_table[i].format) and
        (galex_image_table['energy_bounds_center'][i]==2.35e-07) and
        (galex_image_table[i]['productType'] == 'SCIENCE')):
        break
galex_image_record = galex_image_table[i]
print(galex_image_record.title, galex_image_record.bandpass_id)
AIS_270_sg14-nd-int.fits.gz NUV
## See above regarding two ways to do this:
#galex_nuv_image = fits.open(galex_image_record.getdataurl())
file_name = download_file(galex_image_record.getdataurl(), cache=True)
galex_nuv_image=fits.open(file_name)
image_data = galex_nuv_image[0].data
print('Min:', np.min(image_data))
print('Max:', np.max(image_data))
print('Mean:', np.mean(image_data))
print('Stdev:', np.std(image_data))
Min: 0.0
Max: 7.1870303
Mean: 0.0014934327
Stdev: 0.012639926
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1, projection=WCS(galex_nuv_image[0].header))
ax.imshow(galex_nuv_image[0].data, cmap='gray_r', origin='lower', vmin=0.0, vmax=0.01)
ax.scatter(ra, dec, transform=ax.get_transform('fk5'), s=500, edgecolor='red', facecolor='none')
<matplotlib.collections.PathCollection at 0x7fb6c49af220>
../../_images/dbeadc26e4c82dd94a33fe2e09bc5481c33e61416f2df56d08cdaefb0d337bf6.png
cutout = Cutout2D(galex_nuv_image[0].data, pos, size, wcs=WCS(galex_nuv_image[0].header))

fig = plt.figure()

ax = fig.add_subplot(1, 1, 1, projection=cutout.wcs)
ax.imshow(cutout.data, cmap='gray_r', origin='lower', vmin = 0.0, vmax = 0.01)
ax.scatter(ra, dec, transform=ax.get_transform('fk5'), s=500, edgecolor='red', facecolor='none')
<matplotlib.collections.PathCollection at 0x7fb6c7bc39a0>
../../_images/37910653d03212071d306b83905f5bde1837fc089353551935006ec543ae4fa3.png

14. Try visualizing a cutout of an SDSS image that covers your position#

Hints:

  • Search the registry using `keywords=[‘sloan’]

  • Find the service with a short_name of 'SDSS SIAP'

  • After obtaining your search results, select r-band images using the .title attribute of the records that are returned, since .bandpass_id is not populated.

sdss_image_services = vo.regsearch(keywords=['sloan'], servicetype='image')
sdss_image_services.to_table()['ivoid', 'short_name', 'res_title', 'source_value']
Table length=21
ivoidshort_nameres_titlesource_value
objectobjectobjectobject
ivo://mast.stsci/siap/al218VLA.AL218VLA-A Array AL218 Texas Survey Source Snapshots (AL218)
ivo://mast.stsci/siap/vla-firstVLA-FIRSTVLA Faint Images of the Radio Sky at Twenty Centimeters (FIRST)
ivo://nasa.heasarc/skyview/sdssSDSSSloan Digital Sky Survey g-band
ivo://nasa.heasarc/skyview/sdssdr7SDSSDR7Sloan Digital Sky Survey g-band DR7
ivo://nasa.heasarc/skyview/stripe82vlaStripe82VLAVLA Survey of SDSS Stripe 82
ivo://org.gavo.dc/bgds/q/siabgds siaBochum Galactic Disk Survey (BGDS) images2015AN....336..590H
ivo://sdss.jhu/services/siap-imagesSDSS SIAPSloan Digital Sky Survey Images (Latest Release)
ivo://sdss.jhu/services/siapdr1-imagesSDSSDR1Sloan Digital Sky Survey DR1 - Images
ivo://sdss.jhu/services/siapdr2-imagesSDSSDR2Sloan Digital Sky Survey DR2 - Images
ivo://sdss.jhu/services/siapdr3-colorSDSSDR3-ColorSloan Digital Sky Survey DR3
ivo://sdss.jhu/services/siapdr3-gSDSSDR3-GSloan Digital Sky Survey DR3 - Filter g
ivo://sdss.jhu/services/siapdr3-iSDSSDR3-ISloan Digital Sky Survey DR3 - Filter i
ivo://sdss.jhu/services/siapdr3-rSDSSDR3-RSloan Digital Sky Survey DR3 - Filter r
ivo://sdss.jhu/services/siapdr3-uSDSSDR3-USloan Digital Sky Survey DR3 - Filter u
ivo://sdss.jhu/services/siapdr3-zSDSSDR3-ZSloan Digital Sky Survey DR3 - Filter z
ivo://sdss.jhu/services/siapdr4-colorSDSSDR4-ColorSloan Digital Sky Survey DR4
ivo://sdss.jhu/services/siapdr4-imagesSDSSDR4Sloan Digital Sky Survey DR4 - Images
ivo://sdss.jhu/services/siapdr5-imagesSDSSDR5Sloan Digital Sky Survey DR5 - Images
ivo://sdss.jhu/services/siapdr7-imagesSDSSDR7Sloan Digital Sky Survey DR7 - Images
ivo://sdss.jhu/services/siapdr8-imagesSDSSDR8Sloan Digital Sky Survey DR8 - Images
ivo://sdss.jhu/services/siapdr9-imagesSDSSDR9Sloan Digital Sky Survey DR9 - Images
#  Use list comprehension to check each service's short_name attribute.
#   Given the above, we know the first match is the right one.
sdss_image_service = [s for s in sdss_image_services if 'SDSS SIAP' in s.short_name ][0]
sdss_image_service.short_name
'SDSS SIAP'
sdss_image_table = sdss_image_service.search(pos=pos, size=0.0)
len(sdss_image_table['Title'])
60
for sdss_rband_record in sdss_image_table:
    if 'Sloan Digital Sky Survey - Filter r' in sdss_rband_record.title:
        break
print(sdss_rband_record.title, sdss_rband_record.bandpass_id)
Sloan Digital Sky Survey - Filter r None
##  See above regarding two ways to do this
# sdss_rband_image = fits.open(sdss_rband_record.getdataurl())
file_name = download_file(sdss_rband_record.getdataurl(), cache=True)
sdss_rband_image=fits.open(file_name)
fig = plt.figure()

ax = fig.add_subplot(1, 1, 1, projection=WCS(sdss_rband_image[0].header))

interval = vis.PercentileInterval(99.9)
vmin,vmax = interval.get_limits(sdss_rband_image[0].data)
norm = vis.ImageNormalize(vmin=vmin, vmax=vmax, stretch=vis.LogStretch(1000))
ax.imshow(sdss_rband_image[0].data, cmap = 'gray_r', norm = norm, origin = 'lower')
ax.scatter(ra, dec, transform=ax.get_transform('fk5'), s=500, edgecolor='red', facecolor='none')
WARNING: FITSFixedWarning: 'datfix' made the change 'Set MJD-OBS to 54007.000000 from DATE-OBS'. [astropy.wcs.wcs]
<matplotlib.collections.PathCollection at 0x7fb6c4740070>
../../_images/22ac5111c66af718cd6f344643a56ab61cc64a582ce930dd152a50a3c4210738.png
cutout = Cutout2D(sdss_rband_image[0].data, pos, size, wcs=WCS(sdss_rband_image[0].header))
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1, projection=cutout.wcs)
vmin,vmax = interval.get_limits(sdss_rband_image[0].data)
norm = vis.ImageNormalize(vmin=vmin, vmax=vmax, stretch=vis.LogStretch(1000))
ax.imshow(cutout.data, cmap = 'gray_r', norm = norm, origin = 'lower')
ax.scatter(ra, dec, transform=ax.get_transform('fk5'), s=500, edgecolor='red', facecolor='none')
WARNING: FITSFixedWarning: 'datfix' made the change 'Set MJD-OBS to 54007.000000 from DATE-OBS'. [astropy.wcs.wcs]
<matplotlib.collections.PathCollection at 0x7fb6c47a7280>
../../_images/92f706abac1dc55aadb8bd6474f78cc5b08f3fabbe6e50329d6e4ff52dd36dc1.png

15. Try looping over all positions and plotting multiwavelength cutouts#

Warning: this cell takes a long time to run! We limit it to the first three galaxies only.

# Pick the first 3 galaxies.
galaxy_subset = galaxies[0:3]

# For each galaxy,
for galaxy in galaxy_subset:

    # Establish the position.
    ra = galaxy['RA']
    dec = galaxy['DEC']
    pos = SkyCoord(ra, dec, unit = 'deg')

    # Set up the plot for this position.
    fig = plt.figure(figsize=(20,6))
    plt.suptitle('POSITION = ' + str(ra) + ', ' + str(dec), fontsize=16)

    # GALEX

    # Find the GALEX images that overlap the position.
    galex_image_table = galex_image_service.search(pos=pos, size=0.25)

    # Find the GALEX All-Sky Image Survey (AIS) Near-UV FITS coadd.
    galex_image_record = None
    for record in galex_image_table:
        if (('image/fits' in record.format) and
            (record['energy_bounds_center'] == 2.35e-07) and
            (record['productType'] == 'SCIENCE')):
            galex_image_record = record
            break

    if galex_image_record is not None:
        # Create a cutout.
        file_name = download_file(galex_image_record.getdataurl(), cache=True)
        gimage = fits.open(file_name)
        galex_cutout = Cutout2D(gimage[0].data, pos, size, wcs=WCS(gimage[0].header))

        # Plot the cutout in the first position of a 1x3 (rowsxcols) grid.
        ax = fig.add_subplot(1, 3, 1, projection=galex_cutout.wcs)
        ax.set_title(galex_image_record.title)
        ax.imshow(galex_cutout.data, cmap='gray_r', origin='lower', vmin = 0.0, vmax = 0.01)
        ax.scatter(ra, dec, transform=ax.get_transform('fk5'), s=500, edgecolor='red', facecolor='none')
    else:
        # We didn't find a suitable image, so leave that subplot blank.
        ax = fig.add_subplot(1, 3, 1, projection=galex_cutout.wcs)
        ax.set_title('GALEX image not found')

    # SDSS

    # Find the SDSS images that overlap the position.
    sdss_image_table = sdss_image_service.search(pos=pos, size=0)

    # Find the first SDSS r-band image.
    sdss_rband_record = None
    for record in sdss_image_table:
        if 'Sloan Digital Sky Survey - Filter r' in record.title:
            sdss_rband_record = record
            break

    if sdss_rband_record is not None:
        # Create a cutout.
        file_name = download_file(sdss_rband_record.getdataurl(), cache=True)
        sdss_rband_image=fits.open(file_name)

        sdss_cutout = Cutout2D(sdss_rband_image[0].data, pos, size,
                               wcs=WCS(sdss_rband_image[0].header))

        # Plot the cutout in the second position of a 1x3 grid.
        vmin,vmax = interval.get_limits(sdss_cutout.data)
        norm = vis.ImageNormalize(vmin=vmin, vmax=vmax, stretch=vis.LogStretch(1000))
        ax = fig.add_subplot(1, 3, 2, projection=sdss_cutout.wcs)
        ax.imshow(sdss_cutout.data, cmap = 'gray_r', norm = norm, origin = 'lower')
        ax.scatter(ra, dec, transform=ax.get_transform('fk5'), s=500, edgecolor='red', facecolor='none')
        ax.set_title(sdss_rband_record.title)
    else:
        # We didn't find a suitable image, so leave that subplot blank.
        ax = fig.add_subplot(1, 3, 2, projection=galex_cutout.wcs)
        ax.set_title('SDSS rband image not found')

    # AllWISE

    # Find the AllWISE images that overlap the position.
    allwise_image_table = allwise_image_service.search(pos=pos, size=0)

    # Find the first AllWISE W1 channel image.
    allwise_image_record = None
    for record in allwise_image_table:
        if 'W1' in record.bandpass_id:
            allwise_image_record = record
            break

    if allwise_image_record is not None:
        # Create a cutout.
        file_name = download_file(allwise_image_record.getdataurl(), cache=True)
        allwise_w1_image=fits.open(file_name)

        allwise_cutout = Cutout2D(allwise_w1_image[0].data, pos, (size, size),
                                  wcs=WCS(allwise_w1_image[0].header))

        # Plot the cutout in the third position of a 1x3 grid.
        ax = fig.add_subplot(1, 3, 3, projection=allwise_cutout.wcs)
        ax.imshow(allwise_cutout.data, cmap='gray_r', origin='lower', vmax = 10)
        ax.scatter(ra, dec, transform=ax.get_transform('fk5'), s=500, edgecolor='red', facecolor='none')
        ax.set_title(allwise_image_record.title)
    else:
        # We didn't find a suitable image, so leave that subplot blank.
        ax = fig.add_subplot(1, 3, 3, projection=galex_cutout.wcs)
        ax.set_title('AllWISE W1 image not found')
WARNING: FITSFixedWarning: 'datfix' made the change 'Set MJD-OBS to 54007.000000 from DATE-OBS'. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: 'datfix' made the change 'Set MJD-OBS to 54424.000000 from DATE-OBS'. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: 'datfix' made the change 'Set MJD-OBS to 51465.000000 from DATE-OBS'. [astropy.wcs.wcs]
../../_images/0295e5af704deb4898f9c1d3b5e2af602858f483975397c7ce87cae163581123.png ../../_images/890e6d9138472f492319fae5d24e370b5388a454b2190121385e12b94120bac5.png ../../_images/9a23ad48383bf3f9c15bd11f56e2761a02e0392bdc649d380834693d7a2ae084.png