Chaincode#
- class sunpy.net.helio.Chaincode(origin, chaincode, **kwargs)[source]#
Bases:
ndarrayA 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.net.helio.chaincode import Chaincode >>> cc = Chaincode([-88, 812], "44464655567670006011212222324", ... xdelta=2.629, ydelta=2.629) >>> fig = plt.figure() >>> ax = fig.add_subplot(111) >>> x,y = zip(cc.coordinates) >>> ax.plot(x[0], y[0], 'go-') >>> fig.show()
Methods Summary
area()Extract the coordinates of the chaincode.
length()matchany(coordinates, index)matchend(end)sub_boundingbox([xedge, yedge])Extract the x or y boundaries of the chaincode from a defined limits
xedgeoryedge.Methods Documentation