The data viewer is a stand-alone EPICS scan data displaying system
that is written in pure IDL language.
It is able to directly process the files generated by the
data catcher. It also provides the option of converting the
machine-dependent binary data into platform-independent XDR binary
The data viewer is more efficient than the data
catcher in viewing the
1D/2D data because no external channel access monitoring is involved.
Data catcher uses 32 colors only. The viewer uses as many
colors as are available for the workstation when the viewer is invoked.
Now catcher and viewer supports both native binary format and
XDR format. They can automatically figure out the
format of data is saved on UNIX system.
The data viewer is written in IDL language and is composed of three
major sub-program modules: view1d, view1d_overlay,
view2d, and dcviewer.
It operates on the same set of data files generated by the data catcher
developed at APS/XFD.
The ez_fit curve fitting package can also be accessed from the
view1d or view2d program by selecting the desired data.
The complete program package of data viewer consists of following files:
os.init - Operating system configuration file
dcviewer.pro - Data Catcher Viewer main driver
view1d.pro - Data Catcher 1D scan data viewer
view1d.init - View1d variables initialization file
view1d_overlay.pro - Data Catcher 1D scan overlay data viewer
view2d.pro - Data Catcher 2D image viewer
view2d.init - View2d variables initialization file
view2d_help.txt - View2d simple on line help file
viewer - Unix script file to invoke data viewer
viewer_startup.pro - IDL_STARTUP file used by IDL unix system
viewer_startup.win - IDL_STARTUP file used by IDL window system
xdisplayfile.pro - X terminal window to display the text file
cw_term.pro - X terminal window to display the text file plus rename
rename_dialog.pro - File rename dialog
u_read.pro - Routines for read/write 1D/2D binary data
catch1d.tbl - Color table used by data viewer
plot1d.pro - General purpose multi-line 1D plot package
plot2d.pro - General purpose 2D plot package
ez_fit.pro - Easy fit curve fitting package written for IDL
fit_statistic.pro - Common FWHM calculation routines
scan1d__define.pro - Object metheds for accessing 1D data
scan2d__define.pro - Object metheds for accessing 2D data
scan2d_convert.pro - Object metheds for write/read TIFF/GIF data
scan2d_overlay.pro - A image overlaying method for 2D image data
scan2d_roi.pro - 2D ROI statistic program
calibra - Unix script to invoke stand-alone calibration program
calibdrv.pro - 1D/2D calibration setup program
calibra_factor.pro - 1D/2D calibration program
calibra_pick1d.pro - Column/row selection program coupled with calibration
multiroi_pick.pro - Mutiple 2D ROI statistic program
colorbar.pro - Colorbar configuration program
panimage.pro - Various panImage routines
xdr_open.pro - XDR open/read/write routines up to 4D arrays
assignname_read.pro - program to assign new preferred detector name
The viewer and viewer_startup.pro files are specially written for the
solaris/sun UNIX system for easy startup of data viewer. For the W2000 system,
the IDLDE's file preferences dialog should be used to set up the startup
file and environment.
The operating system configuration file is defined in os.init.
The current setting works for the UNIX and W2000 operating systems.
It is assumed that for the UNIX operating system the data viewer
is installed under the
$EPICS_EXTENSIONS/bin/$HOST_ARCH directory; for W2000, the data
viewer is installed under the C:\IDL directory.
The os.init is the IDL startup file required for running data
catcher and data viewer.
The system commands used by the catcher and viewer are defined
in this file. They can be tailored to correspond to different operating
systems. Currently only the UNIX and W2000 systems have been considered
and fully tested.
View1d is a generic IDL program specially written for displaying the 1D scan
data that were captured by the APS/XFD data catcher for the
EPICS scan record.
It shares the same input data files saved by the data catcher.
Starting from catcher R2.2.2B and later version both the 1D
and 2D data are automatically saved in the XDR binary format.
The default data saved by the earlier versions of data catcher are in
unformatted binary form which must be converted to XDR format in order to
port to PC.
If the 1D scan data are saved in XDR binary form, then the data are
For clarity, it is recommanded that the
file name convention adopted for XDR-type ends with a .xdr string.
Two examples are given below to show how to run view1d in IDL.
Example 1 shows the input file is specified on the command line.
Example 2 will use the file selection dialog
to pick the desired file. Be aware that on W2000 the file must be already
converted or saved in platform-independent XDR format.
View2d is a generic IDL program specially written for displaying
the 2D image data that were captured by the APS/XFD data
catcher for the EPICS scan record.
It shares the same image file saved by the data catcher.
If the 2D image data are saved in XDR binary form, then the data are
platform independent. Starting from catcher R2.2.2b 2D image data is
automatically saved in XDR format.
The default data saved by the earlier version of data catcher are
unformatted binary data which must be converted to XDR format in order to
port to PC. For clarity, it is recommanded that the
file name convention adopted for the XDR-type data ends with a .xdr
Run view1d :
IDL> view1d,data='scan.dat' ; example 1
IDL> view1d ; example 2
Two examples are given below to show how to run view2d in IDL.
Example 1 specifies the image file on the command line.
Example 2 will use the file selection dialog and the input data format
option to pick the desired file.
On W2000 the image file must be already in platform-independent XDR format.
Dcviewer is an integrated data catcher viewing program.
It integrates view1d, view1d_overlay and view2d
into a single system.
It also provides the option of converting binary data saved by the
data catcher to the platform-independent XDR format.
It requires that view1d, view1d_overlay and
view2d have been installed in the same directory.
Run view2d :
IDL> view2d,file='scan.dat.image' ; example 1
IDL> view2d ; example 2
Two examples are given below to show how to run dcviewer in IDL.
Example 1 lets the user freely access the view1d,
view1d_overlay or view2d.
Example 2 shows how to invoke the bi2xdr subprogram of the
dcviewer to convert the non XDR data to the
platform-independent XDR format.
(Starting from the catcher R2.2.2b all the data are automatically
saved in XDR format.)
The optional program bi2xdr must be
accessed on the operating system
where the raw data was originally captured, e.g. at the APS/XFD, this means
the sun or solaris system.
On W2000 data must be already converted or saved in XDR format.
Starting from viewer2.5.zip the sample data for catcher 1D and 2D
scans are stored under the DATA sub-directory. The user interface is
changed slightly, now a user can assign the detector names through
running VIEW2D program.
Run dcviewer :
IDL> dcviewer ; example 1
IDL> dcviewer,/XDR ; example 2
The scan2d_roi program with the option of saving filter ROI in the
intermediate file with file type suffixed with '_roi.pickfltr'.
The intermediate file can be loaded into the multiroi_pick
program for refineing the selected ROI.
A 'Change X Axis' sub-menu is added on the 'File' menu in VIEW2D
program. A user can display the image data with different positioner values
with this new feature.
Download the complete viewer package for IDL5.3 and later :
Viewer2c9.Tar.gz (Sept 02, 2003 - Updated)
Extract the Tar File:
tar xvf Viewer2c9.Tar
Refer to the program package section for a complete list of files in 'TarViewer'.
Download the sample 1D and 2D data package:
Extract the Tar File:
tar xvfFF DCSamples.Tar
The UNIX tar file 'TarDCSamples' constists of the following files:
junk2 - 1D scan data in XDR format
junk2.image - 2D image data in XDR format
viewer_startup.win - viewer startup file for window system
where all data files are generated in XDR format on the UNIX system. The
viewer_startup.win is the IDL startup file can be used for W2000 system.
Two cases of UNIX installation are considered here. In the first case,
the data viewer is installed under the normal system installation. (At
APS it is installed under the /usr/local/epics/extensions/bin/$HOST_ARCH
directory.) In the second case, the data viewer is installed in a
private data directory.
Run Viewer under normal installation:
setenv EPICS_EXTENSIONS /usr/local/epics/extensions
( Setup the environment variable EPICS_EXTENSIONS
to /usr/local/epics/extensions )
( Make sure the $EPICS_EXTENSIONS/bin/$HOST_ARCH
is in your command search path )
viewer ( Startup the data viewer )
Run Data Catcher Viewer with private installation :
( Assumed viewer package is installed in private
setenv IDL_STARTUP viewer_startup.pro
idl ( Startup the idl )
IDL> dcviewer ( Startup the data viewer )
Two ways of downloading the W2000 viewer are available either by zip file or by
If user has WinZip tool on his/her PC, then he/she can simply download the
If the user does not have WinZip tool on his/her PC,
then uses the downloading individual files method.
This zip file is prepared by the WinZip tool on W2000, the complete
package consists of data viewer program plus 1D and 2D test data.
viewer2.5.zip ( Sept 02, 2003 - Viewer 2.5)
viewer2.4.zip ( July 11, 2001 - Viewer 2.4)
viewer2.3h.zip ( April 27, 2001 - Viewer 2.3h)
A user can just use WinZip program to unzip the downloaded file. For
an example the viewer2.5.zip is used here.
A user simply unzips the file under C:\IDL\viewer2.5 directory.
Select IDL54 from the W2000 Start Programs Menu, the IDLDE will be started
automatically for you. First configure the IDLDE preference like the
following (you only need to do once or after you have reconfigured
IDLDE for some other IDL application).
First select the File->Preferences... from the IDLDE File Menu,
the Tab Startup to set the working directory and startup file like
below, then select the Tab Path to set the search path like below.
Main directory: C:\RSI\IDL54
Working directory: C:\IDL\viewer2.5\DATA
Startup file: C:\IDL\viewer2.5\viewer_startup.win
Path: (make sure all three directories are selected)
Once the IDLDE preferences are set like above you may start the viewer
by either W2000 Start->Program->IDLDE or by clicking any file shown
as IDL executable icon.
To run the data viewer just by clicking any file shown as IDL executable icon
in the C:\IDL\viewer2.5 directory will starts the data viewer for
you. The 1D scan test data is stored in junk2,
the 2D image test data is stored in junk2.image.
Within the viewer program, you can select the
view1d button to start VIEW1D program,
select the view1d_overlay button to start the 1D Overlay
program, or select the view2d button to start VIEW2D program.
Note: You have to manually create the following subdirectories in the
ASCII - for storing ASCII files
CALIB - for storing calibration generated files
ROI - for storing 2D ROI generated files
TIFF - for storing TIFF files
GIF - for storing GIF files
Before selecting the File->Open menu of the VIEW1D, VIEW2D, 1D_OVERLAY
the input data must be already saved in the 'XDR' format under W2000.
Please do not transfer the index file to W2000, because it is not
saved in XDR format. Only the platform-independent XDR-type
binary data can be loaded correctly.
Sometime for unknown reason that the XDR file ported from Unix are
not working on W2000 for IDL. Dcviewer failed to read in
the 1D scan
data for the XDR file. To get around this problem, a routine
written in IDL, 'catch1d_newIndexFile', should be used to
take care this problem.
This file should be installed in the same directory as where
This routine will allow the user manually generates a new index file for
the input file. After the new index file has been created, then the user
should be able to view the 1D data by using the dcviewer.
To generate new index file, at IDL prompt, enter the following:
It is assumed that the data catch1d.trashcan.xdr
resides in the d:\idl\viewer2.5\data
directory. At the completion of the above routine,
the catch1d.trashcan.xdr.index file will be created
in the same data directory.
WINDOW 95 SPAWN COMMAND
The idlspawn.pif is obtained from the RSI for sending postscript output
to the PC printer. This file must reside in the IDL50 directory where the
Last modified 09/02/03