Loving ISIS - Confessions of a Former XSPEC User

 

Plotting:

ISIS plotting, like XSPEC plotting, is ultimately based upon PGPLOT. (On the other hand, any plotting package wrapped in S-lang potentially could be imported into ISIS and used instead. For example, ChIPS is currently undergoing a major rewrite, and will be S-lang wrapped, and will therefore be importable into ISIS.)

ISIS provides a number of intrinsic plotting functions based upon 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 residuals
These 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 .isisrc files.) The plotting functions that I have written are:

    Plot_Unit(); - Toggle among eV->TeV, A->m, and Hz->GHz
    plot_bsub_counts(); - Plot background subtracted data as counts/bin
    plot_bsub_all(); - Plot background subtracted data as counts/sec/Plot_Unit
    plot_bsub_model(); - Plot of just the background subtracted model
    oplot_bsub_model(); - Overplot the background subtracted model
    plot_residuals(); - Plot just the data residuals
    plot_unfold(); - Plot the unfolded spectra
    pg_color(); - Make a nice green, brown, pink, and dark gold for plots
    open_print(); - Open a plot device, invoking pg_color first
    close_print(); - Close the plot device, and optionally invoke gv or the like to view it
As regards the last command - plotting unfolded spectra - I direct readers to my conference proceedings rant against the nature of evil. I won't fully repeat that here, but will only have this to say about the use of XSPEC unfolded spectra: Don't. Ever. There's absolutely no denying that XSPEC has been of enormous benefit to the X-ray community for the past 15 or 20 years, and has enabled a great deal of progress. The one place where it has arguably done more harm than good is in its version of 'unfolded spectra' - the single most abused and misleading XSPEC plotting function. The ISIS version above does not repeat those sins. It still, however, should be used with some amount of caution (try it on a PCA spectrum dominated by a diskbb model, and you'll see what I mean...).

All of my plotting functions can be run in several ways. All take arrays of dataset indices, with plot preferences omitted (sensible defaults will used). If choosing plot preferences (e.g., data symbol, residual type, etc.), they can be input as an ordered list (not recommended - only there for backwards compatibility to very early versions of my scripts), input as pairs of keywords and values, or input as a structure variable, with structure field names corresponding to keywords and structure field values corresponding to the associated plot choices. All values/choices refer to PGPLOT color and symbol choices, e.g., 4 is blue when a color or a circle when a symbol. See the analysis script for examples of using both keyword/value pairs and structure variable setting of plot preferences. You can also use my defined function pg_info; to see some of the plotting choices that you have.

Here are a few examples of plots that you won't normally see coming out of XSPEC. 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. (The latter can be done in XSPEC. The former would take a little work.) Again, the same commands to create them interactively were the same commands used to create the hardcopies (via the ISIS intrinsic commands: id = open_plot(); ... plotting instructions ... close_plot(id);).


Plots

Next up: A quick summary.


This page was last updated Mar 22, 2006 by Michael Nowak. To comment on it or the material presented here, send email to mnowak@space.mit.edu.
Valid HTML 4.01! Made with JED. Viewable With Any Browser.