Chaincode#

class sunpy.net.helio.Chaincode(origin, chaincode, **kwargs)[source]#

Bases: 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 (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()

boundingbox()

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 xedge or yedge.

Methods Documentation

area()[source]#
boundingbox()[source]#

Extract the coordinates of the chaincode.

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

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

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

Parameters:
  • xedge (list, optional) – A list of two values to check.

  • yedge (list, optional) – A list of two values to check.