XPROFILE MANUAL
Version 2002.0118
Table of Contents
Xprofile - interactive plotting software
These notes pertain to version 2002.0118
Xprofile ( data_files ) [-c] [-d] [-f] [-h] [-o]
[-m] [-t] [-x N] [-y N] [-z N] [-i N] [-v N]
Xprofile is a program used to graphically manipulate multidimensional
datasets, and to produce PostScript files that can be sent to a laser printer.
Xprofile is written in C and uses X windows. It is an X
upgrade of the program "PROFILE" but with many additional features. PROFILE
was written for SunWindows, and XProfile leans heavily on Xview to simplify
the conversion from SunWindows to X windows. The structure of the original
PROFILE code was adapted from the program XY.c written by Paul Wessel (then)
of LDGO and many of the conventions are the same.
Xprofile was developed on a variety of SUN workstations
running Solaris 2.x, and compatibility with other environments should not
be assumed. It is a fairly straightforward program, however, so modifications
should not be extensive. Xprofile requires a color monitor to work
properly.
-
data_files
-
specifies the data files to be read in for plotting. Wild cards can
be used.
| -c |
Connect individual points in the data files with lines |
| -d |
Dump the current default settings to the screen |
| -f |
The data file is a focal mechanism file. |
| -h |
Prints out the usage summary. |
| -o |
Reverse the order of the first two columns |
| -m |
The data files are map files. |
| -t |
The data files are Full Contour files. |
| -x N |
Read in the X argument as column N of a multi-dimensioned file |
| -x N |
Read in the Y argument as column N of a multi-dimensioned file |
| -z N |
Read in the Z argument as column N of a multi-dimensioned file |
| -i N |
Read in the ID as column N of a multi-dimensioned file |
| -v N |
Read in the Value argument as column N of a multi-dimensioned file |
Getting Started
To start XProfile, type "XProfile" and return. A window
will appear after a short time, composed of three main elements: a section
at the top with several buttons that generate windows for user input, a
section on the left side used to set options for the various files that
are read in, and a "canvas" on which pictures are drawn.
XProfile manages four types of files: (1) Multidimensional data sets, (2)
Maps, (3) Contourable data with values specified on a regular grid, and
(4) Focal Mechanisms.
Multidimensional data sets
Multidimensional data sets consist of ASCII files with up to five
columns of information, with each row corresponding to a given point.
Xprofile
will always try to read in X and Y, although these could be assigned to
the same column (in which case the plot will be a straight line). The default
is for Y to be in the first column and X to be in the second column (this
is because lat-lon files usually have lon first). The remaining three columns
are optional and can represent two numerical values associated with the
point and an ASCII identifier. At present the ASCII identifer cannot have
any blank spaces; use underscores (sorry). The other two possible columns
are called "Z" and "Value" columns and either or both (or neither) may
be read in. At present up to 8 columns of data can be parsed. It is a matter
of trivial reprograming to make this number larger.
The multidimensional data set is the default file type, and up
to 50 of them may be read in. Each dataset may contain up to 20000 points.
The program will abort if either of these dimensions are exceeded.
Maps
Maps are ASCII files containing points that are connected together
with lines and may be filled with shades or patterns. The format of a map
file is as follows: the first line is in integer indicating the number
of independent contours or "islands" in the map file. The next line is
the number of points that describe the first contour. This line is followed
by (Y,X) ordered pairs (e.g., latitude and longitude), and this is repeated
for the total number of contours. (Note that there is a read option that
allows you to interchange (Y,X) for (X,Y) is you need to do so). As an
example, the following lines could be read in as a map file to draw two
boxes on the screen:
2
5
0. 0.
0. 1.
1. 1.
1. 0.
0. 0.
5
-1. -1.
-1. 2.
2. 2.
2. -1.
-1. -1.
Contourable data sets
Contourable data sets are those in which Z values are specified
on a regularly spaced grid, and XProfile will attempt to either shade or
draw in lines of equal value between the grid spaces. There are two different
kinds of contourable data sets, the "full contourable" and the "compressed
contourable". In the "full contourable" file a value is specified for each
grid point, while for the "compressed contourable" only non-zero values
are specified.
An example of the full contourable file is as follows:
250.0 -430.0 12.0 10.0
84 50 0 0 0
5.460
5.460
5.460
5.460
5.460
5.460
5.460
5.460
... (more lines)
The first line gives the location of the upper left corner of the grid.
In this case it is at (y=250., x=-430.). The next two numbers are the spaces
between the grid points in the x and y directions (dx = 12, dy=10). The
first two numbers on the second line are the number of points in the x
and y directions (84 in x, 50 in y). The third is "iconst"
which =0 for a constant grid (as specified by dx and dy) and =1 for a variable
spaced grid. An example of iconst=1 is given below. The fourth
is "irase" which will prevent the program from plotting the zero
value if =1. This can be handy when plotting topographic maps near
an ocean. The last number is interp, which, if =0, tells the
program to interpolate colors between grid points, and if = 1 to use the
nearest grid value to determine color. The lines that follow are
the values at the grid points. There should be (at least) 84x50 of these
is the file.
An example of the full contourable file with a variable grid is as follows:
250.0 -430.0 12.0 10.0
4 2 1 0 0
1. 1.
1. 2.
1. 3.
1. 4.
2. 1.
2. 2.
2. 3.
2. 4.
5.460
5.460
5.460
5.460
5.460
5.460
5.460
5.460
... (more lines)
In this case we have 4 x grid points and 2 y grid points.
Lines 3-11 specify the (4 x 2) locations of the grid points, first looping
over the x coordinates (with y constant). This is
then followed by 8 values.
An example of the "compressed contourable file" is as follows:
24.5 120.5 2.50000E-02 2.50000E-02
50 41 1 0 0
24 11 .396902
25 11 .1160919
24 12 .1175342
25 12 9.51509E-02
26 12 9.62864E-03
23 10 2.07099E-02
24 10 1.23623E-02
25 10 1.11698E-03
.... (more lines)
The first line is the same as above. In this case the origin is at (y=24.5,
x=120.5) and the grid spacing in both directions is (0.025). There are
50 grid points in the x direction and 41 in the y direction, but now we
will specify only the locations of the points where values are not = 0.
The line
24 11 .396902
says that at grid point (x = 24, y = 11) the value is 0.396902.
Focal Mechanisms
Focal mechanisms are specified by single line entries, as shown
in the following example:
15. 5. 45. 88. 178. 0. 0. 32
The numbers in line represent, sequentially, Y location, X location, Strike,
Dip, Rake (each in degrees), X displacement, Y displacement, and the Size
in Bits.
In the upper window there are several buttons which, when selected, will
pop up a window for user input.
-
READ
-
This button brings up a window for inputing the names of data files to
be read in. The file name and directory are typed in the first two input
rows, and the data file type and other options are selected in the buttons
above. The first four selectable options are for the default data sets,
and tell the program how many (and which) columns are to read in. The next
four tell the program if the data set is a map or contourable data set
or a focal mechanism set. The final option reverses the order of the first
two columns; by default the first column is y and the second is x. The
lower six lines allow the user to offset and scale the x, y, and z values
in the dataset. Note that this scaling is irreversible so that the dataset
needs to be read in again if a mistake is made.
-
When the information is correct select "OK", or, if you want to quit, select
"CANCEL". Up to 50 data sets and 50 maps can be read in. Note that once
a data set is read in it becomes the "Current" data set or map.
-
DRAW
-
This button draws a picture on the screen, using the selected maps and
data sets. The program will determine the maximum and minimum values for
the plot based on the data read in, but these can be changed by typing
in new ones. There are several options for setting ticks (the program tries
to make an intelligent choice, but this can always be overruled). Note
that tick marks will "reset" after a certain change of value if desired.
The reason for this is to allow several plots to appear on the screen with
the correct axes. A good strategy for viewing multiple graphs is to use
either the X or Y offset buttons to move subsequest graphs to a different
location, and then set the "reset" value to match the offset.
Also note that changes to the Z variable range are made using the "SET
CONT" option. The Header and X label will be shown at the bottom of the
screen, but the Y label will not (thanks to some problem with X Windows
handling vertical text). The final button allows the current palette to
be drawn as part of the picture (see also SHOW PAL).
-
DELETE
-
Allows the user to delete some set of data sets, either only the
current data set of all of the selected data sets.
-
SEL PLOT
-
This button allows the user to select which datasets to plot on the
screen (or to delete).
-
SEL SECT
-
This button allows the user to specify which datasets will be included
in a cross section.
-
NEXT
-
Makes the next data set in the list the current data set
-
PREVIOUS
-
Makes the previous data set the current data set.
-
VIEW SECT
-
Creates a new window to look at data in a section.
-
PS-DUMP
-
Creates a PostScript file that can be sent to the printer
-
PS-PREF
-
Allows the user to select various options for the PostScript file
such as the file name and orientation of plot.
-
DEL MAP
-
Allows the user to delete some set of maps, either only the current
map of all of the selected maps.
-
SEL MAP
-
Allows the user to select which maps to plot on the screen.
-
MAP++
-
Makes the next map the current map
-
MAP--
-
Makes the previous map the current map
-
MAP PREFS
-
This is used to specify the parameters used in calculating the various
projections available, for example the latitude used in calculating the
short distance projection when using latitude-longitude data.
-
PLOT PREFS
-
This contains some parameters used in plotting that have been removed
from the main screen as they are not as often selected (by me, anyway).
Current options:
-
Header fontsize
-
Size of the font for the header to use in the PostScript plot. No
effect on the screen.
-
Font
-
(Several Choices) This is the font to use in the PostScript
plot. No effect on the screen.
-
Annotation Fonsize
-
Size of the font for axes to use in the PostScript plot. No effect
on the screen.
-
Background
-
Set a color for the background of the plot (solid within the bounds
of the axes). Default is white.
-
SET CONT
-
This sets the contour intervals and base level for contouring, and
the pixel interval when shading. The program tries to make an intelligent
choice of contour interval based on the maximum and minimum values in the
data set. Note that "thick" and "thin" lines may show up the same on the
screen but will be different in the PostScript file. The "base value" is
the value from which contours are calculated, and no value less than the
base value is contoured. The screen will be redrawn after this is selected.
-
READ MACRO
-
Reads in and performs functions according to a Macro file (see below)
-
WRITE MACRO
-
Writes a macro that the user can use to recreate a picture on the
screen.
-
READ PAL
-
Read in a palette.
-
SHOW PAL
-
Draw the current palette on the screen.
-
WRITE DATA
-
Output current datafile to another ASCII file.
-
DEL FM
-
Delete a focal mechanism file
-
SEL FM
-
Select (or deselect) focal mechanism file
-
QUIT
-
Quit.
In the window on the left side are a number of options that can be set
for the overall plot. These are:
-
Projection type
-
Current options are:
| Linear XY |
Linear X vs Y |
| Short_Dist Projection |
Convert Lat/Lon to distance |
| Azimuthal-Equidistant |
Convert to Az-Eq about specified origin |
| UTM Projection |
Universal Transverse Mercator |
| Hypit Projection |
Uses the HYPIT dist routine |
-
Draw grid
-
(Just like it sounds).
-
X positive right/Y postive up
-
Use these to reverse the directions of the plot.
-
Show labels
-
If you have entered labels in the plot, you can select this option
to remove them temporarily.
-
Equal X-Y Scaling/Full Screen
-
Sets the scaling for the plot. If Full Screen, the entire screen
is used, and for Equal X-Y Scaling the units in x and y are taken to be
the same.
-
# decimals in X/Y/Z annotation
-
Number of decimal places in the axis labels. This will also change
on the screen.
At the bottom of the window on the left side are several options that can
be set for each file that is read in. Note that the options that appear
in this area are for the CURRENT FILE. To reset the options for any other
file you need to use the NEXT and PREVIOUS buttons to set the file you
wish to the current file and then change the options for it.
-
Symbol type
-
this is the type of symbol used in plotting. In addition to 5 shapes
(cross, circle, square, diamond, triangle), you can choose "no symbol"
to not have any point or "item number" to plot the line number of the item
in the file, or "Z entries" or "Value entries" to plot either of these
numbers.
-
Plot ID's
-
If you read in ASCII identifiers with the file, you can use this
option to make them appear on the screen.
-
Connect Points
-
Select this if you want to connect points in the order they were
read in. There is an option "Connect every second point" which is useful
for drawing lines.
-
Symbol Size
-
Just like it sounds. Note that if Z values are read in, the size
can be scaled to Z (using the last option on the list).
-
Penwidth
-
the width of the line to use in the PostScript plot. No effect on
the screen.
-
Shade
-
The shade to fill in the symbols with in the plot. Shading can be
homogeneous for the data set or scaled to the Z values.
-
Solid/Dotted/Dot-Dash/Dashed line
-
The type of line to use.
-
Thick contour
-
The penwidth of the thick contour for contourable data files. The
thin lines use the number given in "penwidth".
These are options set for each map and are identical in meaning to the
CURRENT FILE OPTIONS, with the additional option of filling in a map with
one of several patterns.
There are a variety of functions that can be performed on the Canvas. These
are selected using the switch in the middle of the panel on the left side
of the window.
Note that there are "Canvas Activity Help Windows" that can be
switched on and off. These are to help the user remember how to use the
different activities.
-
Locate points on the screen
-
This allows numbers to appear on the screen showing the location
of the cursor in the local coordinate frame. Pressing and holding down
either right or left mouse button will cause numbers to appear on the screen
below a cursor. Letting go of the button will leave the number stationary
on the screen. Hitting the middle key will erase the number from the screen.
-
Zoom
-
This allows the user to zoom in on a section of the screen. Move cursor
on screen to any corner of the desired zoom area, and then press the left
mouse button. If you decide not to use this point and want to start over,
press the middle mouse button. Otherwise, hold down the left mouse button
and a box will appear. When the box covers the desired area, click the
right mouse button and the program will zoom to that area.
-
Zoom-out
-
This will "un-zoom" to the previous zoom level. Just put the cursor
on the canvas and press the left mouse button.
-
Enter Section
-
This action, along with the following two actions, are used to look
at cross-sections of data. The procedure is to first draw (or "enter")
a section (or several sections) on the screen, select a section to look
at and then view it using the VIEW SECT button described above.
A section is entered by first drawing a line down the middle of
the desired section and then choosing a box about this central line. This
involves a number of steps, as follows:
-
Choose a point to be one end of the center line by moving the cursor to
the desired point and depressing the left mouse button. This point will
represent the left-most end of the section. As you depress the left button,
a "rubber line" will appear that represents the postion of the central
line of the section. If you wish to change your choice of starting position
at this point, click the middle button and start the procedure over. Otherwise,
move the other end of the line to the desired point and click the right
button. Next, depress the left button again and a "rubber box" will appear.
Move the cursor back and forth until the desired box is drawn and then
click the right button. The section will be redrawn without the center
line and and "L" and "R" will appear to remind you which will be the left
and right sides of the section when you view it.
-
Delete Section
-
You can delete an entered section by moving the cursor to any of
the corners of the section box and clicking the left mouse button. When
the section is deleted, it will disappear (although the L and R will remain
until the picture is redrawn).
-
Select Section
-
Before viewing a section it must be selected. To do this, move the
cursor to any of the corners of the section box and click the left mouse
button. When the section is selected, it will blink momentarily.
-
Identify a Point
-
If ASCII identifiers have been read in for a data set, individual
points can be identified by moving the cursor over the point and pushing
the left mouse button. Doing the same over a point where the ID is shown
will cause it to disappear. Clicking the middle button will cause the most
recent ID shown to disappear.
-
Get/Set a Point
-
This allows you to determine the Z values (or reset the Z value)
of an X, Y, Z set plotted on the screen.
-
Enter a label
-
Labels may be entered on the plot by moving the cursor to the place
where the label is desired and pushing the left mouse button. This point
will be the beginning position of the label. If you want to start over,
push the middle mouse button. Otherwise, depress the left mouse button
and a rubber line will appear, which you can use to specify the angle of
the label. When you are satisfied with the angle, click the right mouse
button. At this point a window will appear in which you enter the label.
You can also change the value of the angle and the font size if you wish.
Note that the label will be written on the screen but not at the proper
angle. Don't worry - it will be ok on the plot.
-
Delete a label
-
Labels can be deleted by moving the cursor to the endpoint of the
label and clicking the left mouse button.
-
Polygon Select
-
Select a group of points within a polygon and reset their values.
-
Enter a Line
-
You can draw lines on the screen, with arrows if you choose.
-
Delete a Line
-
Just like it sounds.
XProfile allows the user to read in a macro, so that complicated
pictures can be reproduced or modified easily. It also allows the user to
set personal preferences for many variables by reading in a preference file.
A complete description of
these files appears in the Xprofile_macros man page.
Xprofile_macro.html
cal2ps (still being written; sorry!)
Steve Roecker
roecks@rpi.edu
Thanks to Paul Wessel for allowing me to use his XY routines, which formed
the basis for the precursor to this program (PROFILE). Also, the routines
used to parse arguments were adapted from routines written by Tim Ahern,
Jim Fowler and Richard Boaz of PASSCAL.
Send bug reports to: roecks@rpi.edu
Go to Table of Contents