In [1]:
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings('ignore')
from mocpy import MOC
import astropy.units as u
from astropy.coordinates import SkyCoord, Angle
First, we retrieve the MOC for VizieR table VIII/84/7c
In [2]:
import mocpy
moc = MOC.from_vizier_table('VIII/84/7c', nside=64)
In [3]:
def plot(moc, title=None):
import matplotlib.pyplot as plt
fig = plt.figure(111, figsize=(15, 15))
from mocpy import WCS
from astropy.coordinates import Angle
with WCS(fig,
fov=330 * u.deg,
center=SkyCoord(0, 0, unit='deg', frame='icrs'),
coordsys="icrs",
rotation=Angle(0, u.degree),
projection="AIT") as wcs:
ax = fig.add_subplot(1, 1, 1, projection=wcs)
moc.fill(ax=ax, wcs=wcs, alpha=0.5, fill=True, color="green")
plt.xlabel('ra')
plt.ylabel('dec')
if title:
plt.title(title)
plt.grid(color="black", linestyle="dotted")
In [4]:
plot(moc=moc, title='VIII/84/7c')
Then, we query Hipparcos catalogue to get all sources in the MOC coverage
In [5]:
#table = moc.query_simbad(10000)
table = moc.query_vizier_table('I/239/hip_main', max_rows=100000)
print(table)
Finally, we plot the positions of the sources in the table to check if they lie in the MOC coverage
In [6]:
from astropy import units as u
from astropy.units import Quantity
moc_table = MOC.from_lonlat(table['_RAJ2000'].T * u.deg, table['_DEJ2000'].T * u.deg, 7)
plot(moc=moc_table, title='VIII/84/7c')
In [ ]: