Chaincode

class sunpy.roi.chaincode.Chaincode(origin, chaincode, xdelta=1, ydelta=1)[source] [edit on github]

Bases: numpy.ndarray

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 (string) – 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) –
  • ydelta (Float) – The scale to convert between pixels and flat coordinates
Returns:

cc.coordinates (numpy.ndarray) – An array containing all the x and y coordinates of the cc such [[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()   
>>> ax = fig.add_subplot(111)   
>>> x,y = zip(cc.coordinates)   
>>> ax.plot(x[0], y[0], 'go-')   
>>> fig.show()   

Methods Summary

BoundingBox() Extract the coordinates of the chaincode [[x0,x1],[y0,y1]]
area() Place holder (no code)
length() Place holder (no code)
matchany(coordinates, index) not documented yet
matchend(end) not documented yet
subBoundingBox([xedge, yedge]) Extract the x or y boundaries of the chaincode from a defined limits xedge or yedge.

Methods Documentation

BoundingBox()[source] [edit on github]

Extract the coordinates of the chaincode [[x0,x1],[y0,y1]]

area()[source] [edit on github]

Place holder (no code)

length()[source] [edit on github]

Place holder (no code)

matchany(coordinates, index)[source] [edit on github]

not documented yet

Parameters:
  • coordinates (not documented yet) –
  • index (not documented yet) –
Returns:

  • not documented yet
  • .. todo:: – improve documentation. what does this function do?

matchend(end)[source] [edit on github]

not documented yet

Parameters:end (not documented yet) –
Returns:
  • not documented yet
  • .. todo:: – improve documentation. what does this function do?
subBoundingBox(xedge=None, yedge=None)[source] [edit on github]

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