Beispiel #1
0
fitsfile = 'leop.fluxRescale.16arcsec.vel.bin5arcsec.fits'
if lappy:
    fitsDir = '/home/elijah/research/leop/data/vla.gmrt/fitsImages/'
if cosmos:
    fitsDir = '/d/bip3/ezbc/leop/data/hi/casa/fitsImages/fluxRescale/'
f = pf.open(fitsDir + fitsfile)
header, cube = f[0].header, f[0].data

# Create subsection of cube
#subCube = cube[:,400:600,400:600]
#subCube = cube[:,450:550,450:550]
subCube = cube

# Define characteristics of cube
std = noiseCube.std()  # standard deviation of cube without rescaling
velocities = make_velocityAxis(header)  # writes velocities in km/s
velWidth = header['CDELT3'] / 1000.
beamsize = 16  # arcsec
cellsize = 6.  # arcsec / pix
raSize = len(subCube[0, :])
decSize = len(subCube[0, 0, :])
size = raSize * decSize
count = 0

# Set threshold
threshold = 5  # if max value of profile is above threshold*std then fit

# Perform monte carlo
simulationNum = 1000
simMeans = np.zeros(simulationNum)
simMedians = np.zeros(simulationNum)
Beispiel #2
0
from mycoords import make_velocityAxis
from agpy.gaussfitter import multigaussfit as gfit
import gaussFitting
import os

# Define paths:
fitsDir = '/d/bip3/ezbc/leop/data/hi/models/modelCreationFolder5/models/'
writeDir = '/d/bip3/ezbc/leop/data/hi/models/data/'
psDir = '/d/bip3/ezbc/leop/figures/'

# Open data cube with flux scaling
f = pf.open('/d/bip3/ezbc/leop/data/hi/casa/fitsImages/fluxRescale/' + \
            'leop.fluxRescale.16arcsec.vel.modelBin.fits')
h, d = f[0].header, f[0].data[:, :, :]

velArray = make_velocityAxis(h)


# Compute the final noise from data cube without flux scaling
def get_rms(x, axis=None):
    return np.sqrt(np.mean(x**2, axis=axis))

fnoise = pf.open('/d/bip3/ezbc/leop/data/hi/casa/fitsImages/fluxRescale/' +\
                 'originalCubes/leop.16arcsec.fits')
hnoise, dnoise = fnoise[0].header, fnoise[0].data[:, :, :]
rms = get_rms(dnoise)
std = dnoise.std()
threshold = 3. * rms

# Define number of models being used:
models = [name for name in os.listdir(fitsDir) if name.endswith('.FITS')]
fitsfile = 'leop.fluxRescale.16arcsec.vel.bin5arcsec.fits'
if lappy:
    fitsDir = '/home/elijah/research/leop/data/vla.gmrt/fitsImages/'
if cosmos:
    fitsDir = '/d/bip3/ezbc/leop/data/hi/casa/fitsImages/fluxRescale/'
f = pf.open(fitsDir + fitsfile)
header, cube = f[0].header, f[0].data

# Create subsection of cube
#subCube = cube[:,400:600,400:600]
#subCube = cube[:,450:550,450:550]
subCube = cube

# Define characteristics of cube
std = noiseCube.std() # standard deviation of cube without rescaling
velocities = make_velocityAxis(header) # writes velocities in km/s
velWidth = header['CDELT3']/1000.
beamsize = 16 # arcsec
cellsize = 6. # arcsec / pix
raSize = len(subCube[0,:])
decSize = len(subCube[0,0,:])
size = raSize * decSize
count = 0

# Set threshold
threshold = 5 # if max value of profile is above threshold*std then fit

# Perform monte carlo
simulationNum = 1000
simMeans = np.zeros(simulationNum)
simMedians = np.zeros(simulationNum)
from mycoords import make_velocityAxis
from agpy.gaussfitter import multigaussfit as gfit
import gaussFitting
import os

# Define paths:
fitsDir = '/d/bip3/ezbc/leop/data/hi/models/modelCreationFolder5/models/'
writeDir = '/d/bip3/ezbc/leop/data/hi/models/data/'
psDir =  '/d/bip3/ezbc/leop/figures/'

# Open data cube with flux scaling
f = pf.open('/d/bip3/ezbc/leop/data/hi/casa/fitsImages/fluxRescale/' + \
            'leop.fluxRescale.16arcsec.vel.modelBin.fits')
h, d = f[0].header, f[0].data[:,:,:]

velArray = make_velocityAxis(h)

# Compute the final noise from data cube without flux scaling
def get_rms(x, axis=None):
    return np.sqrt(np.mean(x**2, axis=axis))

fnoise = pf.open('/d/bip3/ezbc/leop/data/hi/casa/fitsImages/fluxRescale/' +\
                 'originalCubes/leop.16arcsec.fits')
hnoise,dnoise = fnoise[0].header, fnoise[0].data[:,:,:]
rms = get_rms(dnoise)
std = dnoise.std()
threshold = 3. * rms

# Define number of models being used:
models = [name for name in os.listdir(fitsDir) if name.endswith('.FITS')]
modelNum = len(models)