Example #1
0
        surfdens_radial_profile(gal, mom0=mom0,
                                pa_bounds=Angle([-0.5 * np.pi * u.rad,
                                                 0.5 * np.pi * u.rad]),
                                dr=dr, restfreq=hi_freq)

    # There is a ~1.5 global scaling factor b/w Arecibo and VLA + Arecibo
    # Not needed with the corrected cube!
    # scale_factor = 1.451
    scale_factor = 1.0

    # Add in creating a radial profile of the archival and the Arecibo
    # Also CO? I guess these should be on the same grid/resolution...

    # Arecibo
    # arecibo_file = arecibo_HI_data_path("14B-088_items/M33_14B-088_HI_model.fits")
    arecibo_file = arecibo_HI_data_path("M33only_jy_stokes_vrad.fits")
    arecibo_cube = \
        SpectralCube.read(arecibo_file)
    # Cut down to extents of the other cube
    # arecibo_cube = \
    #    arecibo_cube.subcube(xlo=cube.longitude_extrema[0],
    #                         xhi=cube.longitude_extrema[1],
    #                         yhi=cube.latitude_extrema[0],
    #                         ylo=cube.latitude_extrema[1])
    arecibo_mom0 = arecibo_cube.moment0()
    rs_arec, sd_arec, sd_sigma_arec = \
        surfdens_radial_profile(gal, cube=arecibo_cube, mom0=arecibo_mom0,
                                dr=dr,
                                restfreq=hi_freq)

    # Archival HI
Example #2
0
'''
Sum over all spectra above 3 sigma. Overplot with single-dish Arecibo.
And produce the summed spectra of the rotation subtracted cube.
'''

# You know what's great? Making an install script!
execfile(os.path.expanduser("~/Dropbox/code_development/BaSiCs/basics/utils.py"))
# Needed sig_clip.


cube = \
    SpectralCube.read(fourteenB_HI_data_path(cube_name))
mask = fits.open(fourteenB_HI_data_path(mask_name))[0]
cube = cube.with_mask(mask.data > 0)

arecibo = SpectralCube.read(arecibo_HI_data_path("14B-088_items/M33_14B-088_HI_model.fits"))
arecibo = arecibo.spectral_slab(*cube.spectral_extrema)
arecibo = arecibo.subcube(ylo=cube.latitude_extrema[1],
                          yhi=cube.latitude_extrema[0],
                          xlo=cube.longitude_extrema[0],
                          xhi=cube.longitude_extrema[1])

# noise_sigma = sig_clip(cube[-1].value, nsig=10) * u.Jy

# cube = cube.with_mask(cube > 3 * noise_sigma)

# Using sum on two axes of a cube is super slow (and wrong? All NaNs?).
# I'll just loop through each channel to do this
total_spectrum = np.empty((cube.shape[0]))
total_spectrum_arecibo = np.empty((cube.shape[0]))
for chan in ProgressBar(range(cube.shape[0])):