Esempio n. 1
0
def _create_measurement_v1(ortho_helper, bounds):
    """
    Construct the Measurement version 1.0 structure.

    Parameters
    ----------
    ortho_helper : OrthorectificationHelper
    bounds : numpy.ndarray
        The orthorectification pixel bounds of the form `(min row, max row, min col, max col)`.

    Returns
    -------
    MeasurementType1
    """

    proj_helper = ortho_helper.proj_helper
    if isinstance(proj_helper, PGProjection):
        # fit the time coa polynomial in ortho-pixel coordinates
        plane_projection = _create_plane_projection(proj_helper, bounds)
        return MeasurementType1(
            PixelFootprint=(bounds[1] - bounds[0], bounds[3] - bounds[2]),
            PlaneProjection=plane_projection,
            ARPPoly=XYZPolyType(
                X=proj_helper.sicd.Position.ARPPoly.X.get_array(),
                Y=proj_helper.sicd.Position.ARPPoly.Y.get_array(),
                Z=proj_helper.sicd.Position.ARPPoly.Z.get_array()))
    else:
        raise ValueError('Unhandled projection helper type {}'.format(
            type(proj_helper)))
Esempio n. 2
0
 def _create_measurement_v1():
     proj_helper = ortho_helper.proj_helper
     if isinstance(proj_helper, PGProjection):
         # fit the time coa polynomial in ortho-pixel coordinates
         plane_projection = _create_plane_projection(proj_helper, bounds)
         return MeasurementType1(PixelFootprint=(bounds[1] - bounds[0], bounds[3] - bounds[2]),
                                 PlaneProjection=plane_projection,
                                 ARPPoly=XYZPolyType(
                                     X=proj_helper.sicd.Position.ARPPoly.X.get_array(),
                                     Y=proj_helper.sicd.Position.ARPPoly.Y.get_array(),
                                     Z=proj_helper.sicd.Position.ARPPoly.Z.get_array()))
     else:
         raise ValueError(_proj_helper_text.format(type(proj_helper)))
Esempio n. 3
0
 def _create_measurement_v2():
     proj_helper = ortho_helper.proj_helper
     rows = bounds[1] - bounds[0]
     cols = bounds[3] - bounds[2]
     if isinstance(proj_helper, PGProjection):
         # fit the time coa polynomial in ortho-pixel coordinates
         plane_projection = _create_plane_projection(proj_helper, bounds)
         return MeasurementType2(PixelFootprint=(rows, cols),
                                 ValidData=((0, 0), (0, cols), (rows, cols), (rows, 0)),
                                 PlaneProjection=plane_projection,
                                 ARPPoly=XYZPolyType(
                                     X=proj_helper.sicd.Position.ARPPoly.X.get_array(),
                                     Y=proj_helper.sicd.Position.ARPPoly.Y.get_array(),
                                     Z=proj_helper.sicd.Position.ARPPoly.Z.get_array()))
     else:
         return None