Ejemplo n.º 1
0
    def test_draw_hires(self):
        """ Draw a partial healpix map with very large nside """
        nside = 4096 * 2**5
        ra, dec = 45, -45
        radius = 0.05
        pixels = skymap.healpix.ang2disc(nside, ra, dec, radius)
        values = pixels

        plt.figure()
        # Use the Cassini projection (because we can)
        m = Skymap(projection='cass',
                   lon_0=ra,
                   lat_0=dec,
                   celestial=False,
                   llcrnrlon=ra + 2 * radius,
                   urcrnrlon=ra - 2 * radius,
                   llcrnrlat=dec - 2 * radius,
                   urcrnrlat=dec + 2 * radius)

        m.draw_hpxmap(values, pixels, nside=nside, xsize=400)
        m.draw_parallels(np.linspace(dec - 2 * radius, dec + 2 * radius, 5),
                         labelstyle='+/-',
                         labels=[1, 0, 0, 0])
        m.draw_meridians(np.linspace(ra - 2 * radius, ra + 2 * radius, 5),
                         labelstyle='+/-',
                         labels=[0, 0, 0, 1])
        plt.title('HEALPix Zoom (nside=%i)' % nside)
Ejemplo n.º 2
0
    def test_draw_focal_planes(self):
        """ Draw a DECam focal planes """
        ra, dec = 45, -45
        radius = 1.5
        delta = 1.0

        plt.figure()
        # Use the Cassini projection (because we can)
        m = Skymap(projection='cass',
                   lon_0=ra,
                   lat_0=dec,
                   celestial=False,
                   llcrnrlon=ra + 2 * radius,
                   urcrnrlon=ra - 2 * radius,
                   llcrnrlat=dec - 2 * radius,
                   urcrnrlat=dec + 2 * radius)

        # Can plot individual fields
        m.draw_focal_planes([ra + delta / 2], [dec - delta / 2], color='g')
        # Or as arrays
        m.draw_focal_planes([ra, ra - delta, ra - delta],
                            [dec, dec + delta, dec - delta],
                            color='r')
        # Draw the grid lines
        m.draw_parallels(np.linspace(dec - 2 * radius, dec + 2 * radius, 5),
                         labelstyle='+/-',
                         labels=[1, 0, 0, 0])
        m.draw_meridians(np.linspace(ra - 2 * radius, ra + 2 * radius, 5),
                         labelstyle='+/-',
                         labels=[0, 0, 0, 1])
        plt.title('DECam Focal Planes')