Slurp public photometry and spectroscopy at an FRB position

v1 - DES
v2 - FIRST
v3 - Datalab update
v4 - WISE
v5 - Pan-STARRS

In [1]:
# imports
from matplotlib import pyplot as plt

from astropy.coordinates import SkyCoord
from astropy import units
from astropy.wcs import WCS
from astropy.table import Table

from frb.surveys import survey_utils,images

DES

Target


In [2]:
coord = SkyCoord('J214425.25-403400.81', unit=(units.hourangle, units.deg))
search_r = 10 * units.arcsec

Catalog


In [3]:
des_srvy = survey_utils.load_survey_by_name('DES', coord, search_r)
des_tbl = des_srvy.get_catalog(print_query=True)


SELECT mag_auto_g, magerr_auto_g, mag_auto_r, magerr_auto_r, mag_auto_i, magerr_auto_i, mag_auto_z, magerr_auto_z, mag_auto_y, magerr_auto_y, coadd_object_id, ra, dec, tilename
    FROM des_dr1.main
    WHERE q3c_radial_query(ra,dec,326.105208,-40.566892,0.002778)
    

In [4]:
des_tbl


Out[4]:
Table length=1
DES_gDES_g_errDES_rDES_r_errDES_iDES_i_errDES_zDES_z_errDES_YDES_Y_errDES_IDradecDES_tile
float64float64float64float64float64float64float64float64float64float64int64float64float64str12
23.99050.19443822.31050.059530420.96950.02965159999999999720.43850.039153520.2920.100701209895628326.105565-40.569421999999996DES2143-4040

Cut-out


In [5]:
cutout, cutout_hdr = des_srvy.get_cutout(search_r, band='r')

In [6]:
wcs = WCS(des_srvy.cutout_hdr)

In [7]:
plt.clf()
plt.subplot(projection=wcs)
plt.imshow(cutout, origin='lower')
plt.show()


FIRST


In [8]:
coord2 = SkyCoord('J081240.68+320809', unit=(units.hourangle, units.deg))
search_r = 10 * units.arcsec

In [9]:
first_srvy = survey_utils.load_survey_by_name('FIRST', coord2, search_r)
first_tbl = first_srvy.get_catalog()

In [10]:
first_tbl


Out[10]:
Table length=1
NAMEradecFLUX_20_CMFLUX_20_CM_ERRORINT_FLUX_20_CMSIDELOBE_PROBTWOMASS_FIRST_OFFSETTWOMASS_KMAGSEARCH_OFFSET_separation
degdegMJYMJYMJYARCSECMAGarcmin
bytes22float64float64float64float64float64float64float64float64bytes46float64
FIRST J081240.6+320808123.16951232.13569718.320.14618.400.0140.3115.310.008 (123.16950579044646,32.135827323283664)0.008202689831452928

DECals


In [11]:
dec_srvy = survey_utils.load_survey_by_name('DECaL', coord2, search_r)
dec_tbl = dec_srvy.get_catalog()


/home/sunil/Python/FRB/frb/surveys/decals.py:72: RuntimeWarning: invalid value encountered in log10
  main_cat[col] = 2.5*np.log10(1+1/main_cat[col])

In [12]:
dec_tbl


Out[12]:
Table masked=True length=2
DECaL_IDbrick_primaryDECaL_brickradecgaia_pointsourceDECaL_gDECaL_rDECaL_zDECaL_W1DECaL_W2DECaL_W3DECaL_W4DECaL_g_errDECaL_r_errDECaL_z_errDECaL_W1_errDECaL_W2_errDECaL_W3_errDECaL_W4_err
int64int64int64float64float64int64float64float64float64float64float64float64float64float64float64float64float64float64float64float64
76966146363229621507231123.16771361948432.134174062069604120.618619.53518.967220.209920.4821.3003--0.0072563608340679850.0079825686734609840.0078147399291906460.078321879810150290.214702138629814022.679314369034259--
76966146363229631507231123.16952553840432.1357157995354117.824217.419517.085117.056116.855715.526814.70150.00142142229089510320.00202161101252203070.0017291742928373410.00442489997782238850.0084199307180583860.056155699771341370.16856857361907246

WISE


In [13]:
wise_srvy = survey_utils.load_survey_by_name('WISE', coord2, 10*units.arcsec)
wise_tbl = wise_srvy.get_catalog()

In [14]:
wise_tbl


Out[14]:
Table length=1
source_idradecW1W2W3W4W1_errW2_errW3_errW4_err
str20float64float64float64float64float64float64float64float64float64float64
1235p318_ac51-042682123.16952932.13573510000000514.36900000000000213.51910.2828.1980.030.0320.0770.264

Testing


In [15]:
tmp = 'mag_auto_g,magerr_auto_g,mag_auto_r,magerr_auto_r,mag_auto_i,magerr_auto_i,mag_auto_z,magerr_auto_z,mag_auto_y,magerr_auto_y,coadd_object_id,ra,dec,tilename\n23.9905,0.194438,22.3105,0.0595304,20.9695,0.0296516,20.4385,0.0391535,20.292,0.100701,209895628,326.105565,-40.569422,DES2143-4040\n'

Pan-STARRS


In [16]:
coord3 = SkyCoord(0, 0,unit="deg")
ps_srvy = survey_utils.load_survey_by_name('Pan-STARRS',coord3,30*units.arcsec)
ps_tbl = ps_srvy.get_catalog()

In [17]:
ps_tbl


Out[17]:
Table masked=True length=1
Pan-STARRS_IDradecf_objIDQualPan-STARRS_gPan-STARRS_rPan-STARRS_iPan-STARRS_zPan-STARRS_yPan-STARRS_g_errPan-STARRS_r_errPan-STARRS_i_errPan-STARRS_z_errPan-STARRS_y_errseparation
degdegmagmagmagmagmagmagmagmagmagmagarcmin
int64float64float64int64int16float64float64float64float64float64float32float32float32float32float32float64
1079900000548164310.005490070-0.00335526043652710452--22.013921.769421.2010----0.18650.02270.0368--0.38605064131142824

In [18]:
img, = ps_srvy.get_cutout(filt="gri",imsize=30*units.arcsec)
plt = images.gen_snapshot_plt(img,imsize=30*units.arcsec,show=True)



In [19]:
fits_img = ps_srvy.get_image(imsize=30*units.arcsec)
wcsinfo = WCS(fits_img.header)
plt.subplot(projection=wcsinfo)
plt.imshow(fits_img.data, origin='lower')
plt.show()