Loving ISIS - Confessions of a Former XSPEC User | ||
add_plot_unit("sshps","btupas"; is_energy=1, xscale=5.353038e10, yscale=3274.3436 ); fancy_plot_unit("sshps","btupas"); plot_unfold({2,3};power=3,dsym={4,6},dcol={17,4}, xlabel="\\fs Energy (Slug\\.Sv\\.Hz/TSmoot)", ylabel="\\fs Flux (BTU/Acre/s)");Plotting: ISIS plotting, like XSPEC plotting, is ultimately based upon PGPLOT. ISIS provides a number of intrinsic plotting functions derived from the PGPLOT library. A partial list of some of the most basic plotting commands are: xlabel("string"); ylabel("string"); % X/Y Plot Labels id = open_plot("device"); close_plot(id); % Open and close PGPLOT devices xrange(#,#); yrange(#,#); % Set plot X/Y ranges charsize(#); point_size(#); % Character/symbol sizes plot(x,y); % Line/scatter plots oplot(x,y); % Line/scatter overplots hplot(xlo,xhi,y); % Histogram plots ohplot(xlo,xhi,y); % Histogram overplots plot_unit("unit"); % Toggle between A, keV, etc. plot_data_counts(id); % Plot counts/bin rplot_counts(id); % Plot counts, model, and residualsThese will get you a decent amount of functionality. One advantage that they do have over their XSPEC counterparts is that there is no difference between default plotting and interactive plotting. I.e., you do not have to 'drop down' into an IPLOT mode, perform your interactive plotting commands, then 'pop back up' into data analysis mode. It's all one and the same in ISIS. (You're always in analysis mode, and you're always interactive, unless, of course, you are running a script.)
My desire, however, for better plotting in ISIS led me to put a
number of wrappers around ISIS plotting commands. (This, in fact,
represents the bulk of my fancy_plot_unit(); - Toggle among eV->TeV, A->m, and Hz->GHz, ergs, Watts, mJy
add_plot_unit(); - Define new unit choices not covered in the above
pg_color(); - Make a nice green, brown, pink, and dark gold for plots
open_print(); - Open a plot device, invoking
close_print(); - Close the plot device, and optionally invoke
plotxy(); - Simple X/Y plots with error bars on either or both variables
plot_counts(); -Plot background subtracted data as counts/bin
plot_data(); - Plot background subtracted data as counts/sec/fancy_plot_unit
plot_fit_model(); - Plot of just the background subtracted model
plot_residuals(); - Plot just the data residuals
plot_unfold(); - Plot the unfolded spectra
diskbb model, and you'll see
what I mean...).
All of my plotting functions can be run in several ways. All will
take lists of dataset indices, with plot preferences omitted
(sensible defaults will be used). A plot_data(1); % Plot dataset 1 as counts/sec/X-unit
plot_data({1,2}); % Plot dataset 1 & 2 as counts/sec/X-unit
plot_data({1,[2,3]}); % Plot dataset 1, and the combination of datasets 2&3
[] , will be combined (so
long as they have a common energy/wavelength grid- if not, an error
will occur).
If choosing plot preferences (e.g., data symbol, residual type, etc.), they can be input either via a structure variable, or as qualifiers. The analysis script shows examples of both. All values/choices refer to PGPLOT color and symbol choices, e.g., 4 is blue when a color or a circle when a symbol. Additionally, the plotting routines can do all sorts of other crazy things: blue- or red-shift the plotted data, replace the X-axis with a velocity or redshift axis referenced to a specified wavelength or energy, plot the data with or without the background included, etc.
Here are a few examples of plots that you won't normally see coming
out of XSPEC. Immediately below on the left is the broken power
law/reflection model/diskline fit (yes, unfolded spectra, sorry)
showing the radio/PCA/HEXTE data vs. frequency, while the right is the
same model showing the RXTE detector space data vs. Angstroms. Again,
the same commands to create them interactively were the same commands
used to create the hardcopies (via the ISIS intrinsic commands:
![]() ![]() ![]() Plotting, Part II:
New as of Oct. 2013: I have added two new plot functions,
The following two plots were created with the commands: plot_comps(1,popt,&plot_unfold;res=3,power=3, yrange={1.01e-13,NULL,0.81,1.19}); plot_double(1,popt,&plot_unfold,&plot_data;res=3,power=3, yrange={1.01e-13,NULL,0.0051,NULL,0.81,1.19}); ![]() ![]() |
This page was last updated Oct 21, 2020 by Michael Nowak. To comment on it or the material presented here, send email to mnowak@physics.wustl.edu.
MIT Accessibility