pixelate_coord_path#

sunpy.map.pixelate_coord_path(smap, coord_path, *, bresenham=False)[source]#

Return the pixel coordinates for every pixel that intersects with a coordinate path.

Each pair of consecutive coordinates in the provided coordinate array defines a line segment. Each pixel that intersects with a line segment has the coordinates of its center returned in the output.

To obtain the values of these pixels, pass the output to sample_at_coords().

Parameters:
  • smap (GenericMap) – The sunpy map.

  • coord (SkyCoord) – The coordinate path.

  • bresenham (bool) – If True, use Bresenham’s line algorithm instead of the default algorithm. Bresenham’s line algorithm is faster, but simplifies each coordinate-path point to the nearest pixel center and can skip a pixel on the path if two of its neighbors are diagonally connected and also on the path.

Notes

If a pixel intersects the coordinate path at only its corner, it may not be returned due to the limitations of floating-point comparisons.

Returns:

SkyCoord – The coordinates for the pixels that intersect with the coordinate path.

Examples

Extracting intensity of a map along a line

Extracting intensity of a map along a line

Drawing and using a Great Arc

Drawing and using a Great Arc