Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gr_type = None
# Row
row_window_name = h5_dict['Range Focusing Weighting Function'].rstrip().upper()
row_params = None
if row_window_name == 'HAMMING':
row_params = {'COEFFICIENT': '{0:15f}'.format(h5_dict['Range Focusing Weighting Coefficient'])}
row = DirParamType(Sgn=-1,
KCtr=2*center_frequency/speed_of_light,
DeltaKCOAPoly=Poly2DType(Coefs=[[0, ], ]),
WgtType=WgtTypeType(WindowName=row_window_name, Parameters=row_params))
# Col
col_window_name = h5_dict['Azimuth Focusing Weighting Function'].rstrip().upper()
col_params = None
if col_window_name == 'HAMMING':
col_params = {'COEFFICIENT': '{0:15f}'.format(h5_dict['Azimuth Focusing Weighting Coefficient'])}
col = DirParamType(Sgn=-1,
KCtr=0,
WgtType=WgtTypeType(WindowName=col_window_name, Parameters=col_params))
return GridType(ImagePlane=image_plane, Type=gr_type, Row=row, Col=col)
'/rasterAttributes'
'/sampledPixelSpacing').text)
else:
raise ValueError('unhandled generation {}'.format(self.generation))
row_irbw = 2*float(self._find('./imageGenerationParameters'
'/sarProcessingInformation'
'/totalProcessedRangeBandwidth').text)/speed_of_light
row_wgt_type = WgtTypeType(WindowName=self._find('./imageGenerationParameters'
'/sarProcessingInformation'
'/rangeWindow/windowName').text.upper())
if row_wgt_type.WindowName == 'KAISER':
row_wgt_type.Parameters = {'BETA': self._find('./imageGenerationParameters'
'/sarProcessingInformation'
'/rangeWindow/windowCoefficient').text}
return DirParamType(
SS=row_ss, ImpRespBW=row_irbw, Sgn=-1, KCtr=2*center_freq/speed_of_light,
DeltaKCOAPoly=Poly2DType(Coefs=((0,),)), WgtType=row_wgt_type)
# from UAVSAR is a placeholder, not an accurate description of the data.
# At this point, it is not clear what the final weighting description for NISAR
# will be.
gp = hf['/science/LSAR/SLC/metadata/processingInformation/parameters']
row_wgt = gp['rangeChirpWeighting'][:]
win_name = 'UNIFORM' if numpy.all(row_wgt == row_wgt[0]) else 'UNKNOWN'
row = DirParamType(
Sgn=-1,
DeltaKCOAPoly=[[0,]],
WgtFunct=numpy.cast[numpy.float64](row_wgt),
WgtType=WgtTypeType(WindowName=win_name))
col_wgt = gp['azimuthChirpWeighting'][:]
win_name = 'UNIFORM' if numpy.all(col_wgt == col_wgt[0]) else 'UNKNOWN'
col = DirParamType(
Sgn=-1,
KCtr=0,
WgtFunct=numpy.cast[numpy.float64](col_wgt),
WgtType=WgtTypeType(WindowName=win_name))
return GridType(ImagePlane='SLANT', Type='RGZERO', Row=row, Col=col)
def get_grid(): # type: () -> GridType
if h5_dict['Projection ID'] == 'SLANT RANGE/AZIMUTH':
image_plane = 'SLANT'
gr_type = 'RGZERO'
else:
image_plane = 'GROUND'
gr_type = None
# Row
row_window_name = h5_dict['Range Focusing Weighting Function'].rstrip().upper()
row_params = None
if row_window_name == 'HAMMING':
row_params = {'COEFFICIENT': '{0:15f}'.format(h5_dict['Range Focusing Weighting Coefficient'])}
row = DirParamType(Sgn=-1,
KCtr=2*center_frequency/speed_of_light,
DeltaKCOAPoly=Poly2DType(Coefs=[[0, ], ]),
WgtType=WgtTypeType(WindowName=row_window_name, Parameters=row_params))
# Col
col_window_name = h5_dict['Azimuth Focusing Weighting Function'].rstrip().upper()
col_params = None
if col_window_name == 'HAMMING':
col_params = {'COEFFICIENT': '{0:15f}'.format(h5_dict['Azimuth Focusing Weighting Coefficient'])}
col = DirParamType(Sgn=-1,
KCtr=0,
WgtType=WgtTypeType(WindowName=col_window_name, Parameters=col_params))
return GridType(ImagePlane=image_plane, Type=gr_type, Row=row, Col=col)
* `XRGYCR` - Orthogonal slant plane grid oriented range and cross range relative to the ARP at a
reference time.
* `XCTYAT` - Orthogonal slant plane grid with X oriented cross track.
* `PLANE` - Arbitrary plane with orientation other than the specific `XRGYCR` or `XCTYAT`.
\n\n
""") # type: str
TimeCOAPoly = _SerializableDescriptor(
'TimeCOAPoly', Poly2DType, _required, strict=DEFAULT_STRICT,
docstring="*Time of Center Of Aperture* as a polynomial function of image coordinates. "
"The polynomial is a function of image row coordinate ``(variable 1)`` and column coordinate "
"``(variable 2)``.") # type: Poly2DType
Row = _SerializableDescriptor(
'Row', DirParamType, _required, strict=DEFAULT_STRICT,
docstring="Row direction parameters.") # type: DirParamType
Col = _SerializableDescriptor(
'Col', DirParamType, _required, strict=DEFAULT_STRICT,
docstring="Column direction parameters.") # type: DirParamType
def __init__(self, ImagePlane=None, Type=None, TimeCOAPoly=None, Row=None, Col=None, **kwargs):
"""
Parameters
----------
ImagePlane : str
Type : str
TimeCOAPoly : Poly2DType|numpy.ndarray|list|tuple
Row : DirParamType
Col : DirParamType
kwargs : dict
image_plane = 'SLANT' if root_node.find('./generalAnnotation/productInformation/projection').text == \
'Slant Range' else None
# get range processing node
range_proc = root_node.find('./imageAnnotation'
'/processingInformation'
'/swathProcParamsList'
'/swathProcParams'
'/rangeProcessing')
delta_tau_s = 1. / float(root_node.find('./generalAnnotation/productInformation/rangeSamplingRate').text)
row_window_name = range_proc.find('./windowType').text.upper()
row_params = None
if row_window_name == 'NONE':
row_window_name = 'UNIFORM'
elif row_window_name == 'HAMMING':
row_params = {'COEFFICIENT': range_proc.find('./windowCoefficient').text}
row = DirParamType(SS=(speed_of_light/2)*delta_tau_s,
Sgn=-1,
KCtr=2*center_frequency/speed_of_light,
ImpRespBW=2. * float(range_proc.find('./processingBandwidth').text) / speed_of_light,
DeltaKCOAPoly=Poly2DType(Coefs=[[0, ]]),
WgtType=WgtTypeType(WindowName=row_window_name, Parameters=row_params))
# get azimuth processing node
az_proc = root_node.find('./imageAnnotation'
'/processingInformation'
'/swathProcParamsList'
'/swathProcParams'
'/azimuthProcessing')
col_ss = float(root_node.find('./imageAnnotation/imageInformation/azimuthPixelSpacing').text)
dop_bw = float(az_proc.find('./processingBandwidth').text) # Doppler bandwidth
ss_zd_s = get_image_col_spacing_zdt()
col_window_name = az_proc.find('./windowType').text.upper()
col_params = None