def project_image_to_ground_geo(self, im_points, ordering='latlong', projection_type='HAE', **kwargs): """ Transforms image coordinates to ground plane WGS-84 coordinate via the algorithm(s) described in SICD Image Projections document. Parameters ---------- im_points : numpy.ndarray|list|tuple the image coordinate array projection_type : str One of `['PLANE', 'HAE', 'DEM']`. Type `DEM` is a work in progress. ordering : str Determines whether return is ordered as `[lat, long, hae]` or `[long, lat, hae]`. Passed through to :func:`sarpy.geometry.geocoords.ecf_to_geodetic`. kwargs The keyword arguments for the :func:`sarpy.geometry.point_projection.image_to_ground_geo` method. Returns ------- numpy.ndarray Ground Plane Point (in ECF coordinates) corresponding to the input image coordinates. See Also -------- sarpy.geometry.point_projection.image_to_ground_geo """ if 'use_structure_coa' not in kwargs: kwargs['use_structure_coa'] = True return point_projection.image_to_ground_geo( im_points, self, ordering=ordering, projection_type=projection_type, **kwargs)
def define_geo_valid_data(self): """ Defines the GeoData valid data corner points (if possible), if they are not already defined. Returns ------- None """ if self.GeoData is None or self.GeoData.ValidData is not None: return # nothing to be done # TODO: refactor geometry/point_projection.py contents into appropriate class methods # the below exception catching is half-baked, because the method should be refactored. try: valid_vertices = self.ImageData.get_valid_vertex_data(dtype=numpy.float64) if valid_vertices is not None: self.GeoData.ValidData = point_projection.image_to_ground_geo(valid_vertices, self) except AttributeError: pass
def define_geo_image_corners(self, override=False): """ Defines the GeoData image corner points (if possible), if they are not already defined. Returns ------- None """ if self.GeoData is None: self.GeoData = GeoDataType() if self.GeoData.ImageCorners is not None and not override: return # nothing to be done try: vertex_data = self.ImageData.get_full_vertex_data(dtype=numpy.float64) corner_coords = point_projection.image_to_ground_geo(vertex_data, self) except (ValueError, AttributeError): return self.GeoData.ImageCorners = corner_coords