Skip to content

A R-based digitizer that is used to discretize hand-drawn stratigraphic sections/core logs into a numerical format for use in statistical analysis, visualization, or prediction of sedimentary strata.

License

Notifications You must be signed in to change notification settings

ActiveMargins/stRatstat

Repository files navigation

stRat stat

stRat stat is a R-based digitizer that is used to discritize hand-drawn stratigraphic sections (i.e., core logs, measured sections) into a numerical datatable format for use in numerical analysis. This tool was designed by D.Coutts (main author) to learn R. As such, there may be inelegant solutions and shortcomings within the code. If you have any suggestions please contact D.Coutts at [email protected] or make a pull request on GitHub.

Description

Stratigraphic sections (i.e., measured sections, core logs, etc.) are a main tool used by sedimentologists, stratigraphers, and basin analysists communicate the nature of the sedimentary record to others. Stratigraphic sections are used to describe bed thickness thickness, bed boundary geometry, grain size, and sedimentary structures (physical and biogenic) of lithofacies or larger lithosomes in a graphical/visual form. They're typically composed of an x-axis that is used to describe the grain size of the sediment and the y-axis is used to describe the thickness of the drawn interval. The scale of an individual stratigraphic section ranges from meters (to describe subtle sedimentary procces) to thousands of meters (to describe an entire basin fill). stRat stat is an R-based application that allows for users to discretize a stratigraphic section in to a numerical data format, for later statstical invesitgation and visualization. Additionally, users can pair both discrete measurements (e.g., core measurements) and continuous measurements (e.g., petrophysical logs) to the stratigraphic section data and summarize these additional data by stratigraphic heirarchies coded into to stRat stat. The outputof stRat stat is in in the form of a .csv datatable, that can be manipulated or visualized using other platforms (e.g., R, Excel, python, etc.).

For a quick review of the application check out this conference presentation from CSPG's GeoConvention 2020 (20 mins).

  • An online version of stRat stat is hosted on shinyapps.io.
  • For a full description of the stRat stat software, see the user manual within the GitHub repository.
  • For examples of workflows that have leveraged bed-scale and facies-scale data similar to what stRat stat produces, see the list of publications below.

Installation

stRat stat is currently in a package format housed within a public GitHub repository. To install the stRat stat package, use the devtools package.

install.packages(“devtools”)
library(devtools)
install_github(“ActiveMargins/stRatstat”)
library(stRatstat)

Once installed and loaded into the current R session, to launch the stRat stat program

launchstRatstat()

stRat stat design and usage

Stratigraphic section data are a highly variable type of data. The axes on straitgraphic sections vary depending on the interval of interest and personal preferences. Grain size can increase in either the positive or negative directions on the x-axis and may range upards of five orders of magnitude. As such, stRat stat requires manual input of the top and bottom of the stratigraphic section, grain size divisions (along the x-axis of the section), bed boundaries, and the grain size profile. Two important aspects of translating these picked positions to geologic data are covered below.

Grain size direction and magnitude

Grain size divisions that are picked along the x-axis of the stratigraphic section are used to interpolate the grain size profile of the section. Grain size divisions can increase in value to either the right or left, depending on personal preference. In any case the grain size division points should be pick in the increasing value of grain size. Grain size profile points that are picked beyond (i.e., left or right of) the range of input grain size divisions, will be given the value of the closest division.

Grain size interpolation through bed boundaries

The main algorithm of stRat stat interpolates the grain size infromation, based on input user points, for each discretized interval within the stratigraphic section. The algorithm used here first interpolates the grain size value of each point within the grain size profile to provide a value for each cell, but then cycles through each bed and checks the number of grain size points within each bed.

  • If there are zero grain size profile points within the bed, all grain size information is removed and the interval is treated like cover or lost core.
  • If there is a single grain size profile point within the bed, the grain size of the single point will be used for all discretized intervals within the bed.
  • If two or more grain size profile points are located within the bed, the interpolated grain size profile will be used, except discritized intervals below the lowest point and intervals above the highest point will be given uniform grain size values.

This approach allows for realistic bed fining or coarsening profiles to be input, as well as speed up the process of inputing points, as a single point can be used for uniform grain size profiles.

Grain size profile points that are picked in the first bed (i.e., below the first bed boundary) or in the last bed (i.e., above the last bed boundary) will use the interpolated grain size profile up until the end of the picked points and use a uniform grain size profile for all discritized intervals from the lowest grain size profile point to the base of the section, and from the highest grain size profile point to the top of the section.

Troubleshooting

Known bugs

  • An error message may "Cannot find x" may appear on the right-hand plot on the first digitization page. If this appears, rebrush the left-hand plot or click the "Update" button.
  • When deleting points or logged intervals from the table (e.g., grain size profile, sedimentary structure intervals), data may disappear on the right-hand plot. If that happens, move the position of the brush on the left-hand plot and the data will be reloaded
  • The thickness at at the bottom of the section MUST be set to zero

Image size limitations in stRat stat and how to resize images in R

stRat stat can only handle small <1 MB images. Images in .png have been found to work better compared to .jpeg. Even though .jpeg often save to smaller file sizes, the lossy compression is apparent when working with images with stRat stat. The lossless compression of .png is helpful. If images are too large to for stRat stat to handle efficiently, the Imager package can be used to resize .jpg and .png files easily in R. A simple workflow for this is below:

Imager install

install.packages(“imager”)
library(imager)

Load, resize, and save the image. Imager natively suppots .jpeg, .png, .tiff, and .bmp file formats. An example of resizing a .png and saving it to .jpg is shown here:

#Load image into R. Use path to the file you want to load:
im <- load.image("/somedirectory/myfile.png")

#Resize the image. Negative arguemnts in the resize() function resizes to the image to that percentage of the the original
im_resized <- resize(im,-10,-10) # here we would resize to 10% of the original.

#Save image. The file extension controls file format.
save.image(im_resize, "Resized.jpg")

Algorithm Validation