About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/lplot.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 lplot Context: sherpa

Synopsis

Causes the specified 1-D data to be displayed, via ChIPS.

Syntax

sherpa> LPLOT [<num_plots>] <arg_1> [# [ID]] [<arg_2> [# [ID]] ...]

<num_plots> specifies the number of plotting windows to open within the
ChIPS pane (default 1); that number sets the number of subsequent
arguments. For each subsequent argument, # specifies the number of the
dataset (default dataset number is 1), and the ID modifier is used for
displaying background datasets, and then if and only if the Sherpa
state object variable multiback is set to 1, i.e., if more than one
background dataset is to be associated with a single source dataset.
The ID modifier may be any unreserved string (e.g., A, foo, etc.),
i.e., a string that is not a parsable command.

Description

The argument <arg_n> may be any of the following:

LPLOT Command Arguments

Argument Displays
{{DATA | DCOUNTS} | {BACK | BDCOUNTS}} The source|background data values (with errors)
{UDATA | UBACK} The unconvolved source|background data values (with errors)
{ERRORS | BERRORS} The estimated total errors for the source|background data values
{SYSERRORS | BSYSERRORS} The assigned systematic errors for the source|background data values
{STATERRORS | BSTATERRORS} The estimated statistical errors for the source|background data values
{{MODEL | MCOUNTS} | {BMODEL | BMCOUNTS}} The (convolved) source|background model amplitudes
{FIT | BFIT} The data (with errors) and model for source|background
{UFIT | BUFIT} The unconvolved data (with errors) and source model for source|background
{DELCHI | BDELCHI} The sigma residuals of the source|background fit: (data - model)/error
{RESIDUALS | BRESIDUALS} The absolute residuals of the source|background fit: (data - model)
{RATIO | BRATIO} The ratio (data/model) for source|background
{CHI SQU | BCHISQU} The contributions to the chi-square statistic from each source|background data point
{STATISTIC | BSTATISTIC} The contributions to the current statistic from each source|background data point
{WEIGHT | BWEIGHT} The statistic weight value assigned to each source|background data point
{FILTER | BFILTER} The mask value (0|1) for each source|background data point
{GROUP | BGROUP} The grouping value (1|-1) associated with each source|background data point
{QUALITY | BQUALITY} The quality value (0|2|5) associated with each source|background data point
<sherpa_model_stack> The (unconvolved) model amplitudes for the specified model stack (SOURCE, {BACKGROUND|BG}, [B]NOISE, or KERNEL)
<model_stack> The (unconvolved) model amplitudes for the specified user-defined model stack
<sherpa_modelname> The (unconvolved) amplitudes of the specified model component (e.g., GAUSS)
<modelname> The (unconvolved) amplitudes of the specified model component (e.g., g)
{ARF | BARF} The unfiltered source|background 1-D ARF file contents
{PSF | BPSF} The unfiltered source|background 1-D PSF file contents

If there is no open plotting window when an LPLOT command is given, one will be created automatically.

Related commands include:

  • IGNORE PLOT and NOTICE PLOT, which are used to interactively define filter regions from a plot display.
  • GETX and GETY, which are used to interactively define model component parameter values from a plot display.

The appearance of plots generated with this command can be changed by modifying the fields of certain state objects. See the ahelp for Sherpa or for sherpa.plot for more information.

NOTE: all ChIPS commands may be used from within Sherpa to modify plot characteristics. In order to view these changes, the REDRAW command must be issued.

The Display chapter of the Sherpa Manual has more information regarding data display capabilities, including modifying various plot characteristics.

Example 1

Display 1-D data:

sherpa> DATA 3 example.dat
sherpa> LPLOT DATA 3

The last command plots dataset number 3. Dataset number 3 must be a 1-D dataset.

Example 2

Exclude a data range and display the filtered range:

sherpa> DATA example.dat
sherpa> IGNORE ALL
sherpa> NOTICE FILTER 2:70
sherpa> LPLOT FILTER

The command IGNORE ALL clears any previous filters, then the next command defines a filter for dataset number 1. The last command displays the defined filter.

Example 3

Exclude a background data range and display the filtered background range:

sherpa> DATA example.dat
sherpa> BACK example_bkg.dat
sherpa> IGNORE BACK ALL
sherpa> NOTICE BACK FILTER 2:70
sherpa> LP BFILTER

The command IGNORE BACK ALL clears any previous background filters, and the next command defines a filter for the background of dataset number 1. The last command displays the defined background filter.

Example 4

Have plotted data written to output data files:

sherpa> ERASE ALL
sherpa> DATA data/example1a.dat
sherpa> sherpa.dataplot.x_errorbars = 0
sherpa> sherpa.dataplot.y_errorbars = 0
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 (a ChIPS command) specifies that a record of the commands used to generate the plot be saved in an ASCII file named myplot1.chp. The command SAVE ALL mysession1.shp is useful for saving the current state of the Sherpa session; it may then be restored at a later time.

This example also shows the use of a state object to modify the appearance of a plot (see the ahelp for sherpa.dataplot for more information).

Example 5

Display 1-D data, the fit, and the fit residuals, using two windows:

sherpa> DATA example.dat
sherpa> PARAMPROMPT OFF
Model parameter prompting is off
sherpa> POW[modela]
sherpa> SOURCE = modela
sherpa> FIT 1
sherpa> LPLOT 2 FIT RESIDUALS

This command displays a plot with the data and source model together in the first window, and a plot with the residuals of the fit in the second window.

Example 6

Display 1-D data and fit, for two different datasets, using two windows:

sherpa> DATA 2 example2.dat
sherpa> LPLOT 2 DATA 1 DATA 2

This command displays a plot with dataset number 1 in the first window, and dataset number 2 in the second window. The following commands are all equivalent:

sherpa> LP 2 DATA 1 DATA 2
sherpa> LP 2 DATA 1:2
sherpa> LP 2 DATA ALL

Example 7

Display 1-D fit and residuals for first dataset, and also display second dataset:

sherpa> LP 3 FIT 1 RESIDUALS 1 DATA 2

This command displays a plot with dataset number 1 and its fit in the first window, the residuals in the second window, and dataset number 2 in the third window.

Example 8

Plot multiple datasets:

sherpa> ERASE ALL
sherpa> DATA 1 data/example1.dat
sherpa> DATA 2 data/example2.dat
sherpa> DATA 3 data/example3.dat
sherpa> DATA 4 data/example4.dat
sherpa> LPLOT 4 DATA ALL

This LPLOT command plots all of the datasets, each dataset in a window -- dataset number 1 in the first window, dataset number 2 in the second window, etc. In this example, the following command produces the same result:

sherpa> LPLOT 4 DATA 1:4

Bugs

See the Sherpa bug pages online for an up-to-date listing of known bugs.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.