Beispiel #1
0
ra = ax.coords['ra']
ra.set_major_formatter('hh:mm:ss.s')
dec = ax.coords['dec']
ra.set_axislabel("RA (J2000)", fontsize=pl.rcParams['axes.labelsize'])
dec.set_axislabel("Dec (J2000)", fontsize=pl.rcParams['axes.labelsize'], minpad=0)
ra.ticklabels.set_fontsize(tick_fontsize)
ra.set_ticks(exclude_overlapping=True)
dec.ticklabels.set_fontsize(tick_fontsize)
dec.set_ticks(exclude_overlapping=True)

scalebarpos = coordinates.SkyCoord("17:47:27.5", "-28:26:00.0",
                                   unit=(u.h, u.deg), frame='fk5')
make_scalebar(ax, scalebarpos,
              length=(2.0*u.pc / distance).to(u.arcsec,
                                              u.dimensionless_angles()),
              color='k',
              label='2 pc',
              text_offset=1.0*u.arcsec,
             )

fig.savefig(paths.fpath("HC3N_contours_on_SCUBA_column.pdf"), bbox_inches='tight')

core_phot_tbl = Table.read(paths.tpath("continuum_photometry.ipac"), format='ascii.ipac')
cores = coordinates.SkyCoord(core_phot_tbl['RA'], core_phot_tbl['Dec'],
                             frame='fk5')
markersize = 6
tr_fk5 = ax.get_transform("fk5")
coredots, = ax.plot(cores.ra, cores.dec, '.', color='lime', transform=tr_fk5,
                    markersize=markersize, zorder=50)
ax.axis([195,340,180,320])
                       interpolation='nearest',
                       origin='lower',
                       norm=asinh_norm.AsinhNorm())
        tr_fk5 = ax.get_transform("fk5")
        #(x1,y1),(x2,y2) = (1200,434),(2142,1743)
        # wrong (x1,y1),(x2,y2) = tr_fk5.transform_point([bottomleft.ra.deg, bottomleft.dec.deg]),tr_fk5.transform_point([topright.ra.deg, topright.dec.deg])
        (x1, y1), (x2, y2) = (toplevel_wcs.wcs_world2pix(
            [[bottomleft.ra.deg, bottomleft.dec.deg]], 0)[0],
                              toplevel_wcs.wcs_world2pix(
                                  [[topright.ra.deg, topright.dec.deg]], 0)[0])

        make_scalebar(
            ax,
            scalebarpos,
            length=(0.5 * u.pc / distance).to(u.arcsec,
                                              u.dimensionless_angles()),
            color='k',
            label='0.5 pc',
            text_offset=1.0 * u.arcsec,
        )

        if regionname in ('full', 'fullN'):

            markersize = 1
            coredots = plotcores(ax,
                                 alpha=1,
                                 transform=ax.get_transform('fk5'),
                                 markerfacecolor='none',
                                 markersize=markersize,
                                 zorder=50)
# anno = ax0.annotate('S', xy=(sgrb2s_x, sgrb2s_y),
#                     xytext=(sgrb2s_txt_x, sgrb2s_txt_y),
#                     color=textcolor,
#                     arrowprops=dict(edgecolor=textcolor,
#                                     arrowstyle='-', linewidth=1))

scalebarpos = coordinates.SkyCoord("17:47:27",
                                   "-28:25:30",
                                   unit=(u.h, u.deg),
                                   frame='fk5')
scalebarlen = (2 * u.pc / distance).to(u.arcsec, u.dimensionless_angles())

make_scalebar(ax0,
              scalebarpos,
              length=scalebarlen,
              color=textcolor,
              label='50" 2 pc',
              text_offset=1.0 * u.arcsec,
              fontsize=8)
ra.set_ticks(size=-3, color='w')
dec.set_ticks(size=-3, color='w')

# cbar_ax = fig.add_axes(
#         [0.7, 0.11, 0.01, 0.51])

# cb = plt.colorbar(im, cax=cbar_ax, orientation='vertical')
# cbar_ax.yaxis.set_ticks_position("right")
# cbar_ax.yaxis.set_label_position('right')
# cbar_ax.tick_params(axis='both', which='both', direction='in')
# cb.set_label("$S$ [mJy beam$^{-1}$]")
# cb.ax.zorder = 1e8
fig = pl.figure(1)
fig.clf()
ax = pl.subplot(1, 3, 1, projection=wcs.WCS(fh_s[0].header))
pl.imshow(sgrb2_hii_T_cutout.data,
          vmin=-1e-1,
          vmax=4e-0,
          cmap='viridis',
          origin='lower',
          interpolation='nearest')
pl.title("Sgr B2 HII T")
hide_labels(ax)
make_scalebar(
    ax,
    left_side=coordinates.SkyCoord('266d54m39s',
                                   '-28d27m48.5s',
                                   unit=(u.deg, u.deg),
                                   frame='fk5'),
    length=(0.1 * u.pc / d_sgr).to(u.arcsec, u.dimensionless_angles()),
    label='0.1 pc',
    fontsize=8,
)

pl.subplot(1, 3, 2)
pl.imshow(orion_cutout.data * (d_ori / d_sgr).decompose()**2,
          vmin=-1e-1,
          vmax=4e-0,
          cmap='viridis',
          origin='lower',
          interpolation='nearest')
pl.title("M42")
pl.gca().get_xaxis().set_ticks([])
pl.gca().get_yaxis().set_ticks([])
Beispiel #5
0
                       vmin=vmin, vmax=vmax, cmap=cmaps[regionname],
                       interpolation='nearest',
                       origin='lower', norm=norms[regionname])
        tr_fk5 = ax.get_transform("fk5")
        #(x1,y1),(x2,y2) = (1200,434),(2142,1743)
        # wrong (x1,y1),(x2,y2) = tr_fk5.transform_point([bottomleft.ra.deg, bottomleft.dec.deg]),tr_fk5.transform_point([topright.ra.deg, topright.dec.deg])
        (x1,y1),(x2,y2) = (mywcs.wcs_world2pix([[bottomleft.ra.deg,
                                                 bottomleft.dec.deg]],0)[0],
                           mywcs.wcs_world2pix([[topright.ra.deg,
                                                 topright.dec.deg]],0)[0]
                          )

        make_scalebar(ax, scalebarpos[regionname],
                      length=(scalebarlength[regionname] /
                              distance).to(u.arcsec, u.dimensionless_angles()),
                      color='k',
                      label=scalebarlabel[regionname],
                      text_offset=1.0*u.arcmin,
                     )


        ax.set_aspect(1)
        ax.axis([x1,x2,y1,y2])


        for zoomregion in zoomregions_order:

            ZR = zoomregions[zoomregion]
            if ZR['inregion'] != regionname:
                continue