Kim Tolbert, 01 June 2018

The RHESSI objects are initialized to default values for all control parameters. You can override the defaults in a number of ways.
  1. Setting Your Own Defaults

    There are a number of ways to start the RHESSI software with custom defaults.

    1. Set your preferences in the object creation command. For example,

      obj = hsi_image(image_algorithm='clean, /uniform, image_dim=32)
      obj = ospex(spex_uncert=0.0)

    2. Script files: Put commands like the following to set any parameter into a script, and then run the script. For example,

      obj = hsi_image()

    3. Script files from the GUI: Use the Write Script button in the spectrum, image, or ospex widget to create a script after you've set the parameters you want in the widget. Then run the script to create an object with the same settings.

    4. Pass an existing object into the hessi GUI: To start the GUI with an object already set up with your preferred settings, pass the object into the GUI. For example, after you've created an object called obj from the command line using one of the methods above, start the GUI via


      This works for image, spectrum, monitor rate, or observing summary objects. Only one object can be passed into the GUI. Whatever time is set in that object will be used for the overall observing time interval in the GUI and will be transferred to each of the other objects within the GUI.

      As always, to manipulate the objects used internally in the GUI at the command line, you can retrieve any of them via the hessi_data command. Type hessi_data in SSWIDL for instructions on how to retrieve them.

    5. Set default parameters when you start the GUI: When you start the hessi GUI, any keywords you pass in as arguments will be set into the objects. For example,

      hessi, obs_time_interval=['20-Jan-2005 06:45:04.000', '20-Jan-2005 06:45:08.000'], image_alg='clean', sp_energy_bin=22

      This command will set those parameter values into the image and spectrum objects used in the GUI.

    6. Using a defaults text file. This method was implemented in March 2018.

      You can create a text file containing parameter=value pairs, one per line. A sample file might look like this:
      ; Full line comments are OK
      ; This is a sample personal defaults file created 4-Apr-2013
      modpat_skip =6
      use_phz_stacker =  1  ; inline comments are OK too

      This file will be used during object initialization to set parameters if you do one of the following (in this order of precedence):

      1. On the object creation command or the call to hessi, pass in the name of the file through keyword argument def_file, e.g.

        o=hsi_image(def_file = 'my_defaults.txt')
        hessi, def_file = 'my_defaults.txt'

      2. Set the environment variable HSI_DEFAULTS_FILE to point to the file, e.g.


      3. Name the file hsi_defaults.txt and put it in one of the three locations below.

      If the file specified in one of those three ways is a relative path, it is searched for in this order:

      1. current directory
      2. home directory
      3. $SSW/site/setup directory

      The routine hsi_user_defaults.pro is called in the INIT method for the top level image and spectrum objects to read the defaults text file and set the defaults into the objects.  Hsi_user_defaults.pro can also be called directory by the user any time after object creation to set the values in the defaults text file into the object.

    REMINDER: If you're not sure what the name of a parameter is, consult the tables of object parameters for rhessi objects. And if you still can't figure it out, send me a message.

  2. How to Use Old Defaults

    On rare occasions we change the standard defaults for the RHESSI objects.  So far this has happened in March 2007 and March 2011. To use the defaults in effect prior to those dates,  you can use the pre_apr2007 or pre_apr2011 keywords or environment variables as follows:

    1. Keyword option: When you create the hsi_image, hsi_spectrum, or ospex object, or when you start the hessi GUI, use the /pre_apr2007 keyword:

      obj = hsi_image (/pre_apr2007)
      obj = hsi_spectrum (/pre_apr2007)
      obj=ospex (/pre_apr2007)


      hessi, /pre_apr2011

    2. Environment variable option: Set the environment variable pre_apr2007 or pre_apr2011 to 1 before creating the image, spectrum, or ospex object.

      • In a Windows .bat file (e.g. sswidl.bat): set pre_apr2007=1
      • In a Unix script file: setenv pre_apr2007 1
      • Within SSWIDL:  setenv, 'pre_apr2007=1'

    Either of these methods will create objects that have the defaults that were in effect before the corresponding change. If you have a lot of scripts that you want to run with the old defaults you might want to use the environment variable option so you don't have to edit all of your scripts. If you set the environment variable in a startup file, REMEMBER that you set it so that you can unset it for new work.

    When we make changes to default values in the future, we'll add new keywords so you can select which defaults you want.