Example #1
0
    p.grid()
    p.legend()
    p.draw()

    p.savefig(paper1_figures_path("hi_veldisp_profile_n_s.png"))
    p.savefig(paper1_figures_path("hi_veldisp_profile_n_s.pdf"))

    # raw_input("Next plot?")
    p.clf()

    # There are interesting drops at 1 and ~4.2 kpc. Plot these on the moment 0
    mom0 = fits.getdata(fourteenB_HI_data_path(moment0_name))

    ax = p.subplot(121, projection=lwidth.wcs)
    p.imshow(mom0, origin='lower')
    radii = gal.radius(header=lwidth.header)
    p.contour(radii <= 1 * u.kpc, colors='b')
    p.contour(radii <= 4.2 * u.kpc, colors='g')
    p.xlabel("")
    ax.set_title("Zeroth Moment")
    ax2 = p.subplot(122, projection=lwidth.wcs)
    p.imshow(lwidth.value, origin='lower')
    p.contour(radii <= 1 * u.kpc, colors='b')
    p.contour(radii <= 4.2 * u.kpc, colors='g')
    p.xlabel("")
    ax2.set_title("Line Width")
    lat = ax2.coords[1]
    lat.set_ticklabel_visible(False)
    p.draw()

    p.savefig(paper1_figures_path("moment0_w_veldisp_minima.png"))
Example #2
0
# Set the radial disk widths to bin over
# dr = 500 * u.pc
dr = 100 * u.pc
# dr = 300 * u.pc

# Load the moment 0
cube = SpectralCube.read(iram_co21_data_path("m33.co21_iram.fits"))
del cube._header[""]
cube = cube.with_mask(cube > 0.1 * u.K)

mom0_hi = fits.open(fourteenB_HI_data_path(moment0_name))[0]
hi_cube = SpectralCube.read(fourteenB_HI_data_path(cube_name))
mask = fits.open(fourteenB_HI_data_path(mask_name))[0]
hi_cube = hi_cube.with_mask(mask.data > 0)

radii = gal.radius(header=cube.header)
# Edge effects are really awful in this map. Ignore the edges by masking
# beyond 6 kpc. This is really close to the edge of the data anyways, and
# honestly results beyond this point shouldn't be trusted...
cube = cube.with_mask(radii < 6. * u.kpc)

# mom0 = fits.open(os.path.join(direc, "m33.ico.fits"))[0]

# mom0_data = mom0.data.squeeze() * (mom0.data.squeeze() > 1.0) * u.K
mom0 = cube.moment0()

rs, sd, sd_sigma = surfdens_radial_profile(gal, cube=cube, mom0=mom0,
                                           max_rad=6 * u.kpc, dr=dr)
# Correct for beam efficiency
sd /= beam_eff
sd_sigma /= beam_eff