SeisGram2K

version 5.1.0 - March 2006

Anthony Lomax

Anthony Lomax Scientific Software
Mouans-Sartoux, France


Download and Installation

   

SeisGram2K

Contents:

Introduction, Copyright notice, Source code
Stand-alone configuration
Applet configuration

Introduction, Copyright notice, Source code

This page gives instructions and links for downloading and installing the SeisGram2K Seismogram Viewer. parts of this software are new and have not yet been reviewed or thoroughly tested - IT IS IMPORTANT THAT YOU VERIFY THE CORRECT FUNCTIONING OF THE SOFTWARE FOR YOUR PURPOSES. If you have problems or suggestions, please contact Anthony Lomax; please specify the type and version of your computer hardware, Java installation, and browser. I would also appreciate hearing about the details of your installation and application of SeisGram2K.

List of SeisGram2K Updates, New Features, Bugs

LiveSeis installation and setup

Copyright notice:

The SeisGram2K Seismogram Viewer program and source code are distributed under the terms of the GNU General Public License (GNU GPL). PLEASE READ, UNDERSTAND AND AGREE WITH THE GNU GPL BEFORE DOWNLOADING OR USING THE SEISGRAM2K SOFTWARE:
GNU General Public License and translations (Or a local copy of the GNU General Public License)

Source code:

The SeisGram2K source code is often updated.  If you would like a copy of the souce code in its current state, please contact Anthony Lomax.

Stand-alone configuration

Download and install SeisGram2K Seismogram Viewer stand-alone by following the steps below:

  1. You must have Java SDK 2 or JRE 2 or higher installed:
  2. You can check for the presence and version of Java on your system with the command:

    java -version

    If you do not have a recent version of Java available on your system (JRE (Java Runtime Environment - for end users), or Java SDK (Java Software Development Kit - for developers)), you can download Java from Sun for LINUX, Solaris, Macintosh and Windows.

    If not done automaticlly at installation, remember to update the path environment variable (UNIX) or the PATH variable (Windows) if you want to be able to run the Java executables (java, jar, etc.) from any directory without having to type the full path of the command. See the Java installation documentation for more details.

    Quick Start: You can launch SeisGram2K directly from the SeisGram2K51.jar class file archive.  Just download this file to your desktop or other convenient directory, and open the file.  The file may not open correctly if you have a file compression program that is set as the default program for *.jar java archive files.  You cannot specify command line program arguemnts or data files when launching SeisGram2K directly from the jar archive.

  3. Create the installation directories and download the SeisGram2K program files:
  4. Create a program directory for the SeisGram2K class files, i.e.

    my_java_dir/SeisGram2K

    Download the following files to the program directory (To download from a browser directly to local disk, press the right mouse button over each link and select "Save Link As..." (Netscape) or "Save Target As..." (IE), or press Shift+Button1 (Netscape)):

    SeisGram2K51.jar - SeisGram2K class files (the Java "byte-code" for SeisGram2K - DO NOT UNPACK THIS FILE))
    sg2kdefaults (or .sg2kdefaults) - SeisGram2K defaults file (the global default preferences for SeisGram2K)

    Create a work directory for the SeisGram2K sample data files, i.e.

    my_work_dir

    Download the sample data files to the work directory:

    1999.09.26.0940.VSL.BHZ.SAC - Z component SAC, SUN_UNIX binary data file
    1999.09.26.0940.VSL.BHN.SAC - N component SAC, SUN_UNIX binary data file
    1999.09.26.0940.VSL.BHE.SAC - E component SAC, SUN_UNIX binary data file

    If you are on a multi-user system, download a personal copy of the defaults file to your home directory:

    sg2kdefaults (or .sg2kdefaults) - SeisGram2K user defaults file (the user default preferences for SeisGram2K)

  5. Set the CLASSPATH
  6. The CLASSPATH environment variable tells the Java Virtual Machine and other Java applications where to find the class libraries, including user-defined class libraries. If you are only running SeisGram2K you can set the CLASSPATH as follows:

    UNIX:

    setenv CLASSPATH my_java_dir/SeisGram2K/SeisGram2K51.jar
    (all on one command line)

    Windows:

    set CLASSPATH = my_java_dir\SeisGram2K\SeisGram2K51.jar
    (all on one command line)

    In these expressions, my_java_dir is substituted by the absolute path to the Java SDK/JDK or JRE installation directory directory.

    The full name of jar files (compressed archives containing class and other files) must always be explicitly listed in the CLASSPATH. To access unarchived class files (*.class) directly you must include in the CLASSPATH the path to the directory containing the *.class files.

    Alternatively, the -classpath command-line switch to the Java executables can be used to specify the location of class files. Sun suggests the use of this switch and not the CLASSPATH variable. See the Java installation documentation for more details.

    See Sun's classpath documentation for more information.

    NOTE: JRE (1.1 only?) on Windows ignores the CLASSPATH environment variable and the -classpath command-line switch. Instead use the -cp command-line switch. See the JRE README installation documentation for more details.

  7. Run SeisGram2K
  8. Run SeisGram2K and view the sample data files:

    UNIX:

    Go to the work directory created above and type:

    java net.alomax.seisgram2k.SeisGram2K -help
    (if your are using the CLASSPATH environment variable)

    or

    java -classpath my_java_dir/SeisGram2K/SeisGram2K51.jar \
        net.alomax.seisgram2k.SeisGram2K -help

    (all on one command line; if your are using the -classpath command-line switch)

    You should see the SeisGram2K usage instructions and a list of command line arguments. Next, type:

    java net.alomax.seisgram2k.SeisGram2K -binarytype=SUN_UNIX 1999.09.26.0940.VSL.BH?.SAC
    (all on one command line; add the -classpath command-line switch if necessary)

    This should launch the SeisGram2K viewer and read and display a 3-component seismogram. Read the documentation in the Help->Help dialog, and try the various SeisGram2K options for "viewing" the seismogram. (Note that wildcard characters (*,?) can be used in filenames on a local file system.)

    The launcing of SeisGram2K can be simpified by the use of an alias, i.e.

    alias sgm 'java net.alomax.seisgram2k.SeisGram2K -binarytype=SUN_UNIX'

    Windows (use jre or jrew in place of java, as appropriate):

    Open a DOS console window by selecting Start->Programs->MS DOS Prompt.

    Make sure in the new DOS console window that the PATH includes the path to the Java executables, and (if you are not using the -classpath command-line switch) that the CLASSPATH is set as described above. (You can check the environment by typing the DOS command set. PATH and CLASSPATH may be set in AUTOEXEC.BAT, in another batch file or from the command line.)

    Go to the work directory created above and type:

    java net.alomax.seisgram2k.SeisGram2K -help
    (add the -classpath command-line switch if necessary)

    or

    jre -cp my_java_dir\SeisGram2K\SeisGram2K51.jar SeisGram2K -help
    (all on one command line)

    You should see the SeisGram2K usage instructions and a list of command line arguments. Next, type:

    java net.alomax.seisgram2k.SeisGram2K -binarytype=SUN_UNIX 1999.09.26.0940.VSL.BH?.SAC
    (all on one command line; add the -classpath command-line switch if necessary)

    This should launch the SeisGram2K viewer and read and display a 3-component seismogram. Read the documentation in the Help->Help dialog, and try the various SeisGram2K options for "viewing" the seismogram. (Note that wildcard characters (*,?) can be used in filenames on a local file system.)

    The launcing of SeisGram2K can be simpified by the use of a batch file, i.e. sgm.bat containing, for example,

    java net.alomax.seisgram2k.SeisGram2K -binarytype=SUN_UNIX %1 %2 %3

    NOTE: With the JRE command jrew (Java 1.1 only?) you can launch SeisGram2K directly from the Windows Start menu without the need to lauch a DOS console window. See the JRE README installation documentation for more details.

    Read data over the Internet:

    You can read data files directly over the internet by giving the full URL (Uniform Resource Locator) address of one or more seismogram trace files as arguments to the SeisGram2K command, i.e.

    java net.alomax.seisgram2k.SeisGram2K -binarytype=SUN_UNIX \
        http://alomax.net/seisgram/SAOF.Z.SAC \
        http://alomax.net/seisgram/SAOF.N.SAC \
        http://alomax.net/seisgram/SAOF.E.SAC

    (all on one command line; add the -classpath command-line switch if necessary; the "\" is the UNIX continuation character)

    or by entering or pasting the URL in the File->Open dialog of SeisGram2K stand-alone. (Note that wildcard characters (*,?) cannot be used in URL's.)

    This feature makes possible the direct reading and viewing of data files from ORFEUS or IRIS Spyder® event pages or other public data directories. In a Spyder® event page, find a station of interest, the press the right mouse button over the link for the Z, N or E component and select "Copy Link Location" (Netscape) or "Copy Shortcut" (IE). Next, run SeisGram2K with the copied link URL as a program argument, or paste the link URL into the File->Open dialog of SeisGram2K. To rapidly read a 3 component data set, paste the Z component URL into the File->Open dialog and select the "Z->Z,N,E" option.

Applet configuration

Download and install SeisGram2K Seismogram Viewer applet by following the steps below:

  1. Install an appropriate browser:
  2. To view the SeisGram2K applet locally, you need a browser with Java 2 or higher installed and enabled, and with JavaScript enabled. Netscape 7, Mozilla 1.6, Internet Explorer 6, or higher is recommended. (You can also use the appletviewer program to view the SeisGram2K applet if you have the Java SDK/JDK available on your system. See the SDK/JDK documentation for more information.)

    Note: If you are behind a firewall, see: http://www.java.com/en/download/help/proxy_setup.jsp

  3. Create the html and installation directories and download the SeisGram2K program files:
  4. The SeisGram2K applet is launched from an HTML page in a public space (a directory accessible from from the Internet with a URL, i.e. http://alomax.net/seisgram). Default applet security restrictions limit applets to reading files only from the server from which it was launched, and default local security restrictions limit locally run applet to reading files only under the directory from which it is launched (The directory specified by the codebase applet tag, if this tag exists, otherwise the directory containing the HTML page). Thus, for your first SeisGram2K applet installation, it is easiest to begin with a directory structure with the HTML page and SeisGram2K program files in a top directory, and the data files in a sub-directory.

    Create the top directory for the HTML files and SeisGram2K program files, i.e.

    .../public_html/seisgram

    Download the following files to the top directory (To download from a browser directly to local disk, press the right mouse button over each link and select "Save Link As..." (Netscape) or "Save Target As..." (IE), or press Shift+Button1 (Netscape)):

    SeisGram2K_basic_applet.html - HTML text file that will launch the SeisGram2K applet
    seis_view_n_04.js - JavaScript source file that is used by SeisGram2K_basic_applet.html
    SeisGram2K51.jar - SeisGram2K class files (the Java "byte-code" for SeisGram2K - DO NOT UNPACK THIS FILE))

    Directly under the top directory, create a sub-directory named "data" for the data files, i.e.

    .../public_html/seisgram/data

    Download the following files to this sub-directory:

    1999.09.26.0940.VSL.BHZ.SAC - Z component SAC, SUN_UNIX binary data file
    1999.09.26.0940.VSL.BHN.SAC - N component SAC, SUN_UNIX binary data file
    1999.09.26.0940.VSL.BHE.SAC - E component SAC, SUN_UNIX binary data file

  5. Run your browser and launch the SeisGram2K applet
  6. Start your browser and open the HTML page SeisGram2K_basic_applet.html.

    Click on the link. This will load the SeisGram2K applet, and read and display a 3-component seismogram. Read the documentation in the Help->Help dialog, and try the various SeisGram2K options for "viewing" the seismogram.

    (Click here SeisGram2K_basic_applet.html to see how the SeisGram2K applet loads directly from the SeisGram2K site.)

  7. Advanced applet installation
  8. With the installation described above, the JavaScript (seis_view_n_04.js) called in SeisGram2K_basic_applet.html creates a virtual HTML page containing the applet tag required to launch the SeisGram2K applet. The applet is launched in a small browser window, which in turn spawns the main SeisGram2K viewer in an independent window. This procedure allows the viewer window to have a menu bar and dialog windows, and to be resizable. You can view the source of the virtual HTML page by pressing the right mouse button just inside the frame of the small browser window and selecting "View Source". (A real web page based on the HTML of this virtual page forms a very simple, but somewhat inflexible way of launching the SeisGram2K applet.)

    Unfortunately, the presence of the small browser window on the screen is inconvenient and may be confusing to the user. To avoid this extra window, the SeisGram2K applet can be launched into a frame in the main browser window. This approach is used for the SeisGram2K page SeisGram2K.html. Examine the way this page sets up frames and the way the main frame (SeisGram2K_main_frame.html) uses several advanced JavaScripts to control the launching of the SeisGram2K applet into a small frame across the bottom of the browser window. (I would be interested in hearing of any other approaches you may find to avoid displaying the small browser window.)

  9. Applet parameter tags
  10. Parameters are passed to the SeisGram2K applet through applet parameter tags. These tags are of the form:

    <PARAM name=nameString value=valueString>, i.e.
    <PARAM name=channelformat value=SAC_BINARY>

    For a complete list of SeisGram2K parameters, run SeisGram2K stand-alone with the -help command line argument or see the Help->Help->"Running, arguments" documentation in SeisGram2K. For more information on the applet tag in HTML see Sun's APPLET tag documentation.

Questions? Comments? Suggestions? Please contact Anthony Lomax.