In [1]:
%autosave 60
%matplotlib inline
Autosaving every 60 seconds
In [2]:
import matplotlib.pyplot as plt
import numpy as np
In [3]:
import astropy
In [4]:
import astropy.units as u
import astropy.constants as c
In [5]:
c.M_sun
Out[5]:
$1.9884099 \times 10^{30} \; \mathrm{kg}$
In [11]:
SOLLAR_MASS = c.M_sun.to_value('g')
type(SOLLAR_MASS), SOLLAR_MASS
Out[11]:
(numpy.float64, 1.988409870698051e+33)
In [10]:
type(c.M_sun.cgs)
Out[10]:
astropy.units.quantity.Quantity
In [14]:
c.M_sun.cgs.value, c.M_sun.cgs.unitt
Out[14]:
(1.988409870698051e+33, Unit("g"))
In [17]:
c.G.cgs.value
Out[17]:
6.674299999999999e-08
In [20]:
x = 1 * u.km
x.to('au')
Out[20]:
$6.6845871 \times 10^{-9} \; \mathrm{AU}$
In [21]:
x_val = x.to_value('pc')
type(x_val), x_val
Out[21]:
(numpy.float64, 3.240779289469756e-14)
In [27]:
x = 10 * u.km
t = 1 * u.hour
v = x / t
v = v.to(u.cm / u.s)
v + 1 * u.mau / (10 * u.year)  # не используйте mau
Out[27]:
$325.18248 \; \mathrm{\frac{cm}{s}}$
In [30]:
(1 * u.kau).to(u.km)
Out[30]:
$1.4959787 \times 10^{11} \; \mathrm{km}$
In [31]:
(10 * u.mpc).to(u.pc)
Out[31]:
$0.01 \; \mathrm{pc}$
In [32]:
10 * u.km + 7 * u.kg
---------------------------------------------------------------------------
UnitConversionError                       Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/astropy/units/quantity_helper/helpers.py in get_converter(from_unit, to_unit)
     31     try:
---> 32         scale = from_unit._to(to_unit)
     33     except UnitsError:

/opt/conda/lib/python3.7/site-packages/astropy/units/core.py in _to(self, other)
    950         raise UnitConversionError(
--> 951             f"'{self!r}' is not a scaled version of '{other!r}'")
    952 

UnitConversionError: 'Unit("kg")' is not a scaled version of 'Unit("km")'

During handling of the above exception, another exception occurred:

UnitConversionError                       Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/astropy/units/quantity_helper/helpers.py in get_converters_and_unit(f, unit1, unit2)
     76         try:
---> 77             converters[changeable] = get_converter(unit2, unit1)
     78         except UnitsError:

/opt/conda/lib/python3.7/site-packages/astropy/units/quantity_helper/helpers.py in get_converter(from_unit, to_unit)
     34         return from_unit._apply_equivalencies(
---> 35                 from_unit, to_unit, get_current_unit_registry().equivalencies)
     36     except AttributeError:

/opt/conda/lib/python3.7/site-packages/astropy/units/core.py in _apply_equivalencies(self, unit, other, equivalencies)
    887             "{} and {} are not convertible".format(
--> 888                 unit_str, other_str))
    889 

UnitConversionError: 'kg' (mass) and 'km' (length) are not convertible

During handling of the above exception, another exception occurred:

UnitConversionError                       Traceback (most recent call last)
<ipython-input-32-0f8a4a22e0d4> in <module>
----> 1 10 * u.km + 7 * u.kg

/opt/conda/lib/python3.7/site-packages/astropy/units/quantity.py in __array_ufunc__(self, function, method, *inputs, **kwargs)
    459         # consistent units between two inputs (e.g., in np.add) --
    460         # and the unit of the result (or tuple of units for nout > 1).
--> 461         converters, unit = converters_and_unit(function, method, *inputs)
    462 
    463         out = kwargs.get('out', None)

/opt/conda/lib/python3.7/site-packages/astropy/units/quantity_helper/converters.py in converters_and_unit(function, method, *args)
    164 
    165         # Determine possible conversion functions, and the result unit.
--> 166         converters, result_unit = ufunc_helper(function, *units)
    167 
    168         if any(converter is False for converter in converters):

/opt/conda/lib/python3.7/site-packages/astropy/units/quantity_helper/helpers.py in get_converters_and_unit(f, unit1, unit2)
     80                 "Can only apply '{}' function to quantities "
     81                 "with compatible dimensions"
---> 82                 .format(f.__name__))
     83 
     84         return converters, unit1

UnitConversionError: Can only apply 'add' function to quantities with compatible dimensions
In [33]:
v = 2 * np.pi * (1.0 * u.au) / (1.0 * u.year)
v.to(u.km / u.s)
Out[33]:
$29.785254 \; \mathrm{\frac{km}{s}}$
In [35]:
v = np.sqrt(c.G * c.M_sun / c.au)
v.to(u.km / u.s)
Out[35]:
$29.784692 \; \mathrm{\frac{km}{s}}$
In [39]:
x = (10 * u.kg) / (0.1 * u.M_jup)
print(x.to(u.dimensionless_unscaled))
np.exp(x)
5.268358048799662e-26
Out[39]:
$1 \; \mathrm{}$
In [41]:
a = (10 * u.g) ** (1 / 3)  # не делайте так
a
Out[41]:
$2.1544347 \; \mathrm{g^{1/3}}$
In [45]:
(10 * u.g) ** (2 / 7 + 1 / 15)  # так тем более
Out[45]:
$2.2510283 \; \mathrm{g^{0.35238095238095235}}$
In [47]:
from fractions import Fraction as Fr
In [48]:
Fr(2, 7) + Fr(1, 15)
Out[48]:
Fraction(37, 105)
In [49]:
(10 * u.g) ** (Fr(2, 7) + Fr(1, 15))
Out[49]:
$2.2510283 \; \mathrm{g^{37/105}}$
In [52]:
np.cos(100 * u.arcmin)
Out[52]:
$0.99957695 \; \mathrm{}$
In [57]:
delta_m = 1 * u.mag
mAB = 10 * u.ABmag
display(mAB.physical.to(u.erg / u.s / u.cm**2 / u.Hz))
m = mAB + delta_m
display(m.physical.to(u.erg / u.s / u.cm**2 / u.Hz))
$3.6307805 \times 10^{-24} \; \mathrm{\frac{erg}{Hz\,s\,cm^{2}}}$
$1.4454398 \times 10^{-24} \; \mathrm{\frac{erg}{Hz\,s\,cm^{2}}}$
In [61]:
m1 = u.Magnitude(10 * u.count / u.s)
m2 = u.Magnitude(1e4 * u.count / u.hour)
dm = (m1 - m2).decompose()
dm, dm.unit, dm.value
Out[61]:
(<Magnitude -1.39075625 mag>, Unit("mag(1)"), -1.3907562519182182)
In [63]:
a = np.arange(10) * u.cm
a
Out[63]:
$[0,~1,~2,~3,~4,~5,~6,~7,~8,~9] \; \mathrm{cm}$
In [62]:
from astropy import coordinates as coord
In [64]:
coord.SkyCoord('01h23m45.6s -05d23m17s')
Out[64]:
<SkyCoord (ICRS): (ra, dec) in deg
    (20.94, -5.38805556)>
In [67]:
coord.SkyCoord(ra=10 * u.deg + 30 * u.arcmin, dec=-10 * u.deg - 30 * u.arcmin)
Out[67]:
<SkyCoord (ICRS): (ra, dec) in deg
    (10.5, -10.5)>
In [69]:
coord.SkyCoord(ra=[1, 2, 3], dec=[5, 4, 3], unit=u.deg)
Out[69]:
<SkyCoord (ICRS): (ra, dec) in deg
    [(1., 5.), (2., 4.), (3., 3.)]>
In [75]:
coord.SkyCoord(ra=[1, 2, 3], dec=[5, 4, 3], unit=['h', 'deg'])
Out[75]:
<SkyCoord (ICRS): (ra, dec) in deg
    [(15., 5.), (30., 4.), (45., 3.)]>
In [77]:
coord.SkyCoord(l=5*u.deg, b=10*u.deg, frame='galactic')
Out[77]:
<SkyCoord (Galactic): (l, b) in deg
    (5., 10.)>
In [80]:
c = coord.SkyCoord('01h23m45.6s -05d23m17s')
c.galactic, c.ra, c.dec
Out[80]:
(<SkyCoord (Galactic): (l, b) in deg
     (143.86243489, -66.93715664)>,
 <Longitude 20.94 deg>,
 <Latitude -5.38805556 deg>)
In [81]:
from astropy.time import Time
In [82]:
t = Time.now() - np.arange(5) * u.hour
t
Out[82]:
<Time object: scale='utc' format='datetime' value=[datetime.datetime(2020, 11, 23, 13, 1, 24, 237140)
 datetime.datetime(2020, 11, 23, 12, 1, 24, 237140)
 datetime.datetime(2020, 11, 23, 11, 1, 24, 237140)
 datetime.datetime(2020, 11, 23, 10, 1, 24, 237140)
 datetime.datetime(2020, 11, 23, 9, 1, 24, 237140)]>
In [83]:
loc = coord.EarthLocation.of_site('subaru')
In [85]:
loc.height
Out[85]:
$4139 \; \mathrm{m}$
In [86]:
loc.geodetic
Out[86]:
GeodeticLocation(lon=<Longitude -155.47611111 deg>, lat=<Latitude 19.82555556 deg>, height=<Quantity 4139. m>)
In [88]:
alt_az_frame = coord.AltAz(obstime=t, location=loc)
In [89]:
alt_az_frame
Out[89]:
<AltAz Frame (obstime=[datetime.datetime(2020, 11, 23, 13, 1, 24, 237140)
 datetime.datetime(2020, 11, 23, 12, 1, 24, 237140)
 datetime.datetime(2020, 11, 23, 11, 1, 24, 237140)
 datetime.datetime(2020, 11, 23, 10, 1, 24, 237140)
 datetime.datetime(2020, 11, 23, 9, 1, 24, 237140)], location=(-5464468.1097167, -2493053.65044845, 2150943.60508102) m, pressure=0.0 hPa, temperature=0.0 deg_C, relative_humidity=0.0, obswl=1.0 micron)>
In [100]:
from astropy import visualization

display(c)
c.transform_to(alt_az_frame)
dt = np.arange(24) * u.hour
t = Time.now() + dt
moon = coord.get_moon(t)
display(moon)
alt_az_frame = coord.AltAz(obstime=t, location=loc)
moon_subaru = moon.transform_to(alt_az_frame)

with visualization.quantity_support():
    plt.plot(dt, moon_subaru.alt.to(u.deg), 'x')
<SkyCoord (ICRS): (ra, dec) in deg
    (20.94, -5.38805556)>
<SkyCoord (GCRS: obstime=[datetime.datetime(2020, 11, 23, 13, 9, 17, 801943)
 datetime.datetime(2020, 11, 23, 14, 9, 17, 801943)
 datetime.datetime(2020, 11, 23, 15, 9, 17, 801943)
 datetime.datetime(2020, 11, 23, 16, 9, 17, 801943)
 datetime.datetime(2020, 11, 23, 17, 9, 17, 801943)
 datetime.datetime(2020, 11, 23, 18, 9, 17, 801943)
 datetime.datetime(2020, 11, 23, 19, 9, 17, 801943)
 datetime.datetime(2020, 11, 23, 20, 9, 17, 801943)
 datetime.datetime(2020, 11, 23, 21, 9, 17, 801943)
 datetime.datetime(2020, 11, 23, 22, 9, 17, 801943)
 datetime.datetime(2020, 11, 23, 23, 9, 17, 801943)
 datetime.datetime(2020, 11, 24, 0, 9, 17, 801943)
 datetime.datetime(2020, 11, 24, 1, 9, 17, 801943)
 datetime.datetime(2020, 11, 24, 2, 9, 17, 801943)
 datetime.datetime(2020, 11, 24, 3, 9, 17, 801943)
 datetime.datetime(2020, 11, 24, 4, 9, 17, 801943)
 datetime.datetime(2020, 11, 24, 5, 9, 17, 801943)
 datetime.datetime(2020, 11, 24, 6, 9, 17, 801943)
 datetime.datetime(2020, 11, 24, 7, 9, 17, 801943)
 datetime.datetime(2020, 11, 24, 8, 9, 17, 801943)
 datetime.datetime(2020, 11, 24, 9, 9, 17, 801943)
 datetime.datetime(2020, 11, 24, 10, 9, 17, 801943)
 datetime.datetime(2020, 11, 24, 11, 9, 17, 801943)
 datetime.datetime(2020, 11, 24, 12, 9, 17, 801943)], obsgeoloc=(0., 0., 0.) m, obsgeovel=(0., 0., 0.) m / s): (ra, dec, distance) in (deg, deg, km)
    [(3.49823266e+02, -10.09038805, 399732.00810116),
     (3.50294922e+02,  -9.89415917, 399884.3200768 ),
     (3.50765679e+02,  -9.69741299, 400034.71670068),
     (3.51235554e+02,  -9.50016261, 400183.19324925),
     (3.51704563e+02,  -9.30242101, 400329.74529397),
     (3.52172724e+02,  -9.1042011 , 400474.36870042),
     (3.52640054e+02,  -8.90551566, 400617.05962631),
     (3.53106569e+02,  -8.7063774 , 400757.81451815),
     (3.53572287e+02,  -8.50679893, 400896.63010956),
     (3.54037225e+02,  -8.30679276, 401033.50341864),
     (3.54501400e+02,  -8.10637132, 401168.43174657),
     (3.54964828e+02,  -7.90554694, 401301.41267392),
     (3.55427528e+02,  -7.7043319 , 401432.44405882),
     (3.55889515e+02,  -7.50273835, 401561.52403478),
     (3.56350808e+02,  -7.30077841, 401688.65100753),
     (3.56811422e+02,  -7.09846407, 401813.82365394),
     (3.57271375e+02,  -6.8958073 , 401937.04091779),
     (3.57730685e+02,  -6.69281995, 402058.30200822),
     (3.58189368e+02,  -6.48951382, 402177.60639684),
     (3.58647441e+02,  -6.28590066, 402294.95381606),
     (3.59104921e+02,  -6.08199211, 402410.34425502),
     (3.59561825e+02,  -5.87779979, 402523.77795771),
     (1.81700647e-02,  -5.67333522, 402635.25542099),
     (4.73973386e-01,  -5.4686099 , 402744.7773907 )]>
In [101]:
coord.SkyCoord.from_name('M31')
Out[101]:
<SkyCoord (ICRS): (ra, dec) in deg
    (10.68470833, 41.26875)>
In [103]:
from astroquery.simbad import Simbad
from astroquery.vizier import Vizier
In [104]:
m67 = Simbad.query_object('M67')
m67
Out[104]:
Table length=1
MAIN_IDRADECRA_PRECDEC_PRECCOO_ERR_MAJACOO_ERR_MINACOO_ERR_ANGLECOO_QUALCOO_WAVELENGTHCOO_BIBCODE
"h:m:s""d:m:s"masmasdeg
objectstr13str13int16int16float32float32int16str1str1object
NGC 268208 51 18+11 48.044----0E2005ApJ...619..824X
In [108]:
table = Simbad.query_region(coord.SkyCoord('08h51m18s +11d48m0s'),
                            radius=1 * u.arcmin)
table
Out[108]:
Table length=24
MAIN_IDRADECRA_PRECDEC_PRECCOO_ERR_MAJACOO_ERR_MINACOO_ERR_ANGLECOO_QUALCOO_WAVELENGTHCOO_BIBCODE
"h:m:s""d:m:s"masmasdeg
objectstr13str13int16int16float32float32int16str1str1object
NGC 268208 51 18+11 48.044----0E2005ApJ...619..824X
NGC 2682 12008 51 19.1814+11 47 54.69214140.0230.01490AO2018yCat.1345....0G
CSI+11-08485 708 51 16.8+11 48 1155----0D
NGC 2682 10508 51 17.0998+11 48 16.17714140.0360.02190AO2018yCat.1345....0G
Cl* NGC 2682 FBC 341108 51 18.9766+11 48 21.76114140.3090.20190AO2018yCat.1345....0G
[MS2015] NX 4608 51 16.99+11 48 22.866----0DX2015MNRAS.452.3394M
Cl* NGC 2682 FBC 334808 51 17.0531+11 48 26.81014140.1410.07190AO2018yCat.1345....0G
Cl* NGC 2682 FBC 342408 51 19.2153+11 48 27.01114140.1000.06190AO2018yCat.1345....0G
LB 634008 51 18.92+11 48 32.766----0D1963LB....C32....1L
.................................
NGC 2682 9508 51 15.4466+11 47 31.47014140.0380.02290AO2018yCat.1345....0G
[VTB2004] CX 7408 51 15.85+11 48 37.266500.00030.0000D2004A&A...418..509V
Cl* NGC 2682 ES I-20208 51 21.3227+11 48 08.33514140.2800.16990AO2018yCat.1345....0G
LB 633908 51 19.9095+11 48 40.80514140.2860.15890AO2018yCat.1345....0G
Cl* NGC 2682 ES I-20408 51 20.7046+11 48 31.50714140.1540.07890AO2018yCat.1345....0G
Cl* NGC 2682 FBC 331408 51 16.0782+11 47 14.57514140.2740.17690AO2018yCat.1345....0G
Gaia DR2 60491748762085619208 51 16.3283+11 47 11.44314140.6110.35990AO2018yCat.1345....0G
[BVM98] M 67 2308 51 20.6+11 48 4355----0
Cl* NGC 2682 SAND 99908 51 18.6868+11 47 02.71814140.0330.02290AO2018yCat.1345....0G
NGC 2682 9108 51 14.7599+11 47 24.02314140.0350.02490AO2018yCat.1345....0G
In [111]:
m67 = Simbad.query_object('M67')
# coord.SkyCoord.guess_from_table(m67)
center = coord.SkyCoord(ra=m67['RA'], dec=m67['DEC'],
                        unit=(u.hourangle, u.deg))
center
Out[111]:
<SkyCoord (ICRS): (ra, dec) in deg
    [(132.825, 11.8)]>
In [116]:
vizier = Vizier(
    row_limit=10000,
)

tmass_table = vizier.query_region(
    center,
    radius=5 * u.arcmin,
    catalog='2MASS',
)[0]
display(tmass_table)
tmass = coord.SkyCoord(ra=tmass_table['RAJ2000'],
                       dec=tmass_table['DEJ2000'],
                       unit='deg')

sdss_table = vizier.query_region(
    center,
    radius=5 * u.arcmin,
    catalog='SDSS7',
)[0]
display(sdss_table)
sdss = coord.SkyCoord(ra=sdss_table['RA_ICRS'],
                      dec=sdss_table['DE_ICRS'],
                      unit='deg')
Table length=271
_qRAJ2000DEJ2000_2MASSJmage_JmagHmage_HmagKmage_KmagQflgRflgBflgCflgXflgAflg
degdegmagmagmagmagmagmag
int32float64float64bytes17float32float32float32float32float32float32bytes3bytes3bytes3bytes3uint8uint8
1132.81028511.74350108511446+114436613.8590.03613.4790.04113.3340.044AAA222222ccc00
1132.81027911.74469608511446+114440914.1760.02813.6500.02313.5980.036AAA222222ccc00
1132.79305411.73046208511033+114349616.2860.10415.5530.12115.4630.172ABC22211100000
1132.80617111.74037308511348+114425316.5060.12316.310--15.894--BUU20010000000
1132.78622511.73324308510869+114359616.5390.12616.2550.22915.621--BDU22011000000
1132.81785411.74246208511628+114432812.3080.02112.0210.02011.9540.020AAA22211100000
1132.83918011.73357508512140+114400814.8210.03714.3250.04914.0820.052AAA222111cc000
1132.84098911.72158108512183+114317613.2740.02313.0030.02312.9520.025AAA22211100000
1132.84891711.73617208512374+114410216.6690.14216.0110.19215.7900.229BCD22211100000
................................................
1132.89281711.82884108513427+114943811.8040.02211.5690.02211.5220.020AAA22211100000
1132.89272511.84845808513425+115054412.5850.02312.3410.02312.2570.023AAA22211100000
1132.88614511.84192008513267+115030914.1640.03013.6790.03213.6140.039AAA22211100000
1132.88395211.83433708513214+115003611.5140.02211.2260.02011.1980.020AAA22211100000
1132.88580111.81446408513259+114852010.6450.02210.5410.02010.5260.018AAA22211100000
1132.88573111.84461208513257+115040611.7300.02211.6570.02011.6170.020AAA22211100000
1132.80290411.87843608511269+11524238.6500.0188.1220.0187.9760.018AAA11111100000
1132.83399311.87998708512015+115247912.7720.02212.5450.02012.4570.021AAA22211100000
1132.85633411.87744908512552+115238812.1500.02211.8970.02011.8100.021AAA22211100000
1132.84064611.87717208512175+115237810.1050.0239.8160.0229.7600.018AAA22211100000
Table length=1401
_qmodeclSDSSm_SDSSzspumage_umaggmage_gmagrmage_rmagimage_imagzmage_zmagRA_ICRSDE_ICRSObsDateQ
magmagmagmagmagmagmagmagmagmagdegdegyr
int32uint8uint8bytes19bytes1float64float32float32float32float32float32float32float32float32float32float32float64float64float64uint8
123J085116.77+114829.2--20.8410.43122.4410.80424.6816.83224.2708.11418.3900.166132.81988611.8081152006.08443
116J085116.78+115038.8--14.9670.00615.0490.01314.2430.00913.3690.00913.2020.005132.81992011.8441352005.93143
126J085116.78+115038.9--15.0470.00614.5350.00914.1960.00915.1870.01113.2490.004132.81992611.8441512006.01613
116J085116.81+114541.6--15.8730.00514.4390.00313.9210.00313.7350.00313.7260.004132.82005311.7615612005.93143
113J085116.81+114807.4--17.6250.07419.8370.14116.1030.01314.9470.01616.5340.113132.82006311.8020672005.93143
126J085116.81+114541.6*--16.4320.00814.9110.00515.8220.01414.1560.00514.2140.007132.82006911.7615662006.08443
116J085116.85+114938.6--19.2660.03016.8060.00415.7330.00415.3670.00415.1670.005132.82023411.8274052005.93143
126J085116.85+114938.6*--19.1930.02716.7910.00415.7360.00315.3560.00315.1520.005132.82023911.8274122006.01613
116J085116.97+115009.3--14.8850.00414.5390.01114.9190.01115.2250.01413.2450.005132.82072611.8359242005.93143
............................................................
126J085116.32+114711.3--24.3980.71621.9910.06920.4500.02919.0810.01518.3080.020132.81801611.7864762006.08443
126J085116.43+114834.3--25.5920.81121.9660.07821.7770.10420.2210.04220.4050.131132.81847111.8095272006.01613
116J085116.46+114607.3--23.5830.84420.8070.03319.2310.01318.2220.00917.6520.017132.81860811.7687192005.93143
116J085116.47+114900.1--21.3810.13918.7400.00917.3610.00516.7980.00516.4710.008132.81862811.8166932005.93143
126J085116.47+114900.1*--21.1170.10718.7190.00817.3690.00516.7950.00516.5030.008132.81863011.8167012006.01613
126J085116.50+114723.9--22.3930.21822.0690.07722.2710.13722.2610.18923.0570.419132.81876911.7899832006.08443
123J085116.61+114529.3--24.6319.99917.0000.02016.1280.01516.1880.01914.3330.017132.81924111.7581382006.08443
113J085116.65+114528.9--24.3583.65216.0210.01516.6230.02416.4730.02422.8239.999132.81941211.7580522005.93143
116J085116.68+114529.3--14.8460.00514.8860.01114.7480.01114.6360.01212.4900.004132.81953711.7581442005.93143
126J085116.69+114529.3--14.5710.00615.4030.01215.7980.01414.6510.01313.4140.014132.81956411.7581642006.08443
In [137]:
tmass_close = tmass[center.separation(tmass) < 1 * u.arcmin]

plt.figure(figsize=(5,5))
with visualization.quantity_support():
    plt.scatter(center.ra, center.dec, color='k', marker='*', s=96)
    plt.scatter(tmass_close.ra, tmass_close.dec, marker='x',
                color='red')
    plt.scatter(sdss.ra, sdss.dec, marker='.', color='blue', s=4)
In [148]:
idx_tmass, idx_sdss, sep, dist = sdss.search_around_sky(
    tmass_close,
    1*u.arcsec,
)
with visualization.quantity_support():
    for a, b in zip(tmass[idx_tmass], sdss[idx_sdss]):
        plt.plot(u.Quantity([a.ra, b.ra]), u.Quantity([a.dec, b.dec]),
                 '-', color='blue')
In [151]:
idx_tmass, sep, dist = sdss.match_to_catalog_sky(tmass)

with visualization.quantity_support():
    for a, b in zip(tmass[idx_tmass], sdss):
        plt.plot(u.Quantity([a.ra, b.ra]), u.Quantity([a.dec, b.dec]),
                 '-', color='blue')
In [ ]: