File Format

stratapy uses CSV (comma separated variable) formatted files to convert data into visualisations. Input files are accepted in various formats: .csv, .txt, and .xlsx. You can make these files yourself, or an Excel template with selectable options can be downloaded here. [not yet available].

Files should contain rows for each unit to be displayed, with columns specifying various parameters for that unit. The table below lists all of the column types. At a minimum, the height/age and rock columns must be filled, but all others are optional. Further customisations to graphics beyond this input file can be specified later using stratapy itself.

Column Name

Example Values

Description

height/age

80

100.5

Height or age value of the top of the unit, numerical values only.

rock

Sandstone

gravel*

Rock type or lithology, see complete list of available lithologies at Available Assets . Can be specified using either the lithology name or key.

thickness

2.5

4

Thickness of the layer, numerical. Can be left blank and the thickness will be assumed from the ‘height/age’ column. Thickness of the last unit should be specified, otherwise it will be set to the same value as the penultimate unit.

bottom_grain

4

c

Grain size at the bottom of the layer, can be numerical or a string in the x-axis labels - see bottom_grain for more details.

top_grain

2.7

m

Grain size at the top of the layer, can be numerical or string - see bottom_grain for more details.

connection_type

convex

sawtooth

Type of contact with underlying layer (e.g., concave, convex, sawtooth). Defaults to ‘’.

erosion

5

-2;1

Specifies the amplitude and frequency of the erosional contact at the bottom of each unit; format is erosion;frequency, if left blank, it will be set to zero. See full details in erosion.

lenses

clay

limestone;sandstone

Presence of lenses within a unit. Multiple lenses can be separated by semicolons (e.g., ‘clay;limestone’).

minerals

garnet

olivine;quartz

Notable minerals present in a unit. Multiple minerals can be separated by semicolons (e.g., ‘garnet;olivine’).

features

trilobite

coral;brachiopod

Fossils or sedimentary structures present in a unit. Multiple features can be separated by semicolons (e.g., ‘trilobite;coral’).

contact

erosional

sharp

Type of contact on the bottom of the unit. Options include ‘gradational’, ‘sharp’ or ‘erosional’.

height/age

The height or age of the top of the unit. Rows should be entered in monotonically increasing order for age-based figures, or monotonically decreasing order for depth- or height-based figures. Depth and height are determined automatically depending on whether there are more negative or positive values, respectively.

rock

The rock type or lithology of the unit. This can be any lithology’s ‘key’ (e.g. 607) or name (e.g. limestone) from the Available Assets list. Lithology names must match those in the available list; stratapy will try to inform you of nearby matches upon if a passed value is not available.

All lithological patterns all are black and white by default, however, all labelled patterns have a coloured version which can be used by appending ‘*’ to the key, e.g. 6038, or limestone*.

Patterns, colours, and labels, of lithologies can be adjusted, and custom lithologies can be added for use using the stratapy.core.StratigraphyPackage.add_lithology() method - see Lithologies for full details.

thickness

The thickness of the unit. If left blank, the thickness will be assumed from the difference between the height/age of the current and next unit. The thickness of the last unit should be specified, otherwise it will be set to the same value as the penultimate unit.

bottom_grain

The grain size at the bottom of the unit. This value can either be a number (float) or string corresponding to one of the grain sizes or their label names. By default, the labels and their corresponding numbers are as given below.

It may be more convenient to specify using strings, however, for more precise control over unit placement (e.g., having a grain size between silt and very fine sand) numerical inputs may be desired. Numerical and string inputs can be mixed in the same file.

A value of 5.9 would place the grain size just below ‘very coarse sand’, displaying the next label up (i.e., ‘very coarse sand’) on the x-axis. Setting this value to 6.0 would then cause the next label to be displayed (i.e., ‘gravel’).

Grain Size

clay

silt

very fine sand

fine sand

medium sand

coarse sand

very coarse sand

gravel

pebble

boulder

Label Name

clay

silt

vf

f

m

c

vc

g

p

b

Value

1

2

3

3.5

4

4.5

5

6

7

8

For more customised control over the grain size labels and values, these values can be modified - see Grain Size for more details.

top_grain

The grain size at the top of the unit, follows the same rules as bottom_grain.

connection_type

The type of ‘cap’ on the right-hand side of a unit. This can be any of the following: ‘concave’, ‘convex’, ‘sawtooth’, ‘sawtooth_r’ or left blank for no contact. Defaults to ‘’ (blank).

Sawtooth or its reverse (sawtooth_r) displays three triangular peaks on the right-hand side of the unit. Concave and convex display a curved cap, with the curve facing inwards or outwards, respectively.

Combined units (where the same lithology is present in consecutive rows) will be plotted as one unit, but each sub-unit can have a different connection type. If any of the sub-units’ connection_type value contains ^ (e.g., ‘concave^’ or ^’sawtooth’), a smoothing algorithm will be applied to the right-hand side of the entire combined unit. Note, this may not always give the desired result, particularly when there is a high level of complexity in the sub-units.

erosion

If a sinusoidal erosional contact is desired between two units, this column specifies the amplitude and frequency of that indicator at the bottom of a unit. If left blank, it will be ignored.

The format is erosion;frequency, where erosion is the amplitude of the sine wave (in the same units as the height/age column), and frequency is the number of troughs and peaks within each unit of the x-axis. The amplitude can be positive or negative - a negative amplitude will invert the sine wave (i.e., a 180 degree phase shift). If only one value is provided (e.g., 4), it will be taken as the amplitude, and frequency will kept to a default. If frequency is set to 0, no erosion will be displayed, even if an amplitude is provided.

Note that the total height (peak to trough) of the sinusoidal indicator is twice the amplitude. Some examples are provided in the image below:

lenses

If lenticular lenses are desired in a unit, any Available Assets can be specified in this column, separated by semicolons (e.g., ‘clay;limestone’) if more than one lens is present, or multiple lenses of one lithology (e.g., ‘clay;clay’) are desired.

minerals

If notable minerals are present in a unit, they can be specified in this column, separated by semicolons as with lenses above. .. Also similar to lenses, the lense_mode parameter determines whether these are displayed within the unit or in the features column.

features

If fossils, or sedimentary/tectonic structures are present in a unit, they can be specified in this column, in the same format as lenses and minerals. Features must be one of the Available Assets list. .. , and are again displayed following the lense_mode parameter.

contact

To indicate types of contact between units, this column is used to indicate the formatting of the contact at the bottom of a unit. Available options are ‘sharp’, ‘gradational’, or left blank for the default contact.

Note that the ‘erosional’ contact type is created automatically when erosion is specified in the erosion column, and cannot be specified in this column.

Available contact types in stratapy

Example Input File

The table below shows the input file for the tutorial file which will be used in this documentation. a simple log which we will visualise in this tutorial.

Example input file for stratapy

height/age

rock

thickness

bottom_grain

top_grain

connection_type

erosion

lenses

minerals

features

contact

2.5

607*

vc

f

planar laminations

gradational

2.15

601*

p

vc

0.03;0.5

glauconite

clasts

1.6

643*

c

c

convex

0.15;0.65

1.2

651*

m

m

0.05;0.2

radiolarian

0.6

602*

b

cb

concave

0.03;0.4

601*

rip up clasts;shell hash

0.42

721

0.42

b

b

Tip

Remember, you can download the accompanying Jupyter Notebook which accompanies this tutorial, or use it online through Google Colab.

Tip

stratapy comes with a number of built-in example files, including the one used in this tutorial, which can be loaded using sp.load('examples.XXX.csv'). For a full list of available example files, run sp.list_examples(). You can also use these example files as templates to create your own input files.