GraphTable

class stsynphot.tables.GraphTable(graphfile, ext=1)[source]

Bases: object

Class to handle graph table.

Table is parsed with read_graphtable(). All string entries will be converted to lower case. Comment column is ignored.

Parameters:
graphfilestr

Graph table name.

extint, optional

FITS extension index of the data table.

Attributes:
keywordsarray of str

Keyword names.

compnames, thcompnamesarray of str

Components names (optical and thermal).

innodes, outnodesarray of int

Input and output nodes.

primary_areaastropy.units.quantity.Quantity or None

Value of PRIMAREA keyword in primary header.

Methods Summary

get_comp_from_gt(modes, innode)

Return component names for the given modes by traversing the graph table, starting at the given input node.

get_next_node(modes, innode)

Return the output node that matches an element from given list of modes, starting at the given input node.

Methods Documentation

get_comp_from_gt(modes, innode)[source]

Return component names for the given modes by traversing the graph table, starting at the given input node.

Note

Extra debug messages available by setting logger to debug mode.

Parameters:
modeslist of str

List of modes.

innodeint

Starting input node.

Returns:
components, thcomponentslist of str

Optical and thermal components.

Raises:
stsynphot.exceptions.AmbiguousObsmode

Ambiguous mode.

stsynphot.exceptions.IncompleteObsmode

Incomplete mode.

stsynphot.exceptions.UnusedKeyword

Unused keyword in mode.

get_next_node(modes, innode)[source]

Return the output node that matches an element from given list of modes, starting at the given input node.

If no match found for the given modes, output node corresponding to default mode is used. If multiple matches are found, only the result for the latest matched mode is stored.

Note

This is only used for debugging.

Parameters:
modeslist of str

List of modes.

innodeint

Starting input node.

Returns:
outnodeint

Matching output node, or -1 if given input node not found.