Introduction to Prism
[CIAO 3.4 Science Threads]
OverviewLast Update: 1 Dec 2006 - updated for CIAO 3.4: ChIPS version Synopsis: Prism is a graphical user interface (GUI) application for file browsing. It offers many analysis features: interactive plots of column data, table editing, column-filtered viewing, and image display. |
Contents
- Getting Started
- Launching prism
- The Basic Display
- The Visualization Menu
- Table Editing
- The Analysis Menu
- Closing prism
- Parameter files:
- History
-
Images
- Prism GUI before loading a file
- Prism GUI after loading an event file
- Viewing a vector column
- Filtering on selected columns in a table file
- Plotting from Prism: Y_OFFSETS against TIME
- Binning the SKY to form an image
- "Histogram Preferences" dialog box
- Histogram of ccd_id column
- Selecting a table entry for editing
- Entering an incorrect value into a cell
- Viewing previous edits in the status window
- Appending a column to a table
- Viewing the new column
- Appending new rows to a table
- Viewing the new rows
- Editing header keywords
- Viewing the new header
Getting Started
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.
Like many other CIAO tools, prism has a parameter file that allows the user to set several preferences which are then used as the default value each time the tool is invoked. The file may be viewed with plist prism and the options are described in the ahelp file.
Launching prism
There are several options for starting up prism:
-
From a directory where you have a FITS file:
unix% prism &
The prism GUI should then appear on your screen. Open the desired datafile from within prism using the "Open" dialog box from the "File" menu.
A list of recently accessed files is maintained by prism and can be found in the "File -> Open List" submenu. This displays a list of (up to) the last 10 files viewed; selecting any of the files reloads it. Note that filter specifications and path names are considered part of the file name.
-
Alternatively, prism may be told to open a file when it is launched:
unix% prism acisf01843N001_evt2.fits &
Once a file is loaded, the GUI will look like Figure 2 .
The Basic Display
The file browser contains four main information windows. The upper left window 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 by prism to be displayed. The upper right window shows the header information of the block that's currently selected; the lower window shows 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). To further examine the contents of a vector column, left-click in the lower window to highlight it, then right-click to display a pop-up menu. From this menu, you may expand the column to show the actual data values. Expanding the sky column , shows the X and Y sky pixel positions for every photon detection recorded in the event file. To close the expanded vector window, click on the the "OK" button.
Column-filtered Viewing
It is also possible to view a table extension that has been column-filtered to your preference. This feature may be used to fit all the columns of interest in the prism data window, making it unnecessary to use the horizontal scroll bar. Left-click to highlight the desired columns in the order in which you would like them displayed. Then reload the file using the "Reopen w/ Selected" option from the "File" menu. Figure 4 displays the time, ccd_id, sky, and energy columns of the file.
Viewing ASCII Data
Prism is able to display simple ASCII files, including those in RDB format. If an ASCII file is selected, the ascii2fits script is run automatically to convert it to FITS format. The results are then displayed in the file browser. The format for ASCII files must therefore match that supported by ascii2fits, as described in the ahelp file.
The Visualization Menu
The follow sections all cover tasks that are run from prism's "Visualization" menu. This menu is available from the top bar of the GUI. It may also be invoked by right-clicking on any column in the main window; in this case, a pop-up menu is created.
Plotting Data
Any two columns of data may be plotted within prism:
- Highlight the desired two columns for plotting by clicking on them; the first column selected will be plotted along the x-axis, the second along the y-axis. If using a vector column, only a single column needs to be selected.
-
Select the "Interactive plot" task from the "Visualization" menu. This will result in the plot of the data, as well as an xterm window running a ChIPS session. This window may be used to customize the plot; see the Introduction to ChIPS thread for more information.
For example, open the acisf01843_000N001_aoff1.fits file (it's in the secondary directory); the ASPOFF block will automatically be loaded. Highlight the TIME and Y_OFFSETS columns in the lower window and select "Visualization -> Interactive plot". Figure 5 , which illustrates the temporal variation of the y-component of the spacecraft dither pattern, is created.
The equivalent ChIPS command used to plot these columns is:
unix% chips Welcome to ChIPS, version CIAO 3.4 Copyright (C) 1999-2003, Smithsonian Astrophysical Observatory chips> curve "acisf01843_000N001_aoff1.fits[cols time,y_offsets]"
If three columns have been selected, then the third column will be used as the symmetric error values for the "y" column. This column may either be a third scalar column or the third element in a vector column.
To create a hardcopy, use the "Visualization -> Print plot..." menu after plotting the data.
Creating Images
Any two columns of data may be binned into an image and then displayed within prism:
- Highlight the desired two columns for binning by left-clicking on them. Again, if using a vector column, only one needs to be selected for binning.
-
Select the "Interactive image" task from the "Visualization" menu.
For example, load acisf01843N001_evt2.fits and select the sky column for binning. After choosing "Interactive image", ds9 is launched with the image loaded . The binning factor used by prism (default of 8) can be changed in the "Edit -> Preferences" dialog box or with the binfactor parameter.
This task works by running the CIAO tool dmcopy to bin the sky pixel data and then displaying the resultant image:
unix% dmcopy "acisf01843N001_evt2.fits[bin x=8,y=8]" image.fits unix% chips Welcome to ChIPS, version CIAO 3.4 Copyright (C) 1999-2003, Smithsonian Astrophysical Observatory chips> display image.fits
To create a hardcopy, use the "Visualization -> Print image..." menu after imaging the data.
Histograms
Any single column may be viewed as a histogram.
- Highlight the desired column by left-clicking on it. In this case, it is not possible to use a vector column.
-
Select the "Histogram" task from the "Visualization" menu. This will result in the histogram, as well as an xterm window running a ChIPS session. This window may be used to customize the plot; see the Introduction to ChIPS thread for more information.
For example, load acisf01843N001_evt2.fits into prism again. Highlight the ccd_id column in the lower window and select "Visualization -> Histogram". The "Histogram Preferences" dialog box is launched, which is used to specify the binning for the histogram. In Figure 7 , we keep the "Data Min" and "Data Max" values, and set the number of bins to 8 (one for each CCD - numbered 0 to 7 -in the ACIS array that may have been on for this observation).
There is also the option to supply a "Bin File" instead; this is an ASCII or FITS file which which lists the lower and upper bounds of the bins to use for the binning. More information on this option is available from the ahelp file.
Click "OK" or "Apply" to generate the histogram; this may take a minute or two. The resulting plot looks like Figure 8 . Clearly the majority of the events occurred on CCD 7 (Chip S3).
To create a hardcopy, use the ChIPS print command:
chips> print
Table Editing
Note: to edit a table, you must have write permission for the file.
Cell Editing
To enter editing mode, <CTRL>-left-click on the desired cell. Once it is displayed in reverse video , type in the new value. To edit cell values of arrays or vector columns, expand the column and enter cell editing mode in the data matrix that is displayed.
While in editing mode, the up and down arrow keys may be used to cycle through rows to select different cells. Cycling through columns may be done by using the <TAB> key to move right or <SHIFT><TAB> to move left. Limited range, overflow, and type checking are provided; incorrect values will display an error dialog and a message in the status box. In addition, prism will automatically reset the entry back to its previous value.
Undo Last Cell Edit:
An undo option for cell edits can be accessed via the "Edit" menu's "Undo
Last Cell Edit" option. The undo option treats cell edits as a stack;
that is, they are undone in reverse order (edits 1, 2, 3 will be
undone as 3, 2, 1). When the "Undo Last Cell Edit" option is used,
the most recently edited cell is changed back to its prior value and
the status message box identifies the change. For example,
this status box shows that two
edits were done successfully and then undone in reverse order.
Note that cell edits may only be undone while the window displaying the data is still open. If edits are made to a vector column in an expanded window and the window is closed, the edits will be removed from the undo stack. Appending rows or columns flushes edits to the output file and deletes the entries in the cell editing undo stack. In both these cases, the undo option will no longer be available for the changes.
Append a Column/Row
-
To append new columns to the open table extension, select the "Append Table Column..." option from the "Edit" menu and a dialog window will appear. There are fields for the column name, data type, units, and description fields; if "Array" is selected, an additional field for the number of elements is provided.
Click "OK" or "Apply" to add the column ; a HISTORY keyword that column "colname" was added by prism is written to the block's header. Note that the values are not initialized to any specific value, so they may contain garbage.
- To append one or more rows to the open table extension, select the "Append Table Row(s)..." option from the "Edit" menu and a dialog box will appear. Enter the number of rows to append and click on "OK" or "Apply". Note that the values are initialized to zero . A HISTORY keyword stating that N rows were added by prism is written to the block's header.
The keywords are added to the raw header. To view them in prism, use "Edit -> Preferences" and select "Show raw header keys". Alternatively, you can use dmlist on the command line:
unix% dmlist acisf01843N001_evt2.fits header,raw . . (output omitted) . Key 545: CMT *HISTORY = Column NEW_COLUMN added in PRISM by egalle on Oct 1 16:02:12 2001 / Key 546: CMT *HISTORY = 3 rows appended in PRISM by egalle on Oct 1 16:03:32 2001 /
Editing Header Keywords
From the "Edit" menu, select the "Edit header..." option and a dialog box will appear on the screen. There are 3 text fields - keyword name, value, and comment string - that can be used to change an existing keyword or to add a new one. After typing in the desired values, click on the appropriate button, e.g. "Insert New Keyword". This will result in the keyword being added to the open header block.
The Analysis Menu
The "Analysis" menu allows you to launch other CIAO tools from within prism; see the Introduction to the Analysis Menu thread for more information.
Closing prism
Prism and any remaining open that it launched may be closed by choosing "Exit" from the "File" menu.
Parameters for /home/username/cxcds_param/prism.par #---------------------------------------------------------------------- # prism.par - Prism Application Preferences File #---------------------------------------------------------------------- numrows = 20 Number of rows in matrix numlines = 3 Number of lines in status area binfactor = 8 Eventlist column binning factor histbins = 50 Default number of histogram bins rangerows = 1000000 Row limit for automatic range calculations rangecols = 50 Column limit for automatic range calculations sortkeys = no Sort keywords alphabetically quickhints = yes Turn on/off all ToolTips changewarn = yes Warn before saving changes showss = yes Show data subspace in header window rawkeys = no Display raw keys in header window imgdisplay = yes Display image cells with lower left corner as (1,1) showunits = yes Show column units and data types in matrix table launchchips = yes Launch distinct chips process for interactive plotting (mode = ql) |
History
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 |