torchsar.simulation package¶
Submodules¶
torchsar.simulation.geometry module¶
- torchsar.simulation.geometry.disc(SceneArea, x0, y0, r, a=None, dx=None, dy=None, verbose=False)¶
disc area
generates disc area
- Parameters
SceneArea (list or tuple) – Scene Area, [xmin,xmax,ymin,ymax]
x0 (int) – x center of disc (x: horizontal, y: vertical)
y0 (int) – y center of disc (x: horizontal, y: vertical)
r (int) – radius of disc
a (int, optional) – amplitude of disc (default: {None})
dx (float, optional) – resolution in range (default: {1 / (xmax-xmin)})
dy (float, optional) – resolution in azimuth (default: {1 / (ymax-ymin)})
verbose (bool, optional) – show more log info (the default is False, which means does not show)
- Returns
ccas – disk area
- Return type
tensor
- torchsar.simulation.geometry.rectangle(SceneArea, x0, y0, h, w, a=None, dx=None, dy=None, verbose=False)¶
rectangle area
generates rectangle area
- Parameters
SceneArea (list or tuple) – Scene Area, unit m, [xmin,xmax,ymin,ymax]
x0 (float) – x center of rectangle, unit m (x: horizontal, y: vertical)
y0 (float) – y center of rectangle, unit m (x: horizontal, y: vertical)
h (float) – height of rectangle, unit m (the default is None, which generates randomly)
w (float) – width of rectangle, unit m (the default is None, which generates randomly)
a (float, optional) – amplitude (the default is None, which generates randomly)
dx (float, optional) – resolution in range (default: {1 / (xmax-xmin)})
dy (float, optional) – resolution in azimuth (default: {1 / (ymax-ymin)})
verbose (bool, optional) – show more log info (the default is False, which means does not show)
- Returns
rects – rectangle area
- Return type
tensor
torchsar.simulation.make_sar_params module¶
torchsar.simulation.make_targets module¶
- torchsar.simulation.make_targets.gpoints(SceneArea, npoints, amin=0.0, amax=1.0, seed=None)¶
Generates point targets
- Parameters
- Returns
A tensor contains coordinate and amplitude information.
- Return type
tensor
torchsar.simulation.sar_model module¶
- torchsar.simulation.sar_model.load_sarmodel(datafile, mod='AinvA')¶
load sarmodel file
load sarmodel file (
.pkl
)- Parameters
- Returns
A (numpy array) – Imaging mapping matrix.
invA (numpy array) – Inverse of imaging mapping matrix.
- Raises
ValueError – wrong mod
- torchsar.simulation.sar_model.sarmodel(pdict, mod='2D1', gdshape=None, device='cpu', islog=False)¶
model sar imaging process.
SAR imaging model
- Parameters
pdict (dict) – SAR platform parameters
mod (str, optional) –
mod type(default: ‘2D1’)
- if mod is ‘2D1’:
- the model will be in vector mode:
s = A g MNx1 MNxHW HWx1(M: Na, N: Nr, MN << HW)
- if mod is ‘2D2’:
- the model will be in mat mode:
S = Aa G Be MxN MxH HxW WxN(M: Na, N: Nr, M << H, N << W)
- if mod is ‘1Da’:
S = A G MxW MxH HxW(M: Na, N: Nr, M << H)
- if mod is ‘1Dr’:
S’ = A G’ NxH NxW WxH(M: Na, N: Nr, N << W)
gdshape (tuple, optional) – discrete scene size of G (default: None, sarplat.acquisition[‘SceneArea’], dx=dy=1)
device (str) – device, default is ‘cpu’
islog (bool) – show log info (default: True)
- Returns
A – Imaging mapping matrix.
- Return type
torch tensor
- torchsar.simulation.sar_model.save_sarmodel(A, invA=None, AH=None, datafile='./model.pkl')¶
save model mapping matrix
save model mapping matrix to a file.
- Parameters
A (numpy array) – Imaging mapping matrix
invA (numpy array, optional) – Moore - Penorse inverse of A(default: {None})
AH (numpy array, optional) – The Hermite \({\bm A}^H\) of the Imaging mapping matrix \(\bm A\) (the default is None, which does not store)
datafile (str, optional) – save file path(default: {‘./model.pkl’})
torchsar.simulation.sharing module¶
- torchsar.simulation.sharing.range_angle(sensorpos, targetpos)¶
torchsar.simulation.simulation_chirp_scaling module¶
torchsar.simulation.simulation_freq_domain module¶
- torchsar.simulation.simulation_freq_domain.dsm2sar_fd(g, pdict, mode='StationaryTarget2D', ftshift=True, device='cpu')¶
Frequency-domain simulation
SAR raw data simulation by frequency-domain method.
- Parameters
- Returns
Simulated SAR raw data.
- Return type
tensor
torchsar.simulation.simulation_time_domain module¶
- torchsar.simulation.simulation_time_domain.tgs2sar_td(targets, pdict, mode='Target', device='cpu')¶
Time-domain simulation
SAR raw data simulation by time-domain method.
- Parameters
- Returns
Simulated SAR raw data tensor.
- Return type
tensor