spatial.isis — Wrapper to ISIS Sensors

The spatial.isis module provides convenience functions for access ISIS sensor models.

New in version 0.1.0.

This module contains wrappers around the ISIS campt and mappt that are specific to understanding the relationship between pixels and projected coordinates.

autocnet.spatial.isis.get_isis_special_pixels(arr)[source]

Returns coordinates of any ISIS no data pixels. Essentially, np.argwhere results of where pixels match ISIS special data types (NIRs, NHRs, HIS, HRS, NULLS).

Parameters

arr (np.array) – Array to find special pixels in

Returns

np.array of coordinates in y,x format containing special pixel coordinates

Return type

sp

autocnet.spatial.isis.get_nodata_bounds(arr)[source]

Get bounds for an image that does not contain any ISIS special pixels. That is, ISIS Nulls, NIRS, NRS, HIS and HRS pixels

Parameters

arr (np.array) – 2D array representing the image

Returns

  • left_x – left x coordinate of new bounds

  • right_x – right x coordinate of new bounds

  • top_y – top y coordinate of new bounds

  • bottom _y – bottom y coordinates of new bounds

autocnet.spatial.isis.ground_to_image(cube_path, lon, lat)[source]

Returns a two-tuple of numpy arrays or a two-tuple of floats, where the first element of the tuple is the sample(s) and the second element are the lines(s) that represent the coordinate(s) of the input lon and lat in cube_path.

If lon and lat are single numbers, then the returned two-tuple will have single elements. If they are Sequences, then the returned two-tuple will contain numpy arrays.

Raises the same exceptions as point_info().

Parameters
  • cube_path (os.PathLike) – Path to the input cube.

  • lon (Number or Sequence of Numbers) – Longitude coordinate(s).

  • lat (Number or Sequence of Numbers) – Latitude coordinate(s).

autocnet.spatial.isis.image_to_ground(cube_path: os.PathLike, sample, line, lontype='PositiveEast360Longitude', lattype='PlanetocentricLatitude')[source]

Returns a two-tuple of numpy arrays or a two-tuple of floats, where the first element of the tuple is the longitude(s) and the second element are the latitude(s) that represent the coordinate(s) of the input sample and line in cube_path.

If sample and line are single numbers, then the returned two-tuple will have single elements. If they are Sequences, then the returned two-tuple will contain numpy arrays.

Raises the same exceptions as point_info().

Parameters
  • cube_path (os.PathLike) – Path to the input cube.

  • sample (Number or Sequence of Numbers) – Sample coordinate(s).

  • line (Number or Sequence of Numbers) – Line coordinate(s).

  • lontype (str) – Name of key to query in the campt or mappt return to get the returned longitudes. Defaults to “PositiveEast360Longitude”, but other values are possible. Please see the campt or mappt documentation.

  • lattype (str) – Name of key to query in the campt or mappt return to get the returned latitudes. Defaults to “PlanetocentricLatitude”, but other values are possible. Please see the campt or mappt documentation.

autocnet.spatial.isis.point_info(cube_path: os.PathLike, x, y, point_type: str, allowoutside=False)[source]

Returns a pvl.collections.MutableMappingSequence object or a Sequence of MutableMappingSequence objects which contain keys and values derived from the output of ISIS campt or mappt on the cube_path.

If x and y are single numbers, then a single MutableMappingSequence object will be returned. If they are Sequences or Numpy arrays, then a Sequence of MutableMappingSequence objects will be returned, such that the first MutableMappingSequence object of the returned Sequence will correspond to the result of x[0] and y[0], etc.

Raises subprocess.CalledProcessError if campt or mappt have failures. May raise ValueError if campt completes, but reports errors.

Parameters
  • cube_path (os.PathLike) – Path to the input cube.

  • x (Number, Sequence of Numbers, or Numpy Array) – Point(s) in the x direction. Interpreted as either a sample or a longitude value determined by point_type.

  • y (Number, Sequence of Numbers, or Numpy Array) – Point(s) in the y direction. Interpreted as either a line or a latitude value determined by point_type.

  • point_type (str) – Options: {“image”, “ground”} Pass “image” if x,y are in image space (sample, line) or “ground” if in ground space (longitude, latitude)

  • allowoutside (bool) – Defaults to False, this parameter is passed to campt or mappt. Please read the ISIS documentation to learn more about this parameter.