Scripting .GRD -> .RwGrd batch conversions

The format of grid models changed in RockWorks16, to include coordinate projection information and other changes. One quick way to update your old grids to the new format is via the RockWorks16 Utilities | Map | Grid-Based Map program:

1. Choose Use Existing Grid and browse for the old-version .GRD file name.
2. Turn off the 2D and 3D output, requesting only “Create Grid Statistics Report”.
3. Click Process.
4. Click OK to confirm the coordinate information, which will default to your current project’s output units.
5. Click OK to confirm the new file name.
Voila.

If you have a Level 5 license of RockWorks16, you can use an RCL script to automate this process. Just port your RockWorks15 project into RockWorks16 as described in the Help messages, copy all of your .GRD files over to the new project folder, and use the script shown below. Copy everything between the divider lines into Notepad (including the comment lines – just be sure to include the “:” characters), save with an “.RCL” file name extension in your project folder, and use Window | Compile RCL to run the script.

————————————————————————-

: this script will convert the listed .grd files in the current project folder to .rwgrd files
: a summary report for each .rwgrd file will be created in the project folder.
: it will require clicking OK in the confirmation windows

: this setting suppresses the display of the text reports

DEFINE: GENERAL REPORT_DISPLAY False

: this group defines the existing .grd file name and the stat report name
: it also turns off 2D and 3D maps

: you will replace the .grd and .txt file names

DEFINE: GRIDMAP DATAGRID_BASED True
DEFINE: GRIDMAP CREATE_NEW_GRID False
DEFINE: GRIDMAP OLD_GRID_NAME A_Top.grd
DEFINE: GRIDMAP 2D False
DEFINE: GRIDMAP 3D False
DEFINE: GRIDMAP REPORT True
DEFINE: GENERAL REPORT_OUTPUT gridstats-A_Top.txt

EXECUTE: gridmap

: this defines the next existing .grd file to be converted and its report
: you will replace the .grd and .txt file names

DEFINE: GRIDMAP OLD_GRID_NAME A_Base.grd
DEFINE: GRIDMAP REPORT True
DEFINE: GENERAL REPORT_OUTPUT gridstats-A_Base.txt
EXECUTE: gridmap

: this defines the next existing .grd file to be converted and its report
: you will replace the .grd and .txt file names

DEFINE: GRIDMAP OLD_GRID_NAME B_Top.grd
DEFINE: GRIDMAP REPORT True
DEFINE: GENERAL REPORT_OUTPUT gridstats-B_Top.txt
EXECUTE: gridmap

: this defines the next existing .grd file to be converted and its report
: you will replace the .grd and .txt file names
: you can continue adding these blocks as necessary to convert your .GRD files

DEFINE: GRIDMAP OLD_GRID_NAME B_Base.grd
DEFINE: GRIDMAP REPORT True
DEFINE: GENERAL REPORT_OUTPUT gridstats-B_Base.txt
EXECUTE: gridmap

————————————————————————-

If you need more info on RCL scripting, check out one of our videos:
http://www.youtube.com/watch?v=zw4toqhqlUU

Adding External Surfaces to a Borehole-Based Stratigraphy Model

RockWorks contains a number of tools which allow you to create a stratigraphy model from borehole data, then introduce additional surfaces to the model based on surveys or proposed excavations. This example is based on an inquiry from a customer who is modeling an existing fill site, in which there are borings surrounding the fill, but none inside. They have surface models of the fill base and fill top which they want to add to the borehole-based stratigraphy model, constraining those borehole surfaces with the fill surfaces.

Step 1: Create the RockWorks project and enter the borehole-based data

Create a new project in RockWorks, and import your borehole data (File | Import menu). Or, create the borehole records manually (Edit | New Borehole) and enter the stratigraphy data into the borehole manager: depth to formation top, depth to formation base, and formation name for each recorded unit in the borehole. The formation names are defined in the Stratigraphy Types table.

Here’s a Striplogs | 3D | Multiple Logs view of these stratigraphy logs.

strat_logs

Step 2: Establish the Output Dimensions

Once the borehole location and stratigraphy data have been entered, click the Scan Boreholes button at the bottom of the program window to automatically determine the coordinate extents for the project. (You can also just type these in, if you prefer.) Be sure to check the node spacing along the X and Y axes – this will determine how coarse or fine your grid models will be. (We generally recommend a node spacing that’s no greater than half the average distance between the boreholes.)  Here is how the Output Dimensions might look:

output_dims

Step 3: Create a Stratigraphy Model of the borehole-based data

Use the Borehole Manager | Stratigraphy | Model menu option to create surface models (aka “grid models” or “grids”) for the top and base of each stratigraphy formation and display them in the 3D plotting window. This project-wide and interactive view of the model allows you to drill down into the model to see how well the surfaces match the borehole data (be sure to turn on the Plot Logs option to display your stratigraphy logs in the 3D display). You can zoom into the display, rotate it, etc.

original_model

If you are not satisfied with the way the model looks, how it honors the log data, etc., you can adjust the gridding method and other model settings and click Process again to regenerate the grid models and the 3D scene.

Note: the automatic naming scheme for these grids is “formation_top.rwgrd” and “formation_base.rwgrd” for each formation name in your project.  You’ll see these grid names in the Project Manager / Grid Models heading.

Step 4: Create/Import the Fill Grid Models

Once you have a good model of the borehole data, the next step is to create or import the grids representing the fill. If you have XYZ points for the ground and base elevations of the fill, you can enter/import those data into the Utilities datasheet and use the Utilities | Map | Grid-Based Map menu to create the surface models.

Or, if you have existing grids from another software program, you can use the Utilities | Grid | Import menu to convert them into a RockWorks “.rwgrd” format. If necessary, use the Utilities | Grid | Math | Resample menu to resample these imported grids to match the extents and node spacing of your project’s Output Dimensions. It’s important that all of the grids to be incorporated into the final stratigraphic model have the same dimensions.

Important: Name these grid models using the RockWorks naming convention: “Fill_top.rwgrd” and “Fill_base.rwgrd”

Here’s an example of how these surfaces might look in the 3D viewer:

waste_3d

Step 5: Display the stratigraphy grids and fill base grid in cross section

This step will let you visualize the stratigraphic layers which will need to be constrained by the fill grids. Jump back to the Borehole Manager and use the Stratigraphy | Section menu to create a cross section diagram through the middle of the fill area.

BE SURE to turn Interpolate Surfaces OFF– you’ve already created a good stratigraphic model so you don’t need to keep recreating the grids.
BE SURE to turn Plot Surface Profile ON, choosing the Fill_base.rwgrd as the grid model to be displayed with the profile line.

Use the Section Selection Map tab to draw a cross-section trace through the middle of the fill area. In the resulting cross section, make note of the stratigraphic layers which are impacted by the fill and those which are not.

section1

Repeat if you like, for another cross-section trace.

section2

Step 6: Constrain the stratigraphy grids with the fill base

Jump back to the Utilities program tab. Use the Grid | Filters | Limit program to impose a “high-stop” filter on the top grid of your first formation, based on the Fill_Base.rwgrd file. Set the Truncation Type to “Grid A Node = Grid B Node”.

grid_limit_settings

This means that any nodes in this grid surface that stick up above the Fill_base grid are to be assigned the elevation of the Fill_base grid. You can set the output name to the original grid name. Do this for each formation_top and formation_base grid that is impacted by the fill layer.

Tip: Use an RCL script to automate this! Here’s an example.

rcl

(RCL scripts require Level 5 licensing in RockWorks16.)

Step 7: Add the Fill layer to your Stratigraphy Types table

Use the Project Manager to access the Project Tables / Types Tables / Stratigraphy Types, and add a new formation, “Fill”, with a color of your choice, as the first unit in the project. Even though you don’t have any fill layers in your boreholes, this now tricks RockWorks into incorporating the Fill top and base grids into the model.

strat_types

Step 8: Recreate your cross section with the Fill grids and the filtered grids

Use Stratigraphy | Section to recreate the cross section from Step 5 being VERY SURE that Interpolate Surfaces is OFF. This assures that RockWorks will read the existing (filtered) grid models for all of the formations in the Stratigraphy Types table.

section1_BYou can create other Stratigraphy menu diagram with these same surfaces.

Creating and Printing Continuous Logs in LogPlot7

The process of banner printing can be confusing.  First, a couple of general concepts:

  • LogPlot typically creates a banner (continuous) print by creating multiple 8.5 x 11 pages which are chained together with no top or base margins.  That’s the key – you still get a multi-page log but the print occupies the full 11″ extent of the letter-sized paper.  This allows these individual pages to print with no breaks on a roll of paper.  Of course, you can choose a legal page size if you prefer (8.5 x 14) or tabloid (11 x 17) if the printer offers these.  But the key is the no-margin setting.
  • Another option is to specify one very long, custom page length in the printer software to accommodate the entire log on the roll output.  While this is possible, it requires futzing with the page size for each log, which is a pain, AND both the printer and Logplot can run out of memory processing the content for such a large “page”.  I don’t recommend this method unless absolutely necessary.
  • The paper size and the printable portion of that paper (all defined by the printer driver) is stored in the log design in LogPlot.  This is how LP knows how to fit the graphic log on the sheets at compile time.

All plotters offer marginless printing, but sometimes it’s tricky to know how to set this in the driver AND to have LogPlot understand it.  I recommend that users first read the help topic about setting the log’s page size in the Help:

LogPlot Help Window

LogPlot's Help Topic on Setting Your Page Size

The goal: to get the Printable Length of the printer’s “page” to equal the Page Length (e.g. no margins).

Example:  I go to the Windows Control Panel, Devices & Printers.  I right-click on my HP Designjet T520 and choose Printing Preferences.  Here is the window, set to Letter “sheets”, roll paper source, portrait orientation:

HP T520 Printing Preferences Window

HP T520 Printing Preferences Window

I then click the Margins/Layout button to tell the driver that I want Oversize printing so that there will be no margins (contents equal to paper size).

HP T520 Margin Settings

HP T520 Margin Settings

I Apply these settings and close the printer driver window.

In LogPlot, when I go to my log design, choose File | Setup, and choose this printer name, my Printable Length matches my Page Length (top of window). This indicates LogPlot now understands the driver’s setting for no top/bottom margin. Yay!  I click the Set Default Size at the bottom so that my LogPlot page now equals the printer page.

LogPlot Page Setup Window

LogPlot Page Setup Window

All printer/plotter drivers have a different setup; if you get stuck contact our tech support group.

Once you have the page setup in your log design, then compiling the continuous log in LogPlot is easy.  In the Compile window, click on the Header + Footer tab and check the Continuous Output option.  This tells the program to put the header at the top of the first page and the footer at the bottom of the last page, with none in between.  (You can actually disable headers/footers entirely if you like.)

LogPlot Compile Window

LogPlot Compile Window - Header + Footer Settings

One other comment:  If you have an existing continuous log that you need to repaginate for a new/different page length for a new device, follow these steps:

1. Open a new LogView window in LogPlot7 (File | New | LogView).
2.  Choose the File | Open with Page Dimensions menu option.
3. Select the LPT file you wish to repaginate and print.
4. You’ll see the Page Setup window shown above. Be sure the printer info in the upper  part of the window is set up correctly, then click on Set Default Size in the lower part.
5. Click OK. LogPlot will repaginate the continuous log for the new page settings.

Layering Profiles and Cross-Sections in RockWorks

RockWorks allows you to create cross-section and profile diagrams of a variety of types of data – such as modeled lithology, stratigraphy, aquifer, geochemical or geophysical data, fractures, etc.  It can be very helpful to layer these profiles to determine, for example, the spatial relationship between a contaminant hotspot and the stratigraphic layers, or your water levels and the lithologic environment.

I’ll describe here an easy way to pop one profile onto another – in this example overlaying a benzene profile on top of a stratigraphy profile.

1. Create your two profile diagrams using the same annotation settings and the same profile slice.  This assures that the profile panels will have the same coordinate range.  I find it helpful to arrange the two profile windows on my screen, one above the other, so that they are both accessible.

RockWorks I-Data Profile and Stratigraphy Profile Diagrams

Arrange both profiles on your screen so they're both visible.

2. With the RockPlot Edit Arrow tool activated, click on the I-Data profile contours to select them. (Note the red selection handles in the panel corners in the upper image.) Type Ctrl+C to copy this layer into memory.

Select and Copy the I-Data Profile

Click on the I-Data profile color contours to select that layer, and copy it to the clipboard.

3. Click in the Stratigraphy profile window and type Ctrl+V to paste the I-Data profile into this diagram.

Paste the I-Data panel onto the Stratigraphy profile

Paste the I-Data panel onto the Stratigraphy profile

4. Double-click on the I-Data layer you just pasted into the combined diagram to adjust the minimum contour level and transparency, so that the stratigraphic layers will be visible in the background.

Adjust the I-Data Profile Settings

Adjust the minimum contour level and/or transparency.

5. Click OK to close the Colorfill Attributes window.

I-Data Profile Contours Overlaying Stratigraphy Layers

Now you can see the stratigraphic profile in the background.

6. If you like, you can copy /paste the I-Data color legend in to the combined diagram.  Use your mouse to resize/rearrange the legends as desired.

Combined Stratigraphy and Benzene Profiles

Combined Stratigraphy and Benzene Profiles

Creating Batch PDF Output for Your LogPlot Logs

If you want to create PDF output of a bunch of logs created with LogPlot7, you can automate this using the Log | Batch Compile menu command. Here are the steps I’ve taken to set this up. NOTE that this requires that you have a PDF program, such as Adobe Acrobat Pro, or any of the free PDF printers (PDF995, CutePDF, etc. – see RockWare forum postings regarding these) installed as a printer in your Windows system.

1. First, be sure you’re using a build of LogPlot7 that is 7.4.81.107 or newer.

2. Set up your PDF printer as the default printer in LogPlot, using the program’s File |  Setup command. (On some systems you may also need to set up the PDF printer as default in the Windows Control Panel before launching LogPlot.)

3. You can set up the page size for the printer as well.

LogPlot Page Setup window

Setting up the PDF Printer Page Size

4. Set up the PDF printer driver to NOT prompt for PDF file names, and set the output folder to the same folder where the data files reside. I’ve attached an example of what my Acrobat Professional screen looks like, though your version or your PDF printing software may be different. Note that this is an important step so that you won’t be prompted for each PDF output file name.

PDF Print Settings

PDF Print Settings

5. Then, select the Log | Batch Compile menu option in LogPlot.

6. Click the Add button, and in the Batch Editor window define the name of the data file, the log design, scale, and other compile settings. Be sure Print is selected, and be sure the Save as LPT file is also selected and a name defined. (The PDF file name will be based on the LPT name you define here.)

7. Click OK when you’re done, and you’ll see this log’s items listed in the batch window.

LogPlot Batch Window

LogPlot Batch Window

8. Repeat for additional files, though you might start with just a handful to get the hang of it and to be sure the PDF files are actually being created.

9. Save your batch at some point, using the Save button in the Batch Compile window. At a later date, you can use the Load button in this window to load an already-saved batch listing.

! Note: the BTC file that is created is an ASCII XML-type file. If it is easier for you to modify the BTC file directly to add other logs, you certainly may do so, just be careful about the XML syntax.

10. To run the batch, just click the Go button at the bottom of the Batch Compile window. LogPlot should load the selected DAT file, compile it into the selected LDFX file using the indicated settings, save the requested LPT file, and print to PDF, storing the PDF file in the requested folder.  It will repeat this process for each item listed in the batch.

11. If you want to append all of the PDF’s into a single file, you can use Adobe Acrobat’s File | Combine | Merge Files menu option.

Working with Faulted Surfaces

Here are some suggestions for possible workflows in applying faults to surfaces in RockWorks.  These instructions assume you don’t have the coordinates for your faults already defined in an external spreadsheet or in the RockWorks project database; you can draw the fault lines on a map and then use them to fault a surface.

1. Create your contour map in RockWorks without faulting turned on.

  • Use the Utilities Map | Grid-Based Map if your XYZ data is entered into the Utilities datasheet.
  • Use any of the Borehole Manager contour mapping options (Map | Borehole Locations for ground surface contours, Stratigraphy | Structural Elevations for stratigraphic structure maps, etc.) if your data is entered into the borehole database.
RockWorks Unfaulted Contour Map
Unfaulted structure contour map

2. In the displayed map, use the Draw | Line Types | Polyline to draw a fault polyline on your map.  Double-click to terminate the polyline.  You can repeat this if you have multiple faults.

RockWorks unfaulted contour map with drawn polyline

Unfaulted contour map with drawn polyline

3. Choose the arrow-shaped Edit tool from the RockPlot2D toolbar, and click on the polyline you drew, to select it.  (If selected, you’ll see square icons on the vertices.)  If you have multiple polylines drawn, hold down the Shift key on your keyboard to click on the next polyline to select it as well.  Continue in this manner for as many polylines as you drew so that all are selected.

4. Right-click on any of the selected polylines in the map window and choose Save to Faults Table.

Save Fault Polyline to a "Faults Table"

Save Fault Polyline to a "Faults Table"

Enter a name to assign to the Faults Table and click OK.  This will be saved to the project database.

5. Return to the options along the left side of the map window, and click on the Gridding Options button.  Here, turn on the Faulting option (which is available under Inverse-Distance).  Enter the “distance multiplier” (usually 10) and browse for the name of the Fault Table that you just created.

RockWorks Gridding Options - Faulting settings

Gridding Options - Faulting settings

Click OK to close this window. Click on the Grid Name prompt and enter a new name for the faulted grid model (such as “Potosi_faulted.grd”).

6. Click Process to recreate the grid model and map, now applying faulting.

RockWorks Faulted Contour Map

Faulted Contour Map

Here are three-dimensional views of these surfaces:

RockWorks - Unfaulted Surface in 3D

Unfaulted Surface in 3D

RockWorks - Faulted Surface in 3D

Faulted Surface in 3D

RockWorks applies faulting by creating an interpolation barrier on either side of the polyline(s) – as it’s interpolating a grid node, any control points on the other side of the fault are now considered to be 10 times further away than they actually are, thus having no influence on that node.

 

Exporting Lithologic Surfaces to DXF

As RockWorks view the world, lithology materials are not necessarily layered – they can repeat within a single borehole and may be inconsistent in sequence across the project area. As such, RockWorks uses a solid modeling process, rather than surface-modeling, to create lithology models, with the 3D nodes or voxels assigned a material type and represented in the 3D viewer as color-coded blocks.

RockWorks software: Lithology Model in RockPlot3D

Lithology Model in RockPlot3D

This presents a challenge, then, for users who wish to view lithologic SURFACES as plan-view contour maps, or in 3D, or exported to CAD.

In RockPlot3D you can access the lithology model’s Options window and filter the display for the desired material type, or range of types. Here is the above model filtered to display the Soil voxels only.

RockWorks software: Lithology Model Filtered for Soil Only

Lithology Model Filtered for Soil Only

This can be exported to DXF, but note that you’ll be getting all of the blocks representing that material. (Shown here in black and white for contrast purposes.)

RockWorks software: Lithology Model Soil Voxels Exported to DXF

Lithology Model Soil Voxels Exported to DXF

If you need a surface rather than blocks, RockWorks also has tools which will fit a surface to the uppermost elevations or the lowermost elevations of a rock type in a lithology model. These are in the Lithology | Superface (Top) and Subface (Base) menus. Here is an example of the same soil lithotype extracted as a surface (upper elevations), and displayed in RockPlot3D and then exported to DXF.

RockWare software: Surface Representing Top of Soil

Surface Representing Top of Soil, Displayed in RockPlot3D

RockWare software: DXF Surface Representing Top of Soil

DXF Surface Representing Top of Soil

Earthquakes 5+ Magnitude Worldwide February – April 2012

We used RockWorks15 and Google Earth (TM) to create maps of all the 5+ magnitude earthquakes across the world in February, March, and April 2012.  You can visit our RockWorks data page to download the Google Earth KMZ file and the RockWorks data file:

February 5+ Earthquakes: http://www.rockware.com/assets/products/165/downloads/data/37/usgsworldquakes5+feb2012.zip
March 5+ Earthquakes: http://www.rockware.com/assets/products/165/downloads/data/38/usgsworldquakes5+mar2012.zip
April 5+ Earthquakes: http://www.rockware.com/assets/products/165/downloads/data/40/usgsworldquakes5+apr2012.zip

Google Earth (TM) display of earthquakes, April 2012

Google Earth (TM) display of earthquakes worldwide, April 2012, from RockWorks15

Once you load the KMZ file into Google Earth, more information is available about each quake by clicking on the symbols.

Earthquakes 5+ Magnitude Worldwide Jan 2012

We used RockWorks15 and Google Earth (TM) to create a map of all of the 5+ magnitude earthquakes across the world in January 2012. You can visit our RockWorks data page to download the Google Earth KMZ file and the RockWorks data file:

http://www.rockware.com/assets/products/165/downloads/data/36/usgsworldquakes5+jan2012.zip

January 2012 earthquakes from RockWorks15
Google Earth (TM) display of earthquakes worldwide, Jan 2012, from RockWorks15
Once you load the KMZ file into Google Earth, more information about each quake is available by clicking on the symbols.

Earthquakes 5+ Magnitude Worldwide Dec 2011

We used RockWorks15 and Google Earth (TM) to create a map of all of the 5+ magnitude earthquakes across the world in December 2011. You can visit our RockWorks data page to download the Google Earth KMZ file and the RockWorks data file.

http://www.rockware.com/assets/products/165/downloads/data/35/usgsworldquakes5+dec2011.zip

Google Earth (TM) display of earthquakes worldwide, Dec 2011

Google Earth (TM) display of earthquakes worldwide, Dec 2011

Once you load the KMZ file into Google Earth, more information about each quake is available by clicking on the symbols.