# Chaincode¶

class sunpy.roi.chaincode.Chaincode(origin, chaincode, **kargs)[source]

Bases: `numpy.ndarray`

Deprecated since version 3.0: The Chaincode class is deprecated and may be removed in version 3.1. Use sunpy.net.helio.Chaincode instead.

A tool to infer some information from chaincodes produced by HELIO Feature Catalogue or Heliophysics Events Knowledgebase.

Parameters
• origin (`numpy.ndarray`, `list`) – The 2 points of the origin of the chaincode.

• chaincode (`str`) – A list of the numbers (0-7) that indicate the path of the chaincode. 0 moves horizontally to the left and the rest follows anticlockwise.

• xdelta (`float`, optional) – The scale to convert between pixels and flat coordinates. Defaults to 1.0.

• ydelta (`float`, optional) – The scale to convert between pixels and flat coordinates. Defaults to 1.0

Returns

`numpy.ndarray` – An array containing all the x and y coordinates of the chaincode e.g., `[[x0, x1, x2, ..., xn], [y0 ,y1, y2, ..., yn]]`.

Examples

```>>> from sunpy.roi.chaincode import Chaincode
>>> cc = Chaincode([-88, 812], "44464655567670006011212222324",
...     xdelta=2.629, ydelta=2.629)
>>> fig = plt.figure()
>>> x,y = zip(cc.coordinates)
>>> ax.plot(x[0], y[0], 'go-')
>>> fig.show()
```

Methods Summary

 Extract the coordinates of the chaincode. `matchany`(coordinates, index) `matchend`(end) `subBoundingBox`([xedge, yedge]) Extract the x or y boundaries of the chaincode from a defined limits xedge or yedge.

Methods Documentation

BoundingBox()[source]

Extract the coordinates of the chaincode.

Returns in the form of `[[x0,x1],[y0,y1]]`.

area()[source]
length()[source]
matchany(coordinates, index)[source]
matchend(end)[source]
subBoundingBox(xedge=None, yedge=None)[source]

Extract the x or y boundaries of the chaincode from a defined limits xedge or yedge.