Loving ISIS - Confessions of a Former XSPEC User


Five Basics

The ISIS manual gives an overview of its commands and syntax, as well as an introduction to S-lang syntax in general. Once you've installed ISIS, starting it and running a script is as simple as:

   unix%> isis -g
   Welcome to ISIS Version 1.6.0-3
   Copyright (C) 1998-2010 Massachusetts Institute of Technology

   isis> () = evalfile("/path/my_script.sl");
   isis> () = evalfile("/path/.isisrc")        % Happens automatically if .isisrc
                                               % is placed in home directory
   isis> () = evalfile("./analysis_script.sl") % Run the analysis on these web pages
In the above, the -g option gives extra debugging information when running a script. Note the presence of ()= before evalfile. The evalfile returns a success/fail flag which otherwise would be "placed on the stack", and then "popped off the stack" and printed to screen, (The S- in S-lang stands for "stack".) The ()= captures and discards this value. For the case of multiple return values, let's say a, b, c, first a is placed on the stack, then b, then c. The "popping off the stack" happens in the reverse order: c, b, then a. This is the order they will print to the screen. Thus we would have:
   isis> returns_abc(); % Dump the output to screen
   isis> (a,b,c) = returns_abc();  % Capture the output to variables
   isis> (,,) = returns_abc();     % Discard the output
Once you've gotten used to that basic syntax, there are five other useful things to remember that will help you during an analysis session:
  • The who; command will give you a list of the variables that you have defined on the command line during the session (but won't list the global variables loaded from scripts).
  • The .apropos command (which doesn't require an ending semi-colon!) will give you a list of commands (including globally defined functions imported from scripts) that contain a given substring.
  • The .help command (which also doesn't require the semi-colon) will give you a help file for most ISIS intrinsic commands.
  • Many commands (including most of the functions defined by my .isisrc file) will give you a usage message if they are invoked without any arguments.
  • Any command name that you don't like you can alias to a name that you do like. Commonly used aliases and custom defined S-lang functions can be stored in your home directory in an .isisrc file, which will be loaded every time you start ISIS. (Invoking ISIS as: unix%> isis -n will run ISIS without loading your .isisrc)
With the five basics above you can find a good deal of information during an analysis session, and you can make life more familiar for yourself. Below is an example (where my .isisrc file has been loaded on startup):
   Welcome to ISIS Version 1.6.0-3
   Copyright (C) 1998-2010 Massachusetts Institute of Technology

   isis> a = [0:10]; b = 3.5; c = "pizza";
   isis> who;
   a: Integer_Type[11]
   b: 3.5
   c: pizza
   isis> .apropos load

   Found 26 function matches in namespace Global:
   add_to_isis_load_path      append_to_isis_load_path   autoload
   get_isis_load_path         get_slang_load_path        load_alt_ioniz
   load_arf                   load_buf                   load_conf
   load_data                  load_dataset               load_fit_method
   load_fit_statistic         load_kernel                load_line_profile_function
   load_model                 load_par                   load_radio
   load_rmf                   load_xspec_fun             load_xspec_local_models
   load_xspec_symbol          mt_load_model              prepend_to_isis_load_path
   set_isis_load_path         set_slang_load_path

   isis> .help load_arf
   Searched: /usr/local/isis/doc/local_help.txt
   Searched: /usr/local/isis/doc/cfitsio.hlp

       Load an effective area (ARF) file

       status = load_arf ("filename")

       This function loads either a FITS Type I or Type II ARF file;
       the updated list of currently loaded ARFs is automatically
       displayed. On return, status is equal to the integer index of
       the ARF just loaded ( status > 0); a return value of status =
       -1 is used to indicate failure.  (For Type II ARF input, a
       return value of zero indicates success).

       load_dataset, list_arf, delete_arf, assign_arf, unassign_arf

   isis> load_radio;

    radio_id = load_radio(radio_struct);

       Takes the structure output from `read_radio();' and loads
       it up for fitting.  Also ignores all the zero count
       channels.  (Note: Those could come back if any further filters
       are applied.)

   isis> alias("load_arf","arf");
   isis> alias("fit_fun","model");

Next up: Loading the Data.

This page was last updated Oct 7, 2013 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.