示例#1
0
#rfv = cb[2]

#del cb

#tf = df + vf

#tp, kpar, kperp = ps_estimation.ps_azimuth(df, width=[64.0, 64.0, 64.0], kmodes = True)
#kvec = np.rollaxis(np.array(np.meshgrid(kpar, kperp)), 0, 3)
#pst = ps((kvec**2).sum(axis=2)**0.5)
#mi = np.fft.irfftn(rfv._kweight* 2**0.5)
#tpm, kparm, kperpm = ps_estimation.ps_azimuth(mi, width=[64.0, 64.0, 64.0], kmodes = True)


rf = cr.realisation(z1, z2, thetax, thetay, nf, nx, ny)[::-1,...]

psnw, kpar, kperp = ps_estimation.ps_azimuth(rf, window = False)
psww, kpar, kperp = ps_estimation.ps_azimuth(rf, window = True)

lag0 = np.cov(rf.reshape((256, 128*128)))

bc = bincov(lag0)

a = algebra.make_vect(rf, axis_names = ('freq', 'ra', 'dec'))

a.set_axis_info('freq', (f1+f2)/2.0, (f1-f2)/nf)
a.set_axis_info('ra', 0.0, thetax / nx)
a.set_axis_info('dec', 0.0, thetay / ny)

b = beam.GaussianBeam(width = [0.25, 0.25*f2/f1], freq = [f2, f1])

ab = b.apply(a)
示例#2
0
# Adjust angular and frequency ranges to make close to a cube.
cr.x_width = 10.0  # degrees
cr.y_width = 10.0  # degrees
cr.nu_lower = 500.0  # MHz
cr.nu_upper = 600.0  # MHz

# Generate two realisations
f1 = cr.getfield()
f2 = cr.getfield()

# Calculate 2D statistics (that is treating kpar and kperp
# separately).

# 2D powerspectra of each field
ps1 = ps_estimation.ps_azimuth(f1, window=True, kmodes=False)
ps2 = ps_estimation.ps_azimuth(f2, window=True, kmodes=False)
# 2D cross power spectrum
ps12 = ps_estimation.crossps_azimuth(f1, f2, window=True, kmodes=False)

# Rescale to make differences more obvious
ch1 = ps12 / (ps1 * ps2)**0.5

# 2D mutual coherence of the two fields
coh = np.abs(ch1)**2

## Calculate 1D radially average statistics.

## These do not account for anisotropy (but small as angular and
## frequency ranges chosen to be near a cube)
示例#3
0
# Adjust angular and frequency ranges to make close to a cube.
cr.x_width = 10.0   # degrees
cr.y_width = 10.0   # degrees
cr.nu_lower = 500.0 # MHz
cr.nu_upper = 600.0 # MHz

# Generate two realisations
f1 = cr.getfield()
f2 = cr.getfield()

# Calculate 2D statistics (that is treating kpar and kperp
# separately).

# 2D powerspectra of each field
ps1 = ps_estimation.ps_azimuth(f1, window = True, kmodes = False)
ps2 = ps_estimation.ps_azimuth(f2, window = True, kmodes = False)
# 2D cross power spectrum
ps12 = ps_estimation.crossps_azimuth(f1, f2, window = True, kmodes = False)

# Rescale to make differences more obvious
ch1 = ps12 / (ps1 * ps2)**0.5

# 2D mutual coherence of the two fields
coh = np.abs(ch1)**2

## Calculate 1D radially average statistics.

## These do not account for anisotropy (but small as angular and
## frequency ranges chosen to be near a cube)