示例#1
0
                                    n_hat=platform['n_hat'])

# Apply polar format algorithm to phase history data
# (Other options not available since platform position is unknown)
img_pf = imgTools.polar_format(phs_corr, platform, img_plane, taylor=30)

# Degrade image with random 10th order polynomial phase
coeff = (np.random.rand(10) - 0.5) * img_pf.shape[0]
x = np.linspace(-1, 1, img_pf.shape[0])
y = np.poly1d(coeff)(x)
slope, intercept, r_value, p_value, std_err = linregress(x, y)
line = slope * x + np.mean(y)
y = y - line
ph_err = np.tile(np.array([y]).T, (1, img_pf.shape[1]))
img_err = sig.ft(sig.ift(img_pf, ax=0) * np.exp(1j * ph_err), ax=0)

# Autofocus image
print('autofocusing')
img_af, af_ph = imgTools.autoFocus2(img_err, win='auto')
# img_af, af_ph = imgTools.autoFocus2(img_err, win = 0, win_params = [500,0.8])

# Output image
plt.figure()
plt.plot(x, y, x, af_ph)
plt.legend(['true error', 'estimated error'], loc='best')
plt.ylabel('Phase (radians)')

# Output image
plt.figure()
imgTools.imshow(img_af, dB_scale=[-45, 0])
示例#2
0
文件: sim_demo.py 项目: AI42/RITSAR
platform = plat_dict()

#Create image plane dictionary
img_plane = imgTools.img_plane_dict(platform, aspect = 1)

#Simulate phase history, if needed
##############################################################################
nsamples = platform['nsamples']
npulses = platform['npulses']
x = img_plane['u']; y = img_plane['v']
points = [[0,0,0],
          [0,-100,0],
          [200,0,0]]
amplitudes = [1,1,1]
phs = phsTools.simulate_phs(platform, points, amplitudes)
##############################################################################

#Apply RVP correction
phs_corr = phsTools.RVP_correct(phs, platform)

#Demodulate phase history with constant reference, if needed 
phs_fixed = phsTools.phs_to_const_ref(phs_corr, platform, upchirp = 1)

#Apply algorithm of choice to phase history data
img_pf = imgTools.polar_format(phs_corr, platform, img_plane, taylor = 17)
#img_wk = imgTools.omega_k(phs_fixed, platform, taylor = 17, upsample = 2)
#img_bp = imgTools.backprojection(phs_corr, platform, img_plane, taylor = 17, upsample = 2)

#Output image
imgTools.imshow(img_pf, dB_scale = [-25,0])
示例#3
0
#Include SARIT toolset
from ritsar import phsRead
from ritsar import phsTools
from ritsar import imgTools

#Define directory containing *.au2 and *.phs files
directory = './data/Sandia/'

#Import phase history and create platform dictionary
[phs, platform] = phsRead.Sandia(directory)

#Correct for residual video phase
phs_corr = phsTools.RVP_correct(phs, platform)

#Import image plane dictionary from './parameters/img_plane'
img_plane = imgTools.img_plane_dict(platform,
                                    res_factor=1.0,
                                    n_hat=platform['n_hat'])

#Apply polar format algorithm to phase history data
#(Other options not available since platform position is unknown)
img_pf = imgTools.polar_format(phs_corr, platform, img_plane, taylor=30)

#Output image
imgTools.imshow(img_pf, [-45, 0])
if batch:
    plt.savefig("Sandia_demo.png")
else:
    plt.show()
示例#4
0
from sys import path
path.append('../')

#Include SARIT toolset
from ritsar import phsRead
from ritsar import phsTools
from ritsar import imgTools

#Define directory containing *.au2 and *.phs files
directory = './data/DIRSIG/'

#Import phase history and create platform dictionary
[phs, platform] = phsRead.DIRSIG(directory)

#Correct for reisdual video phase
phs_corr = phsTools.RVP_correct(phs, platform)

#Demodulate phase history with constant reference, if needed 
phs_fixed = phsTools.phs_to_const_ref(phs_corr, platform, upchirp = 1)

#Import image plane dictionary from './parameters/img_plane'
img_plane = imgTools.img_plane_dict(platform, res_factor = 1.0, aspect = 1.0)

#Apply polar format algorithm to phase history data
img_wk = imgTools.omega_k(phs_fixed, platform, taylor = 13, upsample = 2)
#img_bp = imgTools.backprojection(phs_corr, platform, img_plane, taylor = 13, upsample = 6)
#img_pf = imgTools.polar_format(phs_corr, platform, img_plane, taylor = 13)

#Output image
imgTools.imshow(img_wk, [-20,0])
示例#5
0
##############################################################################

#Add include directories to default path list
from sys import path
path.append('../')

#Include SARIT toolset
from ritsar import phsRead
from ritsar import phsTools
from ritsar import imgTools

#Define directory containing *.au2 and *.phs files
directory = './data/Sandia/'

#Import phase history and create platform dictionary
[phs, platform] = phsRead.Sandia(directory)

#Correct for residual video phase
phs_corr = phsTools.RVP_correct(phs, platform)

#Import image plane dictionary from './parameters/img_plane'
img_plane = imgTools.img_plane_dict(platform,
                           res_factor = 1.0, n_hat = platform['n_hat'])

#Apply polar format algorithm to phase history data
#(Other options not available since platform position is unknown)
img_pf = imgTools.polar_format(phs_corr, platform, img_plane, taylor = 30)

#Output image
imgTools.imshow(img_pf, [-45,0])
示例#6
0
#Include SARIT toolset
from ritsar import phsRead
from ritsar import imgTools

#Define top level directory containing *.mat file
#and choose polarization and starting azimuth
pol = 'HH'
directory = './data/AFRL/pass1'
start_az = 1

#Import phase history and create platform dictionary
[phs, platform] = phsRead.AFRL(directory, pol, start_az, n_az=3)

#Create image plane dictionary
img_plane = imgTools.img_plane_dict(platform,
                                    res_factor=1.4,
                                    upsample=True,
                                    aspect=1.0)

#Apply algorithm of choice to phase history data
img_bp = imgTools.backprojection(phs,
                                 platform,
                                 img_plane,
                                 taylor=20,
                                 upsample=6)
#img_pf = imgTools.polar_format(phs, platform, img_plane, taylor = 20)

#Output image
imgTools.imshow(img_bp, dB_scale=[-30, 0])
plt.title('Backprojection')
示例#7
0
    fbp_time = time() - start

    # Fast-factorized backprojection with multi-processing
    start = time()
    img_FFBP = imgTools.FFBPmp(phs, platform, img_plane, taylor=17, factor_max=2)
    fbpmp_time = time() - start

    # Output image
    u = img_plane['u'];
    v = img_plane['v']
    extent = [u.min(), u.max(), v.min(), v.max()]

    plt.subplot(2, 1, 1)
    plt.title('Full Backprojection \n \
    Runtime = %i s' % bp_time)
    imgTools.imshow(img_bp, dB_scale=[-30, 0], extent=extent)
    plt.xlabel('meters');
    plt.ylabel('meters')

    plt.subplot(2, 2, 3)
    plt.title('Fast Factorized Backprojection \n w/o multi-processing \n \
    Runtime = %i s' % fbp_time)
    imgTools.imshow(img_FFBP, dB_scale=[-30, 0], extent=extent)
    plt.xlabel('meters');
    plt.ylabel('meters')

    plt.subplot(2, 2, 4)
    plt.title('Fast Factorized Backprojection \n w/ multi-processing \n \
    Runtime = %i s' % fbpmp_time)
    imgTools.imshow(img_FFBP, dB_scale=[-30, 0], extent=extent)
    plt.xlabel('meters');
示例#8
0
文件: FFBP_demo.py 项目: AI42/RITSAR
img_bp   = imgTools.backprojection(phs, platform, img_plane, taylor = 17, upsample = 2)
bp_time = time()-start

#Fast-factorized backprojection
start = time()
img_FFBP = imgTools.FFBP(phs, platform, img_plane, taylor = 17, factor_max = 2)
fbp_time = time()-start

#Output image
u = img_plane['u']; v = img_plane['v']
extent = [u.min(), u.max(), v.min(), v.max()]

plt.subplot(1,2,1)
plt.title('Full Backprojection \n \
Runtime = %i s'%bp_time)
imgTools.imshow(img_bp, dB_scale = [-30,0], extent = extent)
plt.xlabel('meters'); plt.ylabel('meters')

plt.subplot(1,2,2)
plt.title('Fast Factorized Backprojection \n \
Runtime = %i s'%fbp_time)
imgTools.imshow(img_FFBP, dB_scale = [-30,0], extent = extent)
plt.xlabel('meters'); plt.ylabel('meters')
plt.tight_layout()
'''
#DIRSIG DSBP demo
###############################################################################
#Define directory containing *.au2 and *.phs files
directory = './data/DIRSIG/'

#Import phase history and create platform dictionary
示例#9
0
文件: sim_demo.py 项目: yxw027/RITSAR
#Create platform dictionary
platform = plat_dict()

#Create image plane dictionary
img_plane = imgTools.img_plane_dict(platform, aspect=1)

#Simulate phase history, if needed
##############################################################################
nsamples = platform['nsamples']
npulses = platform['npulses']
x = img_plane['u']
y = img_plane['v']
points = [[0, 0, 0], [0, -100, 0], [200, 0, 0]]
amplitudes = [1, 1, 1]
phs = phsTools.simulate_phs(platform, points, amplitudes)
##############################################################################

#Apply RVP correction
phs_corr = phsTools.RVP_correct(phs, platform)

#Demodulate phase history with constant reference, if needed
phs_fixed = phsTools.phs_to_const_ref(phs_corr, platform, upchirp=1)

#Apply algorithm of choice to phase history data
img_pf = imgTools.polar_format(phs_corr, platform, img_plane, taylor=17)
#img_wk = imgTools.omega_k(phs_fixed, platform, taylor = 17, upsample = 2)
#img_bp = imgTools.backprojection(phs_corr, platform, img_plane, taylor = 17, upsample = 2)

#Output image
imgTools.imshow(img_pf, dB_scale=[-25, 0])
示例#10
0
                         center=[200, 0, 0],
                         size=[N, N],
                         n=8)

#Output image
du = img_plane['du']
dv = img_plane['dv']
#u = img_plane['u']; v = img_plane['v']
u = np.arange(-N / 2, N / 2) * du
v = np.arange(-N / 2, N / 2) * dv
extent = [u.min(), u.max(), v.min(), v.max()]

plt.subplot(1, 2, 1)
plt.title('Full Backprojection')
imgTools.imshow(img_bp[1024 - N / 2:1024 + N / 2, 1315 - N / 2:1315 + N / 2],
                dB_scale=[-25, 0],
                extent=extent)
plt.xlabel('meters')
plt.ylabel('meters')

plt.subplot(1, 2, 2)
plt.title('Digital Spotlight Backprojection')
imgTools.imshow(img_DSBP, dB_scale=[-25, 0], extent=extent)
plt.xlabel('meters')
plt.ylabel('meters')
plt.tight_layout()

#%%

#AFRL DSBP demo
###############################################################################
示例#11
0
文件: DSBP_demo.py 项目: AI42/RITSAR
#Apply algorithm of choice to phase history data
img_bp   = imgTools.backprojection(phs, platform, img_plane, taylor = 17, upsample = 2)
N = 128
img_DSBP = imgTools.DSBP(phs, platform, img_plane, center = [-15-0.6,22-0.4,0], size = [N,N])

#Output image
du = img_plane['du']; dv = img_plane['dv']
#u = img_plane['u']; v = img_plane['v']
u = np.arange(-N/2,N/2)*du
v = np.arange(-N/2,N/2)*dv
extent = [u.min(), u.max(), v.min(), v.max()]

plt.subplot(1,2,1)
plt.title('Full Backprojection')
imgTools.imshow(img_bp[177-N/2:177+N/2,202-N/2:202+N/2], dB_scale = [-25,0], extent = extent)
plt.xlabel('meters'); plt.ylabel('meters')

plt.subplot(1,2,2)
plt.title('Digital Spotlight Backprojection')
imgTools.imshow(img_DSBP, dB_scale = [-25,0], extent = extent)
plt.xlabel('meters'); plt.ylabel('meters')
plt.tight_layout()
'''
#DIRSIG DSBP demo
###############################################################################
#Define directory containing *.au2 and *.phs files
directory = './data/DIRSIG/'

#Import phase history and create platform dictionary
[phs, platform] = phsRead.DIRSIG(directory)
示例#12
0
                         img_plane,
                         center=[-15 - 0.6, 22 - 0.4, 0],
                         size=[N, N])

#Output image
du = img_plane['du']
dv = img_plane['dv']
#u = img_plane['u']; v = img_plane['v']
u = np.arange(-N / 2, N / 2) * du
v = np.arange(-N / 2, N / 2) * dv
extent = [u.min(), u.max(), v.min(), v.max()]

plt.subplot(1, 2, 1)
plt.title('Full Backprojection')
imgTools.imshow(img_bp[177 - N // 2:177 + N // 2, 202 - N // 2:202 + N // 2],
                dB_scale=[-25, 0],
                extent=extent)
plt.xlabel('meters')
plt.ylabel('meters')

plt.subplot(1, 2, 2)
plt.title('Digital Spotlight Backprojection')
imgTools.imshow(img_DSBP, dB_scale=[-25, 0], extent=extent)
plt.xlabel('meters')
plt.ylabel('meters')
plt.tight_layout()
if batch:
    plt.savefig("DSBP_demo.png")
else:
    plt.show()
'''
示例#13
0
img_plane = imgTools.img_plane_dict(platform,
                           res_factor = 1.0, n_hat = platform['n_hat'])

#Apply polar format algorithm to phase history data
#(Other options not available since platform position is unknown)
img_pf = imgTools.polar_format(phs_corr, platform, img_plane, taylor = 30)

#Degrade image with random 10th order polynomial phase
coeff = (np.random.rand(10)-0.5)*img_pf.shape[0]
x = np.linspace(-1,1,img_pf.shape[0])
y = np.poly1d(coeff)(x)
slope, intercept, r_value, p_value, std_err = linregress(x,y)
line = slope*x+np.mean(y)
y = y-line
ph_err = np.tile(np.array([y]).T,(1,img_pf.shape[1]))
img_err = sig.ft(sig.ift(img_pf,ax=0)*np.exp(1j*ph_err),ax=0)

#Autofocus image
print('autofocusing')
img_af, af_ph = imgTools.autoFocus2(img_err, win = 'auto')
#img_af, af_ph = imgTools.autoFocus2(img_err, win = 0, win_params = [500,0.8])

#Output image
plt.figure()
plt.plot(x,y,x,af_ph); plt.legend(['true error','estimated error'], loc = 'best')
plt.ylabel('Phase (radians)')

#Output image
plt.figure()
imgTools.imshow(img_af, dB_scale = [-45,0])
示例#14
0
文件: AFRL_demo.py 项目: AI42/RITSAR
#Add include directories to default path list
from sys import path
path.append('../')

#Include standard library dependencies
import matplotlib.pylab as plt

#Include SARIT toolset
from ritsar import phsRead
from ritsar import imgTools

#Define top level directory containing *.mat file
#and choose polarization and starting azimuth
pol = 'HH'
directory = './data/AFRL/pass1'
start_az = 1

#Import phase history and create platform dictionary
[phs, platform] = phsRead.AFRL(directory, pol, start_az, n_az = 3)

#Create image plane dictionary
img_plane = imgTools.img_plane_dict(platform, res_factor = 1.4, upsample = True, aspect = 1.0)

#Apply algorithm of choice to phase history data
img_bp = imgTools.backprojection(phs, platform, img_plane, taylor = 20, upsample = 6)
#img_pf = imgTools.polar_format(phs, platform, img_plane, taylor = 20)

#Output image
imgTools.imshow(img_bp, dB_scale = [-30,0])
plt.title('Backprojection')