get_reg_proj
- sherpa.astro.ui.get_reg_proj(par0: str | Parameter | None = None, par1: str | Parameter | None = None, id: IdType | None = None, otherids: IdTypes | None = None, recalc: bool = False, fast: bool = True, min=None, max=None, nloop=(10, 10), delv=None, fac: float = 4, log=(False, False), sigma=(1, 2, 3), levels=None, numcores: int | None = None, copy: bool = True)
Return the region-projection object.
This returns (and optionally calculates) the data used to display the
reg_projcontour plot. Note that if the therecalcparameter isFalse(the default value) then all other parameters are ignored and the results of the lastreg_projcall are returned.Changed in version 4.19.0: The plot object is now copied by default. To get the previous behaviour set the
copyattribute toFalse.Changed in version 4.16.1: The log parameter can now be set to
Truefor one or both parameters.- Parameters:
- par0, par1
The parameters to plot on the X and Y axes, respectively. These arguments are only used if recalc is set to
True.- id
str,int,orNone,optional The data set that provides the data. If not given then all data sets with an associated model are used simultaneously.
- otherids
listofstrorint,orNone,optional Other data sets to use in the calculation.
- recalcbool,
optional The default value (
False) means that the results from the last call toreg_proj(orget_reg_proj) are returned, ignoring all other parameter values. Otherwise, the statistic curve is re-calculated, but not plotted.- fastbool,
optional If
Truethen the fit optimization used may be changed from the current setting (only for the error analysis) to use a faster optimization method. The default isFalse.- min
pairofnumbers,optional The minimum parameter value for the calculation. The default value of
Nonemeans that the limit is calculated from the covariance, using thefacvalue.- max
pairofnumber,optional The maximum parameter value for the calculation. The default value of
Nonemeans that the limit is calculated from the covariance, using thefacvalue.- nloop
pairofint,optional The number of steps to use. This is used when
delvis set toNone.- delv
pairofnumber,optional The step size for the parameter. Setting this overrides the
nloopparameter. The default isNone.- fac
number,optional When
minormaxis not given, multiply the covariance of the parameter by this value to calculate the limit (which is then added or subtracted to the parameter value, as required).- log
pairofbool,optional Should the step size be logarithmically spaced? The default (
False) is to use a linear grid.- sigmasequence
ofnumber,optional The levels at which to draw the contours. The units are the change in significance relative to the starting value, in units of sigma.
- levelssequence
ofnumber,optional The numeric values at which to draw the contours. This overrides the
sigmaparameter, if set (the default isNone).- numcores
optional The number of CPU cores to use. The default is to use all the cores on the machine.
- copybool,
optional Is the plot object copied before being returned? If so then the plot attributes will not be changed by multiple calls to this routine.
- Returns:
- rproj
asherpa.plot.RegionProjectioninstance The fields of this object can be used to re-create the plot created by
reg_proj.
- rproj
See also
confEstimate parameter confidence intervals using the confidence method.
covarEstimate the confidence intervals using the covariance method.
int_projCalculate and plot the fit statistic versus fit parameter value.
int_uncCalculate and plot the fit statistic versus fit parameter value.
reg_projPlot the statistic value as two parameters are varied.
reg_uncPlot the statistic value as two parameters are varied.
Examples
Return the results for the
reg_projrun for thexposandyposparameters of thesrccomponent, for the default data set:>>> reg_proj(src.xpos, src.ypos) >>> rproj = get_reg_proj()
Since the
recalcparameter has not been changed toTrue, the following will return the results for the last call toreg_proj, which may not have been for the r0 and alpha parameters:>>> rprog = get_reg_proj(src.r0, src.alpha)
Create the data without creating a plot:
>>> rproj = get_reg_proj(pl.gamma, gal.nh, recalc=True)
Specify the range and step size for both the parameters, in this case pl.gamma should vary between 0.5 and 2.5, with gal.nh between 0.01 and 1, both with 51 values and the nH range done over a log scale:
>>> rproj = get_reg_proj(pl.gamma, gal.nh, id="src", ... min=(0.5, 0.01), max=(2.5, 1), ... nloop=(51, 51), log=(False, True), ... recalc=True)