In this Chapter, the commands that are available from within Sherpa for displaying 1- and 2-D data are described.
1-D plotting within Sherpa may be performed using the LPLOT command:
sherpa> LPLOT arg # {UP | DOWN}
where # may specify the dataset (default dataset number is 1).
arg may be:
Argument: | To display: |
---|---|
BACK | The background data values. |
BACKERRORS | The background error values. |
{BACKFIT | BFIT} | The background data and the best-fit background model simultaneously. |
{BACKGROUND | BG} | The (unconvolved) background model amplitudes. |
BCHISQU | The contributions to the statistic in the background fit. |
BDELCHI | The residuals of the background fit ( ). |
BFILTER | The filter status of each background data point. |
{BFIT | BACKFIT} | The background data and the best-fit background model simultaneously. |
{BG | BACKGROUND} | The (unconvolved) background model amplitudes. |
BRATIO | The background data/model ratio value for each data point. |
BRESIDUALS | The residuals of the background fit ( ). |
BSTATISTIC | The contributions to the currently defined background fit statistic. |
CHI SQU | The contributions to the statistic. |
DATA | The source data. |
DELCHI | The residuals of the fit ( ). |
ERRORS | The source data error values. |
FILTER | The filter status of each data point. |
FIT | The source data and the best-fit source model simultaneously. |
modelname | The specified model component amplitudes (unconvolved). |
MODEL | The (convolved) source model amplitudes. |
RATIO | The data/model ratio value for each data point. |
RESIDUALS | The residuals of the fit ( ). |
SOURCE | The (unconvolved) source model amplitudes. |
STATISTIC | The contributions to the currently defined fit statistic. |
USERSTAT | The contributions to the user-defined fit statistic. |
WEIGHTS | The weight assignments for each data point. |
The modifiers UP and DOWN may be used with BACK, BACKERRORS, BACKFIT, and BACKGROUND. They relate specifically to the analysis of Chandra grating data and thus may be ignored in most applications.
Note: If there is no open plotting window when an LPLOT command is given, one will be launched automatically. Plotting display windows may be closed simply by closing the window with a mouse click.
In addition, 1-D plotting within Sherpa , of instrument responses stored in a Fits Embedded Function (FEF) file that is read in via FEFFILE (See Chapter 1, Section 1.33), may be plotted using FEFPLOT:
sherpa> FEFPLOT {photon_energy | photon_wavelength}
where {photon_energy | photon_wavelength} must be in the same units that are used for photon energies in the FEF file (conventionally, keV or Å).
sherpa> READ DATA 2 example.dat sherpa> LPLOT DATA 2The last command plots dataset number 2. Dataset number 2 must be a 1-D dataset.
sherpa> PARAMPROMPT OFF sherpa> SOURCE 2 = POLY[modela] sherpa> THAW modela.1 modela.2 modela.3 sherpa> GUESS SOURCE 2 sherpa> FIT 2 sherpa> LPLOT FIT 2Following a fit to dataset number 2, the last command plots the fit.
sherpa> FEFFILE "data/fef_response.fits[function] \ [ccd_id=0,chipx>=1,chipx<=256,chipy>=1,chipy<=32]" sherpa> FEFPLOT 2.4The appearance of the plot may be subsequently altered using ChIPS commands such as:
sherpa> LIMITS X 0 3 sherpa> REDRAW
Additional LPLOT command examples may be found throughout this Chapter, and in Chapter 1, Section 1.51.
There are two types of control commands for 1-D plots available from within Sherpa :
sherpa> SET lplot_option
where lplot_option may be:
Argument: | For the plot to: |
---|---|
PLOT AUTORANGE | Set the x-axis (Axis 0) range automatically, based on the data. |
PLOT ERRORBARS | Include symmetrical x-axis and y-axis error bars. |
Plots the data using a histogram. | |
PLOT LINEAR LINEAR | Use a linear scale along both axes. |
PLOT LINEAR LOG | Use a linear scale along the x-axis, and a logarithmic scale along the y-axis. |
Connects the data points with a line. | |
PLOT LOG LINEAR | Use a logarithmic scale along the x-axis, and a linear scale along the y-axis. |
PLOT LOG LOG | Use a logarithmic scale along both axes. |
PLOT NOERRORBARS | Not include error bars. |
PLOT RANGE min:max | Set the x-axis range for the plot. |
PLOT XERRORBARS | Include x-axis error bars only. |
PLOT YERRORBARS | Include y-axis error bars only (default setting). |
sherpa> PLOTX # {BIN | CHANNEL | ENERGY | WAVE}
where # may specify the number of the dataset (the default dataset is 1). The arguments {BIN | CHANNEL} specify that the x-axis units are to be the sequential bin numbers of the input data. For ENERGY, the units are those used to define the energies in the EBOUNDS extension of the input RMF file (although the plot label will specify keV by default). For WAVE, the units are those used to define the wavelengths in the BIN_LO and BIN_HI columns of the input PHA data (although the plot label will specify Åby default). If necessary, the user can change the label with the ChIPS command XLABEL.
Defining an instrument model automatically causes PLOTX to be changed to ENERGY or WAVE; the user does not normally have to apply this command. Also, changing PLOTX to ENERGY or WAVE will have no effect if an instrument model has not been defined (see Chapter 1, Section 1.46).
sherpa> PLOTY # {COUNTS | RATE}
where # may specify the number of the dataset (the default dataset is 1). If the user specifies COUNTS, the raw input data will be displayed (even if these data are not actually counts, but something else, such as fluxes). What is displayed if the argument RATE is given depends on whether (a) the exposure time is provided; (b) an ancillary response file (ARF) is provided; (c) the energy or wavelength grid is provided; and (d) the instrument model is defined (see Chapter 1, Section 1.46). The plot labeling function assumes exposure times in seconds, ARFs with effective area information in cm, and energies/wavelengths in keV/Å. If necessary, the user can change the label with the ChIPS command YLABEL.
sherpa> LPLOT # wind1 wind2 ...
where # sets the number of plotting windows and the arguments wind1 ... should each be replaced with a valid plotting command argument, which will be applied to the respective window. The arguments wind1 ... must be of the form arg {# | #:# | ALL}, where arg is any of the LPLOT arguments listed above, and where # specifies a dataset number (default dataset number is 1), or #:# represents an inclusive range of datasets.
Note that in the current version of Sherpa , only ChIPS plot control commands should be applied when working with multiple display areas (i.e. the Sherpa plot control commands SET, PLOTX, and PLOTY currently do not work properly with multiple plotting windows). See Subsection 2.2.3, Example 3.
Note that the LPLOT command must be issued, in order to see the results of previously issued SET, PLOTX, and/or PLOTY commands.
sherpa> DATA data/example.dat 1 2 sherpa> LPLOT DATA sherpa> SET PLOT NOERRORBARS sherpa> LPLOT DATA sherpa> SET PLOT RANGE 1600:1640 sherpa> LPLOT DATA sherpa> SET PLOT LOG LINEAR sherpa> LPLOT DATAThe first LPLOT DATA command produces a plot with default settings. The command SET PLOT NOERRORBARS sets for no error bars to be plotted, and then the LPLOT DATA command causes the plot to be redrawn with this new setting. Then the command SET PLOT RANGE 1600:1640 changes the Axis 0 (x-axis) range; the LPLOT DATA command causes the plot to be redrawn with this new setting. Next, the Axis 0 scale is changed to log scale, and again the plot is redrawn using the LPLOT DATA command.
Note that the following sequence of commands would also produce the same plot:
sherpa> DATA data/example.dat 1 2 sherpa> SET PLOT NOERRORBARS sherpa> SET PLOT RANGE 1600:1640 sherpa> SET PLOT LOG LINEAR sherpa> LPLOT DATA
Also note that the same plot may be produced using ChIPS plot control commands; see Section 2.2.3, Example 1.
sherpa> SET PLOT ERRORBARS sherpa> SET PLOT AUTORANGE sherpa> SET PLOT LINEAR LINEAR sherpa> LPLOT DATAFollowing the above example, this set of commands restores the plot to the original default setting.
The same plot may be produced using ChIPS plot control commands; see Section 2.2.3, Example 2.
sherpa> READ DATA 2 data/example.pha sherpa> RSP[instrumentA](data/example.rmf, data/example.arf) sherpa> INSTRUMENT 2 = instrumentA sherpa> SET PLOT NOERRORBARS sherpa> PLOTX 2 ENERGY sherpa> LPLOT DATA 2 sherpa> PLOTX 2 CHANNEL sherpa> LPLOT DATA 2 sherpa> PLOTY 2 COUNTS sherpa> LPLOT DATA 2The PLOTX 2 ENERGY command sets the unit type, for the x-axis of the plot, for dataset number 2, to energy. The next LPLOT command then plots dataset number 2 using this new Axis 0 setting. Note that the PLOTX command cannot be successfully issued without first defining the instrument model to be used (see Chapter 1, Section 1.46). The PLOTY 2 COUNTS command sets the unit type, for the y-axis of the plot, for dataset number 2, to counts. The next LPLOT command then plots dataset number 2 using this new Axis 1 setting.
sherpa> PLOTX 2 ENERGY sherpa> PLOTY 2 RATE sherpa> LPLOT DATA 2 sherpa> LPLOT 2 DATA 1 DATA 2The final command creates two drawing areas, and plots dataset number 1 in the first drawing area, and dataset number 2 in the second drawing area. Note that in this example, the command LPLOT 2 DATA 1 DATA 2 could be replaced with the simpler command LPLOT 2 DATA 1:2, or LPLOT 2 DATA ALL.
sherpa> ERASE ALL sherpa> DATA data/example1a.dat sherpa> SET PLOT NOERRORBARS sherpa> LPLOT DATA sherpa> STORE myplot1.chp sherpa> SAVE ALL mysession1.shp sherpa> ls myplot1.chp* myplot1.chp myplot1.chp.fits sherpa> ls mysession1.shp* mysession1.shp sherpa> EXIT Goodbye.The STORE command specifies that a record of the commands used to generate the plot be saved in an ASCII file named myplot1.chp. The STORE command also creates a FITS file that contains the plotted data (e.g. myplot1.chp.fits). The command SAVE ALL mysession1.shp is useful for saving the current state of the Sherpa session; the current session may be restored at a later time by using the mysession1.shp file as a Sherpa script. For example, after exiting Sherpa , one may restore the stored plot using the ChIPS command RESTORE:
sherpa> RESTORE myplot1.chp sherpa> SHOWAnd, one may also resume the saved Sherpa session using the Sherpa command USE:
sherpa> USE mysession1.shp sherpa> SHOWNote that when multiple curves have been plotted, the data for each curve is saved in a different extension of the STORE command's output FITS file. For example:
sherpa> PARAMPROMPT OFF Model parameter prompting is off sherpa> GAUSS[modela] sherpa> SOURCE 1 = modela sherpa> FIT powll: v1.2 powll: initial function value = 7.75333E-28 powll: converged to minimum = 3.54037E-28 at iteration = 9 powll: final function value = 3.54037E-28 modela.fwhm 15.8599 modela.pos 1615.64 modela.ampl 1.11265e-14 sherpa> SET PLOT NOERRORBARS sherpa> LPLOT FIT sherpa> STORE myplot2.chp sherpa> ls myplot2.chp* myplot2.chp myplot2.chp.fits sherpa> PRISM myplot2.chp.fitsExamination of the FITS file myplot2.chp.fits using Prism should show that the data are saved in the first FITS extension, and the fit data are saved in the second extension. See the ChIPS Reference Manual for further information regarding the ChIPS STORE and RESTORE commands.
Additional SET command examples may be found in Chapter 1, Section 8.80. Additional PLOTX and PLOTY examples may be found in Chapter 1, Sections 1.59 and 1.60, respectively.
All ChIPS commands are available from within Sherpa . See the ChIPS Reference Manual for complete ChIPS command definitions and further examples.
Note that ChIPS plot control commands require that a REDRAW command be issued, in order for the plot display to be updated.
sherpa> DATA data/example.dat 1 2 sherpa> LPLOT DATA sherpa> ERRS NONE sherpa> LIMITS X 1600 1640 sherpa> AXIS LOG X sherpa> REDRAWThe first LPLOT DATA command produces a plot with default settings. The ChIPS command ERRS NONE sets for no error bars to be plotted. The ChIPS command LIMITS X 1600 1640 changes the Axis 0 (x-axis) range. Next, the Axis 0 scale is changed to log scale. Note that the plot display is not automatically redrawn when ChIPS plot control commands are issued; the ChIPS command REDRAW must be issued.
The same plot may be produced using Sherpa plot control commands; see Section 2.2.2, Example 1.
sherpa> ERRS STANDARD sherpa> AXIS LINEAR X sherpa> LIMITS X AUTO AUTO sherpa> REDRAWFollowing the above example, this set of commands restores the plot to the original default setting.
The same plot may be produced using Sherpa plot control commands; see Section 2.2.2, Example 2.
sherpa> ERASE ALL sherpa> READ DATA 1 data/example.dat 1 2 sherpa> READ DATA 2 data/example2.dat 1 2 sherpa> LPLOT 2 DATA 1 DATA 2 sherpa> D 1 LABEL 1.0 15.0 "Drawing Area Number 1" sherpa> D 2 LABEL 1.0 55.0 "Drawing Area Number 2" sherpa> D 1 LIMITS X 1600 1640 sherpa> D 1 LOG X sherpa> REDRAWThe Sherpa plot control command LPLOT 2 DATA 1 DATA 2 produces two plot windows, each with default settings. Dataset number 1 is plotted in drawing area number 1, and dataset number 2 is plotted in drawing area number 2. The ChIPS plot control command D 1 LIMITS X 1600 1640 changes the Axis 0 (x-axis) range for the plot in the first drawing area. Next, another ChIPS plot control command changes the Axis 0 scale to log scale, for the plot in drawing area number 1.
sherpa> ERASE ALL sherpa> DATA data/example.dat 1 2 sherpa> PARAMPROMPT OFF Model parameter prompting is off sherpa> POLY[model1] sherpa> SOURCE = model1 sherpa> THAW model1.c0 model1.c1 model1.c2 sherpa> FIT sherpa> LPLOT FITWith the above commands, an ASCII dataset is input and then fit with a polynomial. The LPLOT FIT command produces a plot of the data and the resulting fit, with default settings.
sherpa> C 1 NOLINE sherpa> C 1 SYMBOL CROSS sherpa> C 2 SIMPLELINE sherpa> REDRAWThis plot possesses two curves: curve 1 is the data curve, and curve 2 is the fit function. In this example, ChIPS plot control commands are issued, to modify each curve of the plot. First, the data curve is changed to points, and then the points are changed to the cross symbol. Lastly, the fit function curve is changed to a line.
sherpa> LIMITS Y 0 4.25 sherpa> TICKVALS Y %1.1f sherpa> REDRAWThe Axis 1 (y-axis) lower and upper limits are modified, using the ChIPS LIMITS command. Then the ChIPS command TICKVALS is used to set the format for the y-axis tick labels.
sherpa> XLABEL "Arc Minutes" sherpa> YLABEL "SNR" sherpa> TITLE "HRC-I" sherpa> LABEL 5 0.5 "(0.606)+(0.419)X-(0.014)X^2" sherpa> REDRAWVarious ChIPS commands are issued to add Axis labels and a title. The last command places a label at the position of (5, 0.5).
sherpa> XLABEL BLUE sherpa> YLABEL BLUE sherpa> TITLE BLUE sherpa> LABEL RED sherpa> REDRAWThe label and title color attributes are modified using ChIPS commands.
sherpa> PRINT POSTFILE example_plot.psThis command prints the current plot to a PostScript file named example_plot.ps.
sherpa> ERASE ALL sherpa> CURVE data/example.dat x 1 y 2 sherpa> REDRAWWithin Sherpa , a dataset may be directly plotted from a file, using the ChIPS command CURVE. The above CURVE command plots the file data/example.dat; the first two columns of this ASCII data file are the x-axis and y-axis data.
sherpa> C 1 DEL sherpa> CURVE data/example.dat x 3 y 4 sherpa> REDRAWThis CURVE command plots the third and fourth columns as the x and y data. Note that the first curve is deleted before another CURVE command is issued. This deletion is necessary in this example, because each CURVE commands appends a curve to the plot (that is, successive CURVE commands do not overwrite each other, they instead overlay each other).
sherpa> ERASE ALL sherpa> CURVE data/example.dat x 1 y 2 XUP 3 XDOWN 4 sherpa> REDRAWIn order to utilize ChIPS commands for plotting errorbars, the ChIPS CURVE command must be used. The CURVE command given above plots data from the file data/example.dat; the first two columns are the x and y data, while the third and fourth columns are the positive and negative x-axis errorbars, respectively.
sherpa> C 1 DEL sherpa> CURVE data/example.dat x 1 y 2 xerr 3 sherpa> REDRAWThis CURVE command plots the first two columns as the x and y data, while the third column is read for symmetrical x-axis errorbars. Note that the first curve is deleted before another CURVE command for the same data is issued.
sherpa> ERASE ALL sherpa> CURVE data/example.dat x 1 y 2 YUP 5 YDOWN 6 sherpa> REDRAWThe CURVE command given above plots data from the file data/example.dat; the first two columns are the x and y data, while the fifth and sixth columns are the positive and negative y-axis errorbars, respectively. The plot may be changed to include only the positive y-axis errorbars, only the negative y-axis errorbars, both, or none:
sherpa> ERRS y UP sherpa> REDRAW sherpa> ERRS y DOWN sherpa> REDRAW sherpa> ERRS y BOTH sherpa> REDRAW sherpa> ERRS y NONE sherpa> REDRAW
sherpa> ERASE ALL sherpa> CURVE data/example5b.dat x 1 y 2 yerr 5 sherpa> REDRAWThis command plots the first two columns of data, and uses column five to plot symmetrical y-axis errorbars. The following commands are each equivalent to the above CURVE command:
sherpa> CURVE data/example5b.dat x 1 y 2 e 5 sherpa> CURVE data/example5b.dat 1 2 5
Filter regions may be specified from a plot, using the following steps:
This will set the data filter to either include (for NOTICE) or exclude (for IGNORE) the marked region of the dataset. Note that the character e may be used as an alternative to clicking the left mouse button.
See Chapter 1, Section 1.44, Examples 1 and 4.
Model parameter values may be assigned from a plot, using the following steps:
One may quit GETX or GETY by typing q, with the the previously assigned parameter value restored. Note, however, that if multiple parameter values are being set, only the one being altered when q is typed has its value restored.
See Chapter 1, Sections 1.39 and 1.40 for examples.
1-D overplotting within Sherpa may be performed using the OPLOT command:
sherpa> OPLOT curve_arg1 curve_arg2 ...
where the arguments curve_arg1 curve_arg2 ... should each be replaced with a valid plotting command argument of the form arg # {UP | DOWN}, such that arg is any of the OPLOT arguments listed below, and where # specifies a dataset number (default dataset number is 1).
arg may be:
Argument: | To display: |
---|---|
BACK | The background data values. |
BACKERRORS | The background error values. |
BFILTER | The filter status of each background data point. |
BACKGROUND | The (unconvolved) background model amplitudes. |
BRATIO | The background data/model ratio value for each data point. |
BRESIDUALS | The residuals of the background fit, in units of sigma. |
BSTATISTIC | The contributions to the currently defined background fit statistic. |
CHI SQU | The contributions to the statistic. |
DATA | The source data. |
ERRORS | The source data error values. |
FILTER | The filter status of each data point. |
modelname | The specified model component amplitudes (unconvolved). |
MODEL | The (convolved) source model amplitudes. |
RATIO | The data/model ratio value for each data point. |
RESIDUALS | The residuals of the fit, in units of sigma. |
SOURCE | The (unconvolved) source model amplitudes. |
STATISTIC | The contributions to the currently defined fit statistic. |
USERSTAT | The contributions to the user-defined fit statistic. |
WEIGHTS | The weight assignments for each data point. |
The modifiers UP and DOWN may be used with BACK, BACKERRORS, BACKFIT, and BACKGROUND; they relate specifically to the analysis of Chandra grating data and thus may be ignored in most applications.
Note: If there is no open plotting window when an OPLOT command is given, one will be launched automatically. Plotting display windows, may be closed simply by closing the window with a mouse click.
sherpa> DATA data/example1.dat sherpa> DATA 2 data/example2.dat sherpa> OPLOT DATA 1 DATA 2The OPLOT command causes both dataset number 1 and dataset number 2 to be plotted in the same window.
2-D imaging within Sherpa may be performed using the IMAGE command:
sherpa> IMAGE arg # {FILTERED | UNFILTERED}
where # may specify the dataset (default dataset number is 1). By default, filtered datasets are imaged.
arg may be:
Argument: | To display: |
---|---|
BACK | The background data values. |
BACKERRORS | The background error values. |
{BACKFIT | BFIT} | The background data and the best-fit background model simultaneously. |
{BACKGROUND | BG} | The (unconvolved) background model amplitudes. |
BCHISQU | The contributions to the statistic in the background fit. |
BDELCHI | The residuals of the background fit ( ). |
BFILTER | The filter status of each background data point. |
{BFIT | BACKFIT} | The background data and the best-fit background model simultaneously. |
{BG | BACKGROUND} | The (unconvolved) background model amplitudes. |
BRATIO | The background data/model ratio value for each data point. |
BRESIDUALS | The residuals of the background fit ( ). |
BSTATISTIC | The contributions to the currently defined background fit statistic. |
CHI SQU | The contributions to the statistic. |
DATA | The source data. |
DELCHI | The residuals of the fit ( ). |
ERRORS | The data error values. |
FILTER | The filter status of each data point. |
FIT | The data, the best-fit model, and the sigma residuals. |
modelname | The specified model component amplitudes (unconvolved). |
MODEL | The (convolved) source model amplitudes. |
RATIO | The data/model ratio value for each data point. |
RESIDUALS | The residuals of the fit ( ). |
SOURCE | The (unconvolved) source model amplitudes. |
STATISTIC | The contributions to the currently defined fit statistic. |
USERSTAT | The contributions to the user-defined fit statistic. |
WEIGHTS | The weight assignment for each data point. |
Note that if there is no open imager when an IMAGE command is given, one will be created automatically. Image display windows may be closed simply by closing the window with a mouse click. Also, the command CLOSE may be used to close an image display window.
sherpa> READ DATA 2 example_img.fit sherpa> IMAGE DATA 2The last command displays dataset number 2. Dataset number 2 must be a 2-D dataset.
Additional IMAGE command examples may be found in Chapter 1, Section 1.45.
Filter regions may be specified from an image, using the following steps:
This will set the data filter to either include (for NOTICE) or exclude (for IGNORE) the marked region of the dataset.
Also note: If you re-display an image following filtering, the filtered image data will be displayed if possible. There are some situations when this is not possible, however: currently, arbitrary filters cannot be passed from Sherpa to the imaging display. Instead, only rectangles can be passed. And, the rectangle that's passed is one that's the smallest possible around the noticed data. If this rectangle is not smaller than the dataset, then the entire dataset will be shown.
See Chapter 1, Section 1.44, Example 3; and Chapter 1, Section 1.55, Example 4.
2-D plotting within Sherpa may be performed using the CPLOT and SPLOT commands:
The CPLOT command causes the specified 2-D data to be displayed, with a contour plot, via ChIPS (Chandra Imaging and Plotting System):
sherpa> CPLOT arg #
The SPLOT command causes the specified 2-D data to be displayed, with a surface plot, via ChIPS (Chandra Imaging and Plotting System):
sherpa> SPLOT arg #
where # may specify the dataset (default dataset number is 1).
arg for either CPLOT or SPLOT may be:
Argument: | To display: |
---|---|
BACK | The background data values. |
BACKERRORS | The background error values. |
{BACKGROUND | BG} | The (unconvolved) background model amplitudes. |
BCHISQU | The contributions to the statistic in the background fit. |
BDELCHI | The residuals of the background fit ( ). |
BFILTER | The filter status of each background data point. |
{BG | BACKGROUND} | The (unconvolved) background model amplitudes. |
BRATIO | The background data/model ratio value for each data point. |
BRESIDUALS | The residuals of the background fit ( ). |
BSTATISTIC | The contributions to the currently defined background fit statistic. |
CHI SQU | The contributions to the statistic. |
DATA | The source data. |
DELCHI | The residuals of the fit ( ). |
ERRORS | The source data error values. |
FILTER | The filter status of each data point. |
modelname | The specified model component amplitudes (unconvolved). |
MODEL | The (convolved) source model amplitudes. |
RATIO | The data/model ratio value for each data point. |
RESIDUALS | The residuals of the fit ( ). |
SOURCE | The (unconvolved) source model amplitudes. |
STATISTIC | The contributions to the currently defined fit statistic. |
USERSTAT | The contributions to the user-defined fit statistic. |
WEIGHTS | The weight assignments for each data point. |
Note that, if there is not a plotting window currently open, any CPLOT or SPLOT command will automatically launch one. Plotting display windows may be closed simply by closing the window with a mouse click.
In addition, like LPLOT, surface and contour plots may be displayed into multiple windows:
sherpa> CPLOT # wind1 wind2 ...
sherpa> SPLOT # wind1 wind2 ...
where # sets the number of plotting windows and the arguments wind1 ... should each be replaced with a valid surface plotting command argument, which will be applied to the respective window. The arguments wind1 ... must be of the form arg {# | #:# | ALL}, where arg is any of the SPLOT arguments listed above, and where # specifies a dataset number (default dataset number is 1), or #:# represents an inclusive range of datasets.
In addition, 2-D plotting within Sherpa may be performed using the REGION-PROJECTION and REGION-UNCERTAINTY commands:
REGION-PROJECTION creates a contour plot of confidence regions, computed using the PROJECTION algorithm (See Chapter 1, Section 1.61). The command REG-PROJ is an abbreviated equivalent:
sherpa> REGION-PROJECTION dataset_range | ALLSETS modelname.{para mname | #} modelname.{paramname | #}
where dataset_range = #, or more generally #:#,#:#,..., such that # specifies a dataset number, and #:# represents an inclusive range of datasets; one may specify multiple inclusive ranges by separating them with commas. The default for REGION-PROJECTION is all datasets (ALLSETS).
modelname is the name that has been given to a model component by the user. Notice that either paramname or # may be used to specify the two thawed parameters to be analyzed. See Chapter 1, Section 1.66 for further information regarding this command.
REGION-UNCERTAINTY creates a contour plot of confidence regions, computed using the UNCERTAINTY algorithm (See Chapter 1, Section 1.85). The command REG-UNC is an abbreviated equivalent:
sherpa> REGION-UNCERTAINTY dataset_range | ALLSETS modelname.{par amname | #} modelname.{paramname | #}
where dataset_range = #, or more generally #:#,#:#,..., such that # specifies a dataset number, and #:# represents an inclusive range of datasets; one may specify multiple inclusive ranges by separating them with commas. The default for REGION-UNCERTAINTY is all datasets (ALLSETS).
modelname is the name that has been given to a model component by the user. Notice that either paramname or # may be used to specify the two thawed parameters to be analyzed. See Chapter 1, Section 1.67 for further information regarding this command.
sherpa> READ DATA 2 example2D.dat ASCII 1 2 3 sherpa> CPLOT DATA 2The last command plots dataset number 2 as a contour plot. Dataset number 2 must be a 2-D dataset.
sherpa> READ DATA 2 example2D.dat ASCII 1 2 3 sherpa> SPLOT DATA 2The last command plots dataset number 2 as a surface plot. Dataset number 2 must be a 2-D dataset.
sherpa> ERASE ALL sherpa> READ DATA example1.dat sherpa> PARAMPROMPT OFF sherpa> SOURCE = POLYNOM1D[my] sherpa> THAW my.c1 my.c2 sherpa> my.c0.min = -10 sherpa> FIT sherpa> REGION-PROJECTION.nsigma = 2 sherpa> REGION-PROJECTION.expfac = 4 sherpa> REGION-PROJECTION my.c0 my.c2 Region-Projection: optimization reset to Levenberg-Marquardt. computing grid size from covariance...done. Region-Projection: outer grid loop 20% done... Region-Projection: outer grid loop 40% done... Region-Projection: outer grid loop 60% done... Region-Projection: outer grid loop 80% done... Minimum: 0.255412 Levels are: 2.55141 6.43641
sherpa> ERASE ALL sherpa> READ DATA example1.dat sherpa> PARAMPROMPT OFF sherpa> SOURCE = POLYNOM1D[my] sherpa> THAW my.c1 my.c2 sherpa> my.c0.min = -15 sherpa> FIT sherpa> REGION-UNCERTAINTY.nsigma = 4 sherpa> REGION-UNCERTAINTY my.c0 my.c2 Region-Uncertainty: computing grid size...done. Region-Uncertainty: outer grid loop 20% done... Region-Uncertainty: outer grid loop 40% done... Region-Uncertainty: outer grid loop 60% done... Region-Uncertainty: outer grid loop 80% done... Minimum: 0.255412 Levels are: 2.55141 6.43641 12.0854 19.5904
Additional CPLOT, SPLOT, REGION-PROJECTION, and REGION-UNCERTAINTY command examples may be found in Chapter 1, Sections 1.22, 1.78, 1.66, and 1.67 respectively.
All ChIPS commands are available from within Sherpa (note, however, that axis limits on contour and surface plots may not be modified). See the ChIPS Reference Manual for complete ChIPS command definitions and further examples.
Note that ChIPS plot control commands require that a REDRAW command be issued, in order for the plot display to be updated.
sherpa> DATA data/example2D.dat ASCII 1 2 3 sherpa> CPLOT DATA sherpa> LEVELS 3 5 20 100 sherpa> REDRAWIn this example, a 2-D dataset is input to Sherpa and then displayed as a contour plot. The ChIPS LEVELS command changes the contour levels to 3, 5, 20, and 100 for contour lines 1 thru 4, respectively.
sherpa> SPLOT DATA sherpa> ZLABEL "This is the Z Axis" sherpa> REDRAWAfter a surface plot has been made, a label is added to the z-axis with the ChIPS command ZLABEL.
cxchelp@head.cfa.harvard.edu