Skip to the navigation links
Last modified: 25 September 2018

URL: http://cxc.harvard.edu/sherpa/bugs/set_analysis.html

Caveats: set_analysis


Caveats

In order to specify a value for the set_analysis() 'type' argument, 'quantity' must also be specified.

If one provides a 'type' value to set_analyis(), but not 'quantity', the value entered for 'type' gets misinterpreted as the data set 'id' argument. To avoid this error, the 'quantity' argument must also be specified.

For example, if one types:

sherpa> set_analysis("3c273", type="counts")
ArgumentTypeError: 'quantity' must be a string 

an error results because the syntax gets interpreted as 'set_analysis(id=1, quantity="3c273", type="counts")', which does not make sense; the default data set 'id=1' is assumed instead of the intended 'id="3c273"', and "3c273" is incorrectly entered as the 'quantity' value.

Workaround:

To avoid this set_analysis() error, both the 'quantity' and 'type' parameters should be provided; e.g.:

sherpa> set_analysis("3c273", "energy", "counts")