Dear User, Even a cursory glance at these two earthquake CD-ROM catalog collections should be sufficient to convince you that earthquake catalogs come in an astounding variety of formats. Unfortunately you probably have a program(s) which import earthquake data in only one set format. What to do!!! We could have converted all formats to one before pressing the CD- but this would have lost information (such as error analysis) in catalogs which might have been vital in your data needs. The freeform conversion process was developed to overcome this difficulty, at least to some extent. Following is a short description of a technique to convert catalog data in one format to catalog data in another format. Step 1: Load the Freeform software onto your computer. Step 2: Find the format description of the original data file. This description will be in the same directory as the data. There are three format descriptors in each directory: 1. *.af - Format for the *.dat file (ASCII (DOS) version) 2. *.bf - Format for the *.bin file (BINARY VERSION) 3. *.fmt - Format file containing both the BINARY and ASCII formats. Step 3: Find or create the format description of the file as you wish it to be formatted. (A complete description of creating a format file can be found in the Freeform users manual in the Software directory on this CD). For example if your program takes the USGS earthquake format, you may lift this from any directory with a *gs ending the directory name. Step 4: Rename *.af to *.afm or *.bf to *.bfm. As certain applications of Geovu become confused if *.afm, *.bfm and *.fmt files coexist in the same directory these files were given extensions "af" and "bf" rather than the required "afm" and "bfm" extensions for use in freeform applications. It is advisable to copy the output format file to a temporary file which you can edit, and to do all subsequent name changes in the temporary format file. Step 5: Check the names in the original format (input file) against the names in the new format (output file). Any name you wish to output must be in the input and output file. We have attempted to keep names of similar variables consistent between catalogs with different formats. However, some names referring to similar variables may be slightly different (e.g. the body wave magnitude may be identified as MB_magn or magn_mb - these should be changed so they are identical in your application). Do not make name changes in the orginal format file, but only in the temporary format file. The output file will have only those parameters which exist in the input file. Parameters identified in the output format file which do not exist in the input format will be filled with spaces in the output data file. Step 6: You are ready to convert to the new format. Enter the following command on your computer: newform original.dat -if input.afm -of output.afm > output.dat where input.afm is the format file of the file you are converting from output.afm is the format file of the format you wish to have. original.dat is the original catalog output.dat is the output catalog in the new format matching output.afm of course, you can use BINARY or ASCII versions as well in this step or interchange them. For example newform original.bin -if input.bfm -of output.afm > output.dat would convert a binary file (original.bin) to an ASCII file in your preferred format (output.afm) or newform original.bin -if input.bfm -of output.bfm > output.bin would convert a binary file (original.bin) to another binary file (output.bin) with the format identified in output.bfm FINAL NOTE: In the Geovu setup, there are histograms for each variable in the ASCII and BINARY versions of the data file. For any variable in both the *.bin and *.dat data files, you can view the histogram within Geovu if either the *.dat or the *.bin were opened as the data source. If a variable occurs in only one of the two data files, you must open the data file with the unique variable name to view the histogram of that variable. Conversion of variables however, is possible between ASCII or ASCII/BINARY files. For instance if the ASCII original has latitude_abs and latitude_NS and latitude_min, then a conversion to latitude can occur to a new file calling a variable "latitude". For example if depth is present in both the usgs.bin and the usgs.dat files, opening either one will allow you to see the histogram for depth. However, if latitude is present in the usgs.bin file, but not in the usgs.dat file, you must open the usgs.bin file to see the histogram for latitude. Likewise, if latitude_abs is present in the usgs.dat file but not in the usgs.bin file, you would need to open the usgs.dat file to view the histogram for the latitude_abs variable. If you have opened a histogram from the *.dat file, however, you must close the histogram before viewing a histogram from the *.bin file. Additional variables are often present in the *.bin files which do not exist in the *.dat file. These are converted from information in the *.dat file for the convenience of the user. For example, many catalogs have time in month, day, hour, ..., but a more convenient form of time for plotting is a serial time. We have included a decimal year variable in most *.bin files for the convenience of the user. We have also maintained all data either in it's original form (ASCII) or in an ASCII equivalent of the original. While binary data is faster to use in computer programs, many researchers like the data as numbers in a form they can browse and immediately use. This, while taking up more space, also allows easier quality control of the data sets and use of the data without intermediary programs or conversions. You should be able to copy all data sets directly to your computer for immediate use. I hope you find this product useful and easy-to-use. Please do not hesitate to contact us at the National Geophysical Data Center with compliments, questions, or comments. We will be happy to assist you with these data or other data in our center. Sincerely, Lowell Whiteside Geophysicist National Geophysical Data Center low@luna.ngdc.noaa.gov (303)-497-6477 EXAMPLE OF CONVERSION OF ONE FORMAT TO ANOTHER: Suppose we want to convert the earthquake data file from the John Carroll University (JCU) in Cleveland, Ohio, into the same file in the USGS format. We find the JCU data in the file on the North America CD: data\usa\neus\jcu\jcu.dat (or jcu.bin) The NGDC format is listed in the files: jcu.bf = binary format jcu.af = ASCII format jcu.fmt = both formats To convert we also need an example of the USGS format. This can be found in any directory ending in a "gs" trailer. For example, in the directory data\canada\general\epbgs The USGS format is listed in the files: epb.bf = binary format epb.af = ASCII format epb.fmt = both formats After you have copied the FREEFORM library and executables to your computer, you may begin conversion. In this example you will convert an ASCII file to another ASCII file, so you need to copy both the jcu.af and the epb.af format files from the CD to your computer. Make a new directory called "convert" on your computer mkdir convert Change directories to this new directory cd convert Copy the format files you need and the data file in the original format: copy F:\data\canada\general\epbgs\epb.af epb.afm Here you have copied the file epb.af and changed it's name on your computer to epb.afm so it can be used in FREEFORM applications, and the letter "F" designates your CD-ROM drive. Similarly: copy F:\data\usa\neus\jcu\jcu.af jcu.afm and copy F:\data\usa\neus\jcu\jcu.dat jcu.dat We hope the variable names are convertible between formats, but it is necessary to check, so examine the variable names in both format files to see if they are the same. This is the difficult part. You may check by eye or use various programming techniques to sort and count the number of times each variable appears in the files. In this case Table 1 was derived by the following commands: cat jcu.afm epb.afm | awk '{print $1}' | sort | uniq -c Table 1: Listing of variables in both epb.afm and jcu.afm 2 Flinn_Engdahl_region 1 MB 1 MS 1 Standard_deviation 2 century_and_year 2 day 2 depth 1 distance_radial 2 flag_cultural 1 flag_depth_ISC 2 flag_depth_control_PDE 2 flag_diastrophic 1 flag_fault_plane_solution 2 flag_infrasonic 1 flag_isoseismal 1 flag_isoseismal_map 1 flag_moment 2 flag_non_tectonic 2 flag_other 1 flag_preferred 2 flag_seiche 2 flag_tsunami 1 flag_unusual_event 2 flag_volcanism 1 flags_ngdc 2 hour 2 intensity 2 international_data_exchange_event 1 latitude 1 latitude_abs 1 latitude_ns 1 longitude 1 longitude_abs 1 longitude_ew 1 magn_one 1 magn_one_authority 1 magn_one_scale 1 magn_other_source 1 magn_two 1 magn_two_authority 1 magn_two_scale 1 magnitude_other 2 mb_magn 1 mb_magn_number_observations 2 minute 1 ml_magn_local 1 ml_magn_local_authority 1 ml_magn_local_scale 2 month 2 ms_local_magn 1 number_ms_observations 1 number_of_Pp_phases 2 number_of_stations_or_quality 2 second 2 source 2 time_authority 2 z_h Variables in one format only have a preceding (1) from the uniq -c function. There are also a number of of variables listed in both formats (these are identified by the preceding (2). These are the variables which will be output in the conversion. If names are similar (such as flag_isoseismal and flag_isoseismal_map) they may refer to the same general variable. If this is the case, and you want this variable in the output file, change the name in one of the files to match the name in the other format file and you will get output upon conversion. You may want to check the expanded format explanations for descriptions of these variables. In the case of latitude and longitude the essential ingredients (latitude_ns, latitude_abs etc.) are in the original format, so FREEFORM will automatically convert these to the variables "latitude" and "longitude" which are variables identified in the output format. Once the names have been checked, and you are satisfied that the variables you need in the output will be in the output file, you can run the FREEFORM command: newform jcu.dat -if jcu.afm -of epb.afm > jcugs.dat This coverts the jcu.dat ASCII file in NGDC format to the file "jcugs.dat" in USGS format. An example of the output follows. Note that latitude and longitude have been converted to decimal latitude and longitude. Note also that parameters called for in the USGS format such as magn_one are not present since they were not present in the jcu.dat file. The file jcugs.dat, however, should run satisfactorily as input data in programs requiring USGS formats. Table 2: Original JCU file in NGDC format JCU 19870102024114041784N 81100W 2 471 #060MLJCU JCU 19870121111531041647N 81479W 2 471 #160MLJCU JCU 19870212011056041647N 81148W 4 471 #180MLJCU JCU 19870228113834041627N 81436W 3 471 #140MLJCU JCU 19870501211352241748N 81101W 3 471 #130MLJCU JCU 19870502202526541742N 81088W 2 471 #040MLJCU JCU 19870618103057441542N 80373W 2 471 #270MLJCU JCU 19870713054919441903N 80758W 2 471 #380MLJCU JCU 19870713055852341884N 80695W 2 471 #220MLJCU JCU 19870713061630841881N 80766W 2 471 #060MLJCU Output from the Conversion - Mexico.dat in USGS format JCU 1987 1 2 24114 # 41.784 -81.100 2 0.0 0.0 471 JCU 1987 121111531 # 41.647 -81.479 2 0.0 0.0 471 JCU 1987 212 11056 # 41.647 -81.148 4 0.0 0.0 471 JCU 1987 228113834 # 41.627 -81.436 3 0.0 0.0 471 JCU 1987 5 1211352 # 41.748 -81.101 3 0.0 0.0 471 JCU 1987 5 2202527 # 41.742 -81.088 2 0.0 0.0 471 JCU 1987 618103057 # 41.542 -80.373 2 0.0 0.0 471 JCU 1987 713 54919 # 41.903 -80.758 2 0.0 0.0 471 JCU 1987 713 55852 # 41.884 -80.695 2 0.0 0.0 471 JCU 1987 713 61631 # 41.881 -80.766 2 0.0 0.0 471