LinkFunctionRegistry#

class glue.config.LinkFunctionRegistry[source]#

Bases: Registry

Stores functions to convert between quantities

The members property is a list of (function, info_string, output_labels) namedtuples. info_string describes what the function does. output_labels is a list of names for each output. category is a category in which the link function will appear (defaults to ‘General’).

New link functions can be registered via

@link_function(info=”maps degrees to arcseconds”,

output_labels=[‘arcsec’])

def degrees2arcsec(degrees):

return degrees * 3600

Link functions are expected to receive and return numpy arrays

Methods Summary

__call__([info, output_labels, category])

This is provided so that registry instances can be used as decorators.

Methods Documentation

__call__(info='', output_labels=None, category='General')[source]#

This is provided so that registry instances can be used as decorators. The decorators should add the decorated code object to the registry, and return the original function