Geology 200A - Laboratory Exercise 2 - W.R. Church
 (\aacrse\200\compute\flog\200FL95.RTF... ...200 Earth Sci Fieldlog)

                                                                        Fieldlog Mapping Database

    Introduction

    Fieldlog is a database developed by Boyan Brodaric of the Geological Survey of Canada for the digital storage of geological data of any kind pertaining to a specific locality - usually an outcrop in the case of a mapping database.  It is a relational database (similar to dBASE) which stores data in the form of Tables, Records, and Fields. The following instructions have been summarized from ‘Fieldlog v2.83a, Geological Survey of Canada’ by Boyan Brodaric, 1992, 86 p. (Note: the chance of student and permanent employment by the Ontario and Canadian Geological Surveys is considerably enhanced if even minimal familiarity with Fieldlog can be demonstrated.)
     A Table is similar to a spreadsheet composed of records (rows) and fields (columns) containing information of different classes - there might be a table for structural data, one for geochemical data, one for data referring to the collection locality, etc. The tables are linked (related) by having each of them contain a common item of information, usually an outcrop number or STATION NUMBER (STATIONUM). This item or 'field' appears in all the tables.
    Records contain the information about specific samples or measurements (from the same or different outcrops), and the fields of the record contain a single item of information about the sample, e.g. its name, or lithology, or thin section # or angle of dip, etc.
    The number of tables and their contents (fields) are project dependant.  Fieldlog will accept up to 15 tables and 27 fields in each table.  A typical geological project might contain tables for STATIon information, STRUCtural observations, SAMPLe and PHOTOgraph recordings.  Each, in turn, will contain fields to store the data within the tables; eg. the STRUCtural table might contain the following fields:  type of structural reading, strike, dip.  Each field occupies a fixed space measured in number of characters, and a data type such as numeric or text.  A project definition is created by providing these parameters to Fieldlog through filling the definition form which appears as the initial screen.  Each row in the form contains the information for a specific field, including the table in which it resides, its size and type, and some plotting characteristics.
    Fieldlog creates DXF plot files which can be imported into almost virtually any CAD or graphics system.  DXF files generated with Fieldlog have been successfully incorporated into AutoCAD, Generic CADD, Design CAD, Easy CAD, RtiCAD, Corel Draw, ARC/INFO GIS, SPANS GIS, Windows Word, etc.

     In this laboratory tutorial we are going to:

     1) implement Fieldlog ;
     2) load two ascii data files (200A.txt and 200B.txt) containing information about the location and lithologies of a set of rocks.
     The file 200A.txt contains the fields STATIONUM, the X and Y COORDINATES of the LOCALITY at which the sample was collected, and the outcrop symbol 'x', and each record has the form, e.g. - "001",3900,3810, "x". This file will be loaded into the STATI table.
     The file 200B.txt contains the fields STATIONUM (the common field which links the Tables), the lithologic code (e,g, 's' for sandstone), the lithology, and economic mineral content (e.g. Au), and has the form e.g. - "001", "g", "granite", "Au". This file will be imported into the SAMPL Table.
     3) output a DFX file containing coordinate and rock-type data.
     4) plot the data in a thematic map, using Corel Draw. (Normally we would use AUTOCAD but this application is not available to us. Note: the DXF file can also be imported into a Windows Word document, i.e. .doc file.)

       PROCEDURE

    IMPORTANT:
     1) in the following instructions ‘ENTER’ means press the Enter key.
     2) If requested to type a character or string enclosed in single quotes e.g. ‘a:’,do not type the quotes.
But if the quotes are double quotes, include them with the string.
     3) Read each paragraph carefully first, understand what is being asked of you, and then carry out the instructions! Note: 'your initials' really means your initials (e.g. wrc for W.R. Church)

      In many applications, the response to an instruction is registered by pressing the ENTER key. This is not always the case in Fieldlog, where a response may involve pressing a 'Y' or 'N' key followed by pressing the CURSOR key to move a highlighted bar to another item on the menu. Only when all possible selections have been made is the ENTER key pressed. If you press the ENTER key when you should not have, you have no choice but to recommence the procedure. Therefore be careful in following the instructions below. Think before you hit the ENTER key!

      Copying the Fieldlog Data and Template files

    1) Put your HD floppy diskette in the A: drive
    2) Double click the ‘My Computer’ icon in Windows95 and select the A: drive.
    3) Double click the ‘My Computer’ icon again, select the C: drive, click the Fieldlog folder (subdirectory) in the C: window.
    4) Copy from the Fieldlog window to the A: window the files 200a.txt and 200b.txt, as well as the fieldlog.exe, config.add, Gsc.shx, and 200fl95.rtf  files. (Sequentially click each file while the CTRL key is depressed, and drag them from the Fieldlog window to the A: window). The fieldlog.exe file is not needed for this exercise, but it can be used to carry out the lab exercise on your home computer, if you wish. In this case however you will need to add the contents of the ‘config.add’ file to your DOS ‘config.sys’ file.
     5) Copy the folder C:\fieldlog\template to the A: floppy drive by dragging the template folder from the C: window to the  A: window.
     6) Rename the copied ‘Template’ folder to ‘your initials’ (e.g. wrc for W.R.Church.).
     7) redo step 4) to make a copy of the template folder on your A: floppy disk.
    The ‘A:\'yourinitials'’ folder will be your work directory, whereas the ‘A:\template’ folder will be your backup in the event you trash the files in the ‘A:\'yourinitials'’ folder.
     Your HD floppy disk should now have the files fieldlog.exe, config.add, 200a.txt, and 200b.txt in the root directory of your diskette, as well as a 'template' and a 'yourinitials' folders containing the raw (i.e. empty, no data) Fieldlog database files.
     (If you would like to have a copy of FIELDLOG loaded on your own personal computer, make a Fieldlog directory on your hard drive; place your diskette in the A: drive of your home computer and drag the contents of your floppy to this directory. Copy the contents of the file ‘config.add’ to your DOS ‘config.sys’ file. You may however be able to get Fieldlog to work in the Windows95 DOS box without modifying the config.sys!)

      Loading Fieldlog

     1) Select the Window95 DOS box
     2) At the DOS command line, type ‘cd \Fieldlog’ 'ENTER' .
     3) Type ‘set fieldlog=a:\yourinitials ‘ENTER’.
     4) Run FIELDLOG with the instruction‘fieldlog’ ‘ENTER’.

     If you get the error message 'The system cannot open COM1 port requested by the application', click the Ignore button, and in response to the  'TABLET NOT READY' message, press the ESC key. The program will complete loading. The main Fieldlog menu will appear on the screen, the leftmost column of which will contain the names of the Tables containing the fields named in the second column.

     We will next import the data in files ‘a:\200A.txt’ and a:\200B.txt into the database template. (NOTE: in the following text, the instruction 'cursor' means press the cursor DOWN arrow on the keyboard.)

      Importing the data into Fieldlog

     When carrying out the import procedure, instructions will appear on an instruction bar at the bottom right of the screen. At the same time a small menu box will appear towards the top left of the screen. The instructions are carried out in the menu box with the use of the CURSOR and ENTER keys.

     Press F6
      A menu will appear on the screen in which the word STATI (STATION) will be highlighted in green or some other colour, whereas the instruction 'Choose Table to Import' will appear in the bottom right Instruction Bar. Press ENTER to select the STATI table.
     A new menu will appear with a list of fields contained in the STATI table, and with the letter N placed to the right of each field. Press the 'Y' key so that Y replaces the N adjacent to STATIONUM; but DO NOT PRESS THE ENTER KEY. (If at some point you press the ENTER key and you should not have, press the ESC key followed by the ENTER key and start over). Cursor down 1 step to LOCATIONX and press the Y key. Similarly, enter a Y for the LOCATIONY field, and for the LOCODE field. Then press ENTER.
     A new menu will appear requesting information concerning the field and text delimiters, and the name of the file to import. Enter ',' (comma) for Field delimiter, ' " ' (quote) for Text delimiter, and the name of the import file including the drive, e.g. a:\200A.txt for Text file name. Use the cursor keys to move from field to field in the menu, NOT the ENTER key. Press the ENTER key TWICE after having typed in the file name. Pressing ENTER twice will bypass the final option concerning 'update'.
     The file will now have been imported, and the status of the import recorded in the menu that appears at the top left of the screen. Press the ENTER key to remove the menu.
     Press F7 followed by ENTER to examine the imported records in the STATI Table. Use the ESC key (followed by ENTER) to return to the main menu. If an incidental record without an entry in the STATIONUM field appears at the beginning of the table, it can be removed by bringing the cursor to the record and pressing the DEL key.

     You will now repeat the process by entering a data file containing the rock type data into the SAMPL table.
     Press F6.
     Cursor down to SAMPL and press ENTER.
     Enter 'Y' for the STATIONUM, the LITHCODE, the ROCKTYPE, and the METALS fields, and after entering the last 'Y' press ENTER.
     Provide the information concerning field and text delimiters, and enter the import file name a:\200B.txt.
     Upon termination of the import procedure, you can examine the imported data by pressing the F7 key, selecting the Table SAMPL by moving the cursor down to SAMPL in the Table menu that appears on the screen, and pressing ENTER.
     To return to the Main Menu, press the ESC key followed by the ENTER key.

      Exporting the data to a DXF file (to construct a thematic map).
 
     Constructing a thematic map involves four operations:
    1) Selecting an x-y offset for the plotted fields.
    2) selecting the records in a given Table to be plotted, e.g. all the data, or a subset of the data based on lithology (granites), or a subset based on geographic location, or a subset based on an economic mineral (gold) occurrence, or even a subset of gold in granite, etc;
    3) specifying which fields in the Table are to appear as text on the thematic map;
    4) (OPTIONAL) repeat steps 2) and 3) for fields in a second or even third Table;
    5) specifying the coordinates to be plotted;
    6) outputting the DXF file.

    1) x and y offsets
    Generally one location per station is recorded in the database.  When Fieldlog plots any data at a station it necessarily plots all the data at this one location.  Fieldlog does not attempt to eliminate overlap, as this will increase rather than decrease the confusion in dense areas. Furthermore, the positioning of data represents a scientific decision better performed by the geologist than by the computer.  However, if desired, the x,y offset option does allow some spatial adjustment to the data at a station location, by allowing any field to be offset from that location.  The field will then be plotted at the station location offset by a specified vector.  The vector is measured in drawing units, typically UTM meters, and ranges from +-32768.
     For this exercise the offsets have been preset and there is therefore no need to carry out the following procedure. Read the following italicized section but do not carry out the instructions. Continue with section 2) below.
    Cursor to the Stationum field, press F4, cursor to 'x and y offsets', press ENTER. Fieldlog responds with:
       x offset  __________
       y offset  __________
    Enter 1 for the x offset, press ENTER, cursor to the y field and type ‘0’, and press Enter twice to accept. Cursor to the SAMPL table and offset the Lithcode field -2 in the x direction and 0 in the y direction. Cursor to the Metals field and offset it -2 in x and -2 in y. The Stationum will be plotted to the right of the Locode station location, the Lithcode to the left, and the Metals field to the left and down relative to the Locode outcrop symbol.  Cursor to the FEATURE field and press F4.  Enter -200 for x and 0  for y.  The amounts chosen for the offset were based on the fact that text would be 80 meters high and symbols 400 meters.  These sizes are specified at plot time.
    Before Fieldlog will recognize these new parameters they must be saved.  Press F3 to save.  Fieldlog will confirm the save with:
    Save database definitions (Y/N) ? N
    Answer Yes to continue the save.  Fieldlog will then query for the restructuring of any databases with Choose tables to restructure and will also display a list of the tables available for restructuring.  Restructuring will cause the entire table to be copied with deleted rows ignored and any changes to field names or field sizes effected. Restructuring performs a physical reconstruction of the entire table and should only be carried out if new fields are added or old fields deleted from the table, if field lengths or types are altered or if rows in the table are deleted.  Otherwise there is no need to restructure.  Fieldlog will automatically recognize when major changes to a table's definition have occurred and will cause that table to be unavailable in the list of tables, and will proceed to restructure it.  Deleted rows in a table do not constitute a change to the table's definition, only to its contents, and therefore if these rows are to be eliminated, the table must be chosen for restructuring.  To do so, cursor to the table and press 'Y' beside the table name.  Tables chosen with 'Y' will then be restructured as soon as Enter is pressed. Restructuring a table containing data may take a long time and should be performed only when required.
 
    2) Selecting the records to output.
     Press F9. A menu will appear on the screen with the word STATI (STATION) highlighted in green or some other colour.     The instruction 'Choose Table to Search' will appear in the Instruction Bar. Cursor to SAMPL and press ENTER.
     A new menu will appear with a list of fields contained in the SAMPL table, and the instruction will change to 'Choose Field for Search Condition'. Choose STATIONUM by pressing ENTER.
     The next menu will display a set of conditional choices. Cursor to '>' and press ENTER
     In the next menu type ‘0’ and press ENTER.TWICE. Then press ESC and ENTER in sequence in response to the next query.

     YOU HAVE NOW TOLD FIELDLOG THAT YOU WISH TO SELECT ALL THE SAMPLES WITH A STATION NUMBER GREATER THAN 0; THAT IS, ALL THE RECORDS IN THE DATA SET. (You could alternatively have told Fieldlog that you only wish to output occurrences of granite by selecting 'Containing' and typing the word 'Granite' in the menu box.)
     3) Selecting the fields to output.
     A menu displaying the list of fields in the SAMPLE table will now appear along with the instruction 'Choose Fields to Retrieve' in the Instruction bar. Press the Y key to place a Y next to STATIONUM and then cursor to LITHCODE and again press the Y key. The letter 'Y' will appear to the right of LITHCODE. Place a 'Y' next to METALS. Press ENTER.

    4) Selecting fields in another Table.
 The 'Choose Table to Search' option will now reappear allowing you to specify a new Table to search. To output an outcrop symbol 'x' select the STATI Table, and following the appearance of the 'Choose Field for Search Condition' select STATIONUM and repeat the steps in  2) above. Also repeat the steps in 3) above, but select only the field LOCODE as the field to be output. Decline the option of selecting another (third) table, by pressing the ESC key followed by ENTER.

    5) Selecting the Coordinate field.
 The Table Menu will now reappear with the instruction 'Choose Coordinate Table'. If the cursor is located next to the word STATI, press ENTER. A menu with the fields in the STATI table will appear with the cursor located to the right of the LOCATIONX field, and the instruction 'Choose X or Y coordinate'. Press ENTER, and finally ESC and ENTER in response to the instruction 'Select Area to Search'.

    6) Outputting the DXF file.
     The next menu will offer a choice of AUTOCAD versions to use in plotting the data. Cursor to Autocad r9 and press ENTER. (Use Autocadr9 if exporting to CORELDRAW, but Autocadr12 if exporting to Autocad.)
 In response to the next menu concerning the Symbol Library to use, type ‘GSC’ and press the ENTER key TWICE. In the menu 'Plot Symbols as...' select 'lines' and press the ‘Enter’ key.
     The next menu will require you to provide information concerning the plotting format of the output data and the name of the file to contain the ouput data. Type the values ‘1’ followed by ENTER forboth 'Symbol Scale' and 'Text Size' (The scale and size values are in meter drawing units, and should be chosen relative to the maximum dimensions of the drawing. That is a drawing measuring 10 kilmetres on a 10 inch page across would require lettering 1/10th of an inch high to be referenced as 100 metres in size ((10kmx1000)/(10inchesx10)=100 m). Cursor down to the line 'DXF Plot File Name' and type the name of your file, e.g. a:\your initials\yourinitial.dxf.  Press ENTER twice. Fieldlog will output the DXF file and inform you of the number of records output. Press ENTER to return to the Main Fieldlog Menu and then ‘ESC’ ‘ENTER’ to exit Fieldlog. Type EXIT to return to Windows 95.

      To view the DXF file in CORELDRAW

  Double click the CorelDraw icon. Once the software is loaded, click on File and then IMPORT (NOT OPEN). Select DXF as the file type, select your DXF file in your a:\......directory, and load the file to the screen. Once the data set has loaded, examine the distribution of rock types on your screen (g = granite, d = diabase, l = limestone, s = sandstone), and draw a coloured map of these units.

    TIPS: use the rectangle tool to draw a rectangular box around the data set. If the data set is too small to be comprehensible, use the text tool (A) to write the text string ‘abcdef’ at some location beyond the limits of the data set; resize the written text so that it is readable (but not too large); marquee (window) the data set; in the Edit menu select ‘Copy attributes from’; and click the text string you have written in order to copy its attributes (size) to the data set. You will also need to know how to use the pick tool, the free-hand drawing tool, the edit tool, and the ‘order’ function in the Arrange menu. If you have not used CorelDraw as a drawing program, request help from the instructor.

    ADDITIONAL PRACTICE EXERCISES
     Go back to Fieldlog and create a .dxf file containing only the location of gold localities. Is it possible that they lie along lineaments (fault or joint lines)?
     If the faults or joints are vertical, what is the orientation of the maximum principal stress?
     Create a dxf file and thematic map showing the location of granite outcrops only.
     Create a dxf file and thematic map showing gold localities in granite.
     Place the latter two maps on separate layers in CORELDRAW.
     Fieldlog - Structural Data
     From the DOS command line C:\ prompt, enter the DOS Editor (type ‘edit a:\200str.txt ENTER’) and type in a file with four records each made up of the four fields - stationum, IBED, Azimuth value, Dip angle value, e.g.:

            “001”, “IBED”, 0, 10
            “002”, “IBED”, 60, 45
 (add two or more records, “003”, “004”, etc).

     where IBED (must be typed in UPPER CASE) is Fieldlog’s OGS code for a bedding symbol, and the two numerical values represent the azimuth of dip and angle of dip, respectively, of the bed.

     Save the file (ALT-F  S), exit the Editor (ALT-F  X), load your Fieldlog directory ‘my initial’, and import (F6) the a:\200str.txt file into the STATIONUM, READING, AZIMUTH, AND DIPLUNGE fields of the STRUC Table. Check your STRUC Table by pressing F7 and selecting STRUC.

     In order for structural symbols to be correctly oriented when displayed in CorelDraw or Autocad, it is necessary to set a rotation angle in the F4 menu. Cursor to the structural symbol field READING in the STRUC table and press F4. Cursor to the rotation angle option and press ‘ENTER’. In response to the query ‘Rotation angle field’, type AZIMUTH (in upper case letters!) and press ‘ENTER’. In response to the query ‘Corrective angle’ enter some angle corresponding to the magnetic declination if the AZIMUTH values are uncorrected for declination, e.g. -23 degrees if the magnetic North is 23 degrees NW of North. In your case enter ‘0’ (zero). If a field e.g. READING, has been assigned a rotation angle, a diamond symbol will be placed opposite the field in the Fieldlog main menu. Note that AZIMUTH refers to the strike of  the symbol in a direction anticlockwise from the direction of dip.

     To plot the azimuth and dip angle text around the symbol so that they do not overlap with the symbol or with each other, place the main menu cursor on the field to be positioned (e.g. cursor to the AZIMUTH field), press F4 and select the ‘Position around symbol’ option. Select READING as the symbol in response to the request ‘Position around which symbol field?’. There are 8 possible locations: the first position is to the east of the symbol, the others following around in anticlockwise rotation from the first position to the eighth position at bottom-right. Choose 2 for the AZIMUTH field. Repeat the exercise for the DIPLUNGE field and place it in position 1.

     IMPORTANT: press F3 and select STRUC to restructure the STRUC Table.

     Fieldlog is able to store symbol values, and offers a choice of three Symbol libraries - NATMAP (National Mapping Program), GSC (Geological Surrvey of Canada), and OGS (Ontario Geological Survey). When entering the code for a structural symbol representing bedding in the READING field of the STRUC Table, the code must correspond to that of the Symbol library to be used when outputting a DXF file, e.g. in the case of the symbol for bedding with known sense of younging, IOBED for OGS, S-BED for Natmap, and SI-BED for GSC. (IMPORTANT: if you change the OGS codes to Natmap or GSC codes, or vice versa, the STRUC table will have to be restructured using the F3 command sequence in order for the changes to be put into effect. This is like having to reboot when a change is made to the DOS config.sys file.) In this exercise the symbol IBED you have entered into your database is the general symbol for bed orientation in the OGS library. Consequently, when outputting a DXF file you are requested to input a Symbol Library name, enter OGS.

     As in the previous weeks exercise, output (F9) the structural data (STATIONUM, READING, AZIMUTH, DIPLUNGE) to a DXF file called ‘a:\your initalstr.dxf’, using OGS as the Symbol Library, and examine the file in CorelDraw.