Introduction to Prism
CIAO 4.9 Science Threads
prism is a graphical user interface (GUI) application for file browsing and simple editing. It lists the extensions of a file and allows the user to view the header and data of each block. Prism offers many analysis features: interactive plots of column data, table editing, column-filtered viewing, and image display.
Last Update: 22 Dec 2014 - Review for CIAO 4.7; added more information about switching between read-only and edit modes.
- Getting Started
- Launching prism
- The Basic Display
- The Visualization Toolbar
- Customizing Plots
- Table Editing
- The Analysis Menu
- Closing prism
- Figure 1: GUI before loading a file
- Figure 2: prism GUI after loading an event file
- Figure 3: Opening files in tabs
- Figure 4: The prism toolbar
- Figure 5: Setting plot options
- Figure 6: Plot of RA vs Dec
- Figure 7: Plot of time va RA
- Figure 8: An image in (x,y) coordinates
- Figure 9: Histogram of energy (eV)
- Figure 10: Customizing a histogram with the ChIPS GUI
- Figure 11: Histogram modified from the ChIPS GUI
- Figure 12: Histogram modified from a ChIPS session
- Figure 13: Selecting a table entry for editing
- Figure 14: Entering an incorrect cell value
- Figure 15: Append Column to Table window
- Figure 16: Viewing the new column
- Figure 17: Append Row to Table window
- Figure 18: Viewing the new row
- Figure 19: Add Header Keyword window
- Figure 20: Viewing the new keyword
For illustration, this thread utilizes the ObsID 1843 (ACIS-I, G21.5-0.9) data that was downloaded in the How to Download Chandra Data from the Archive thread.
If this is your first time using CIAO, please read the Starting CIAO thread to ensure that your environment is configured properly.
Unlike the CIAO tools, prism does not have a parameter file. The GUI preferences - set from the "Edit → Preferences" menu - are stored in $HOME/.prismrc. The options are described in the ahelp file.
The CIAO GUIs use the default GTK theme specified on each user's machine to determine how the GUI is displayed (e.g. gray background with selected items in blue). Your GUI may look different than the one shown in screenshots in this thread, but the functionality is the same.
The help file on guis has instructions on how to change the default theme.
There are several options for starting up prism:
Do not give any arguments:
unix% prism &
An empty prism GUI (Figure 1) is opened.
A list of recently accessed files is maintained by prism and can be found in the "File → Recent" submenu. This displays a list of up to the last 10 files viewed; selecting any of the files reloads it. When storing the recently-viewed files, the path is considered part of the filename.
Specify the file name when prism is launched:
unix% prism acisf01843N003_evt2.fits &
Once a file is loaded, the GUI displays the information for that file, such as the data and header. Figure 2 shows the information for the file acisf01843N003_evt2.fits.
The file browser contains four main regions, as seen in Figure 2. The upper left shows the extensions, also called blocks, contained in the FITS file; the "interesting" block (e.g. EVENTS for an event file, SPECTRUM for a PHA file) is automatically chosen to be displayed. The upper right shows the header information of the block that's currently selected. The body of the GUI displays the data contents of the current block. A status window across the bottom of the application provides various feedback messages.
Note that some columns are vectors (e.g. chip and sky). By default, they are expanded inline in the data section. This is a data display option which may be set and saved to the preferences file.
It is possible to open several files in tabbed frames in a single instance of prism.
To open a file in a new tab, use the "File → Open New Tab" menu to select the file to open. There is also a "File → Recent New Tab" option which opens a recently-viewed file in a new tab. Figure 3 shows two files loaded in separate tabs.
Tasks which used to be run from a "Visualization" menu are now available from a toolbar in data display section of the GUI, which is outlined in Figure 4.
Each of the data visualization menus - "Plot", "Histogram", and "Image" - has two options: "Quick" and "Interactive".
Quick: takes the column(s) which are selected and makes a plot, histogram, or image with default settings.
Interactive: opens a window which allows you to change the selected columns and customize the output: linestyle, symbols, colors, etc. After the plot is created, the options window can be used to replot as often as desired by adjusting options and clicking "Apply". This allows the user to easily add errors to the plot, choose a different column, or overplot additional data, among other options.
Either option may be accessed from the drop-down menu by each visualization method. There is also a button that launches each method with the option defined in the preferences; by default, the plot and image buttons open the "Interactive" window and the histogram button creates a quick histogram.
Any two or three columns of data may be plotted within. This example will use the "Interactive" method of plotting.
Open the aspect solution file, pcadf084271087N003_asol1.fits, either in a new tab or within the existing one.
unix% prism pcadf084271087N003_asol1.fits &
- Highlight the desired two columns for plotting by clicking on the column name; the first column selected will be plotted along the x-axis, the second along the y-axis. In this example, ra and dec are plotted.
Click the "Plot" button to open the Plot Settings window. Alternately, you could choose the "Plot → Quick Plot" option.
Set the plot options. For this plot, the line style is set to "shortdash" and the symbol style is set to "none". The line color is changed to red (#f00f00); uncheck the "Default" box and then click the square to select the line color. Figure 5 shows the set options.
It is also straightforward to set these options in the ChIPS GUI after creating the plot.
Click "Apply" to create the plot and leave the options window open.
The plot of telescope RA vs. Dec is shown in Figure 6.
The plot settings window can be used to change or add to the plot options. To make a plot of time vs RA, choose "time" from the "Curve X" menu and "ra" from the "Curve Y" menu. The menus are populated with the columns from the data file.
After changing the line style to "solid" and setting the color to blue, click "Apply". The plot is updated, as shown in Figure 7.
Choose "OK" to close the plotting window when you are done.
Any two columns of data may be binned into an image and then displayed.
Open the event file, acisf01843N003_evt2.fits, either in a new tab or within the existing one.
- Highlight the desired two columns for binning by left-clicking on them. In this example, the x and y (sky) columns will be used.
Select the "Image → Quick Image" option.
ds9 is launched with the image loaded (Figure 8).
The default binning factor is 8. To select a different binning, use the "Image → Interactive Image" option and change the value in the image settings window.
A histogram is made from a single column. This example will use the "Quick" method of making a histogram.
The event file, acisf01843N003_evt2.fits, should still be loaded from the image example. If it is not, open it in prism again.
- Highlight the desired column for the histogram by clicking on the column name. The energy column is used in this example.
Select the "Histogram → Quick Histogram" option.
The default histogram binning is 50. To select a different binning, change the selected column, or customize the display, use the "Histogram → Interactive Histogram" option.
This histogram is used as the starting point for the Customizing Plots section. Leave the window open for the next step in this thread.
If you don't have one displayed already, create a histogram in prism before beginning this section.
The ChIPS GUI allows you to modify an existing visualization, e.g. change the symbol style and line color of a curve, adjust the limits and scaling of an axis, or resize a plot.
Right-click on the ChIPS window and select the Show GUI option to launch the GUI. In the Info panel, click to select the histogram object (“Histogram hist1” in Figure 10).
Using the color selector in the "Histogram Properties", set the Line Color to red and uncheck the Droplines box. Then select the "Symbols" tab and change the histogram symbol to "cross". The plotting window is updated automatically after each action is completed.
The modified histogram is shown in Figure 11.
When you are done modifying the histogram, "Print" can be used to send the plot to the printer or to save it in a file.
For more information on the GUI:
- Introduction to the ChIPS GUI thread
- the ahelp chipsgui page
- the Help/Reference Manual menu from the GUI
When a plot or histogram is created, an instance of the CIAO plotting program ChIPS is started to display the results. After connecting to this ChIPS session, any ChIPS commands can be used to modify the plot. For instance, changing the axes to log scale - an option which isn't available from the plot settings window.
Start ChIPS in any window in which CIAO is running:
unix% chips chips>
The list_servers() command shows the ids of the available ChIPS servers; in most cases there will only be one server running - the one created by prism.
chips> list_servers() ['ChipsServer_16803_1']
There is only one server running currently, so it must be the one used to make the histogram. When the histogram was created, a message prisms status box also indicated that this was the server used, e.g.:
Mon 25-Jan 16:55:03 Connected to chips server 'ChipsServer_16803_1'
The connect() command connects the ChIPS session to that server. Since there is only one server running, we have the option of omitting the server id:
Now the ChIPS session is aware of all the information relating to the histogram:
chips> info() Window [win1] Frame [frm1] Plot [plot1] (0.15,0.15) .. (0.90,0.90) Border bottom [bx1] top [bx2] left [by1] right [by2] X Axis [ax1] Y Axis [ay1] Histogram [hist1]
For instance, add symbols and set the line color to cyan:
chips> set_histogram("symbol.style=cross line.color=cyan")
The modified histogram is shown in Figure 12.
Since the plotting window is now attached to both the prism GUI and the ChIPS session, you can close prism and continue to modify and add to the plot from the xterm.
The ChIPS website has more examples of modifying plots.
To edit a table, you must have write permission for the file. The icon at the left edge of the file tab indicates whether the file has write permission (notepad) or not (lock).
Since prism currently does not support an undo option, all files opened in prism are locked to editing by default. Click the lock to unlock the file for editing or use the "Edit → Enable File Editing" menu option. The icon changes to a notepad when editing is enabled.
When switching to edit mode, users will be asked whether they wish to edit the current file in place, to make a copy of the file and edit it, or cancel to return to read-only mode.
To change the value of a cell, click on it and enter the new value. Collapsed vector or array columns must be expanded before they can be edited.
While in editing mode, <TAB>, <SHIFT>-<TAB>, and the arrow keys may be used to move through the rows and columns to select different cells.
When a new value is supplied, data type and range validation (if appropriate) are performed. If the change is invalid - e.g. a string provided for an integer column - the cell background is set to red (Figure 14). The status area also displays a message to indicate if a value had changed or a reason if an edited value did not change. In Figure 14, the error reads
Thu 08-Jan 14:06:24 Unable to convert d to datatype long (previous value=4)
The user must manually correct the error in the value.
To append a new column to the open table extension, select the "Append Column" from the "Edit" menu in the toolbar and a window (Figure 15) will appear. There are fields for the column name, units, and description fields, as well as a dropdown menu to set the data type. If "Array" or "Vector" is selected, an additional field specifies the number of array elements or vector dimensions.
Click "OK" to add the column (Figure 16).
To append a new row to the open table extension, select the "Append Row" from the "Edit" menu in the toolbar and a window (Figure 17) will appear. The new row can be seeded with the values of an existing row - chosen by the selector box or slider - or it can be created empty.
Click "OK" to add the row (Figure 18).
In the Header Keywords section of prism there are two buttons: "Add" and "Delete". Select "Add" and the Add Header Keyword window (Figure 19) opens. There are 4 text fields - keyword name, value, units, and comment string - as well as a dropdown menu to set the type.
Click "OK" to add the keyword (Figure 20).
The "Analysis" menu allows you to launch other CIAO tools from within prism; see the Introduction to the Analysis Menu thread for more information.
Prism and any remaining open windows that it launched may be closed by choosing "Exit" from the "File" menu.
|14 Dec 2004||reviewed for CIAO 3.2: no changes|
|01 Dec 2005||reviewed for CIAO 3.3: no changes|
|01 Dec 2006||updated for CIAO 3.4: ChIPS version|
|10 Jan 2008||updated for CIAO 4.0: in "Viewing ASCII data" section, ascii2fits script has been replaced by the Data Model ASCII kernel; parameter file updates; ChIPS syntax updated for version 4.0; filenames and images updated for reprocessed data (version N003 files)|
|13 Jun 2008||updated image display to place figures inline with text|
|09 Jan 2009||updated for CIAO 4.1: prism was rewritten in GTK, so some cosmetic changes (updated all thread images); the GUI has a preferences file instead of a parameter file; added Tabbed File Viewing section; undo last cell edit and column-filtered viewing are not available; new interactive options for making plots, histograms, and images; added Why does my GUI look different? section|
|25 Jan 2010||reviewed for CIAO 4.2: no changes|
|11 Jan 2011||reviewed for CIAO 4.3: no changes|
|19 Jan 2012||reviewed for CIAO 4.4: added a section on modifying plots with the ChIPS GUI|
|03 Dec 2012||Review for CIAO 4.5; updated all screen shots for lastest GUI; updated file versions.|
|03 Dec 2013||Review for CIAO 4.6; table edition section needs further review.|
|22 Dec 2014||Review for CIAO 4.7; added more information about switching between read-only and edit modes.|