In [6]:
%matplotlib inline

from mocpy import MOC
import astropy.units as u
from astropy.coordinates import SkyCoord, Angle

In [7]:
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='galactic'),
             coordsys="galactic",
             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 [8]:
m1 = MOC.from_vizier_table('VI/137/gum_qso', nside=512)

In [9]:
plot(moc=m1.degrade_to_order(8), title='VI/137/gum_qso')


WARNING: FITSFixedWarning: The WCS transformation has more axes (2) than the image it is associated with (0) [astropy.wcs.wcs]
WARNING: FITSFixedWarning: The WCS transformation has more axes (2) than the image it is associated with (0) [astropy.wcs.wcs]
WARNING: FITSFixedWarning: The WCS transformation has more axes (2) than the image it is associated with (0) [astropy.wcs.wcs]

In [5]:
m2 = MOC.from_ivorn('ivo://CDS/B/denis/denis', nside=64)
plot(moc=m2, title='ivo://CDS/B/denis/denis')


WARNING: FITSFixedWarning: The WCS transformation has more axes (2) than the image it is associated with (0) [astropy.wcs.wcs]
WARNING: FITSFixedWarning: The WCS transformation has more axes (2) than the image it is associated with (0) [astropy.wcs.wcs]
WARNING: FITSFixedWarning: The WCS transformation has more axes (2) than the image it is associated with (0) [astropy.wcs.wcs]
WARNING: FITSFixedWarning: The WCS transformation has more axes (2) than the image it is associated with (0) [astropy.wcs.wcs]
CPU times: user 44.5 ms, sys: 31.7 ms, total: 76.2 ms
Wall time: 177 ms

In [ ]: