Saves a plot with all attributes.
The STORE command creates an ASCII file which
contains all the commands needed to re-create the current
plot display.
The <filename> is the name of the file to be created and
may contain a directory path.
This file can then be read into another ChIPS
session using the
RESTORE command.
This allows you to create a plot - perhaps in Sherpa - and
save it so it can be re-created or modified at a later date.
When storing plots created using the ChIPS
CURVE command, the store file will reference the
data file by name - including the full path.
If the plots were created without an associated data file -
for instance a Sherpa plot or data plotted
using the the S-Lang curve() function -
then the plot data will be written to a FITS file
called "<filename>.fits".
The one exception to this is for contour plots, when the
data for that plot is stored in the /tmp/
directory as an ASCII file.
chips> cd /work
chips> SPLIT 2
chips> D 1 CURVE data/data.dat
chips> D 1 CURVE data/fit.dat
chips> D 2 CURVE data/residuals.dat
chips> D 1 C 2 SYMBOL NONE
chips> D 1 C 2 SIMPLELINE
chips> D 1,2 LIMITS 0.0 11.0
chips> D 2 SYMBOL CIRCLE
chips> D 2 SYMBOL SIZE 1
chips> D 1 LIMITS Y 1.0 4.5
chips> D 2 LIMITS Y 0.0 4.5
chips> XLABEL "Off-Axis (arcmin)"
chips> D 1,2 YLABEL "SNR"
chips> TITLE "HRC-I 100ks"
chips> TITLE CYAN
chips> XLABEL CYAN
chips> D 1,2 YLABEL CYAN
chips> SPLIT GAP y 0.04
chips> D 1 TICKVALS X OFF
chips> D 1,2 TICKVALS y "%1.1f"
chips> STORE myplot.chp
After plotting some data and customizing the look of the plot, it is
stored to the file myplot.chp in the current directory. This is an
ASCII file the references the plotted data using full path
specifications; it may be restored from any location, as long as the
data has not been moved.
chips> $more myplot.chp
#This is a ChIPS state file.
#ChIPS_Version: 2.20
redraw off
##############################
# Start of a new drawing area.
##############################
drawarea 0.15 0.9 0.52 0.9
#######################
# Start of a new curve.
skip 0
curve "/work/data/data.dat"
#######################
# Start of a new curve.
skip 0
curve "/work/data/fit.dat"
symbol none
symbol 0 0
simpleline
(etc.)
chips> x = [0:10:0.02]
chips> y = tan(x)
chips> chips.curvestyle = _chips->simpleline
chips> chips.symbolstyle = _chips->none
chips> () = curve(x,y)
chips> limits y -10 10
chips> store tanplot.chp
Here we use S-Lang commands to create and plot
the curve y=tan(x).
As well as creating the file tanplot.chp,
the STORE command also creates the
file tanplot.chp.fits which contains
the data that was plotted.
Note that the store file does not record the contents of the
ChIPS State object. So, when the plot
is re-created via a call to RESTORE, it
will be drawn with no symbols and with a line connecting the
points but the chips.curvestyle and
chips.symbolstyle fields will not be set
to _chips->simpleline and _chips->none
respectively.
sherpa> READ DATA 1 data/example1.dat
sherpa> PARAMPROMPT OFF
Model parameter prompting is off
sherpa> POLY[modela]
sherpa> SOURCE 1 = modela
sherpa> THAW modela.2 modela.3
sherpa> FIT
sherpa> LPLOT FIT
sherpa> STORE myplotfromsherpa.chp
sherpa> ls myplotfromsherpa.chp*
myplotfromsherpa.chp
myplotfromsherpa.chp.fits
Here the STORE command is used from within Sherpa to save a plot
generated using the Sherpa command LPLOT. Two files have been
generated: the ASCII file with the plot commands and a FITS file that
contains the data. The data for each curve is stored in a separate
FITS extension:
chips> list myplotfromsherpa.chp.fits blocks
---------------------------------------------------------------------
Dataset: myplotfromsherpa.chp.fits
---------------------------------------------------------------------
Block Name Type Dimensions
---------------------------------------------------------------------
Block 1: PRIMARY Null
Block 2: curve0 Table 6 cols x 12
Block 3: curve1 Table 2 cols x 12
The [curve0] extension contains the input data and the
[curve1] extension contains the fit.
The format of the store file has changed slightly, in that
the first two lines now start with the "#"
character.
This means that you can now use them as ChIPS
command files - so if you did "STORE plot.chp"
you can now say
The old format store files will still work in ChIPS.
|