Basic objects

A striplog depends on a hierarchy of objects. This notebook shows the objects and their basic functionality.

  • Lexicon: A dictionary containing the words and word categories to use for rock descriptions.
  • Component: A set of attributes.
  • Interval: One element from a Striplog — consists of a top, base, a description, one or more Components, and a source.

Striplogs (a set of Intervals) are described in a separate notebook.

Decors and Legends are also described in another notebook.

In [1]:
import striplog
striplog.__version__

# If you get a lot of warnings here, just run it again.
Out[1]:
'0.7.2'

Lexicon

In [2]:
from striplog import Lexicon
print(Lexicon.__doc__)
    A Lexicon is a dictionary of 'types' and regex patterns.

    Most commonly you will just load the default one.

    Args:
        params (dict): The dictionary to use. For an example, refer to the
            default lexicon in ``defaults.py``.
    
In [3]:
lexicon = Lexicon.default()
lexicon
Out[3]:
{'colour': ['red(?:dish)?', 'gray(?:ish)?', 'grey(?:ish)?', 'black(?:ish)?', 'whit(?:e|ish)', 'blu(?:e|ish)', 'purpl(?:e|ish)', 'yellow(?:ish)?', 'green(?:ish)?', 'brown(?:ish)?', 'light', 'dark', 'sandy'], 'abbreviations': {'Aglm': 'agglomerate', 'rexl': 'recrystallization', 'micropor': 'microporosity', 'OCM': 'oil cut mud', 'lt': 'lighter', 'fnt': 'faintly', 'Foss': 'fossiliferous', 'corln': 'coralline', 'Arag': 'aragonite', 'Ls': 'limestone', 'Plag': 'plagioclase', 'sqz': 'squeezed', 'MMCFG': 'million cubic feet of gas', 'prly': 'pearly', 'aft': 'after', 'sol': 'solitary', 'Jt': 'joint', 'intpar': 'interparticle', 'apr': 'apparent', 'lithgr': 'lithographic', 'tstg': 'testing', 'Deer': 'decrease', 't.b.': 'thin-bedded', 'rbl': 'rubblbly', 'elong': 'elongate', 'Sa': 'salt', 'Spg': 'sponge', 'Deb': 'debris', 'assoc': 'associated', 'hi': 'high', 'wtr': 'water', 'gywk': 'graywacke', 'calctc': 'calcitic', 'In': 'inch', 'Unconf': 'unconformity', 'O&SW': 'oil and salt water', 'Ltl': 'little', 'Conc': 'concretion', 'rhb': 'rhombic', 'crpxln': 'crystocrystalline', 'Exclas': 'extraclast', 'BOPH': 'barrels of oil per hour', 'Res': 'residue', 'strg': 'stringer', 'Micr': 'micrite', 'ES': 'electric', 'Ceph': 'cephalopod', 'Tp': 'top', 'mat': 'material, matter', 'Cvg': 'caving', 'x-strat': 'cross-stratified', 'Tent': 'tentaculites*', 'spic': 'spicular', 'Char': 'charophyte', 'Grt': 'granite', 'Av': 'average', 'mtx': 'matrix', 'Sphal': 'sphalerite', 'Tas': 'tasmanites*', 'mot': 'mottled', 'SO': 'show of oil', 'chit': 'chitinous', 'Solen': 'solenopora*', 'onc': 'oncolites', 'fls': 'flesh', 'acic': 'acicular', 'Kao': 'kaolin', 'Pent': 'pentamerus*', 'spher': 'spherulitic', 'clyst': 'claystone', 'sks': 'slickensided', 'x': 'cross', 'perm': 'permeability', 'blky': 'blocky', 'sa': 'salt', 'lim': 'itic', 'Cub': 'cube', 'GIP': 'good initial puff', 'Sphaer': 'sphaerocodium*', 'pisol': 'pisolitic', 'Tr': 'trace', 'scat': 'scattered', 'ool': 'oolitic', 'incr': 'increasing', 'vug': 'vugular', 'dns': 'denser', 'loc': 'location', 'blsh': 'bluish', 'Ptg': 'parting', 'mod': 'moderate', 'Rf': 'reef', "'' or do": 'ditto', 'rng': 'range', 'eux': 'euxinic', 'hvy': 'heavy', 'litt': 'littoral', 'Tham': 'thamnopora*', 'qtzt': 'quartzite', 'abs': 'absent', 'drsy': 'drusy', 'gen': 'generally', 'Fe-mag': 'ferro-magnesian', 'grd': 'graded', 'sdy': 'sandy', 'contm': 'contaminated', 'shad': 'shadow', 'Min': 'mineral', 'Styl': 'stylolite', 'Grv': 'gravel', 'rug': 'rugosa', 'Ren': 'renalcis*', 'Glos': 'gloss', 'comp': 'completion', 'grysh': 'greyish', 'Musc': 'muscovite', 'jt': 'jointing', 'Gr': 'grains', 'p.p.': 'pin-poin', '(D)': 'development', 'Bry': 'bryozoa', 'x-lam': 'cross-laminated', 'BWPD': 'barrels of water per day', 'dissem': 'disseminated', 'gns': 'gneiss', 'Radax': 'radiaxial', 'OTS': 'oil to surface', 'Gast': 'gastropod', 'Slst': 'siltstone', 'Cht': 'chert', 'ves': 'vesicular', 'glau': 'glauconitic', 'dess': 'dessiccation', 'vert': 'vertical', 'Shlt por': 'shelter porosity', 'Nod': 'nodules', 'rdsh': 'redish', 'indst': 'indistinct', '&': 'and', 'Fp': 'flowing pressure', 'gept': 'geopetal', 'pos': 'possibility', 'Scaph': 'scaphopod', 'calc': 'calcitareous', 'cren': 'crenulated', 'Poln': 'pollen', 'k': 'permeabilityable', 'dk': 'darker', 'Biosp': 'biosparite', 'w/': 'with', 'Hem': 'hematite', 'intr': 'intrusionive', 'brt': 'bright', 'Ark': 'arkose', 'Splin': 'splintery', 'x-bd': 'cross-bedded', 'brd': 'bored', 'crnk': 'crinkled', 'Wd': 'wood', 'DIL': 'dual induction laterolog', 'Shl': 'shell', 'Sedm': 'sediment', 'dol': 'dolomitic', 'lav': 'lavender', 'yelsh': 'ish', 'tuf': 'tuffaceous', 'Sid': 'siderite', 'brec': 'brecciated', 'nod': 'nodule', 'brhg': 'branching', 'I.P.': 'in part', 'Micropor': 'micropore', 'tt': 'tightly', 'fenst': 'fenestral', 'cub': 'cubic', 'posa': 'possible', 'Assem': 'Assem', 'Fau': 'fauna', 'fros': 'frosted', 'prob': 'probably', 'fspr': 'feldsparathic', 'Lut': 'lutite', 'hom': 'homogeneous', 'cmt': 'cemented', 'GCW': 'gas cut water', 'gvl': 'gravel', 'FDL': 'formation density log', 'C': 'coal', 'Bld': 'boulder', 'grapst': 'grapestone', 'frmwk': 'framework', 'Ig': 'igneous rock', 'biost': 'biostromal', 'lam': 'laminated', 'mrly': 'marly', 'pkr': 'packer', 'ML': 'microlog, minilog', 'mica': 'micaeous', 'sch': 'schist', 'ooc': 'oocastic', 'sm': 'smooth', 'Sh': 'shale', 'strat': 'strataified', 'Slt': 'silt', 'freq': 'frequent', 'Euryamph': 'euryamphipora*', 's': 'small', 'flky': 'flaky', 'wvy': 'wavy', 'bdg': 'bedding', 'occ': 'occasional', 's & p': 'salt and pepper', 'BHCS': 'bore hole compensated sonic', 'Bm': 'basement', 'ctc': 'contact', 'gy': 'gray', 'wh': 'white', 'p.d': 'pressure deformation', 'evap': 'evapourititic', 'cov': 'covered', 'Lim': 'limonite', 'Pap': 'paper', 'len': 'lentilcular', 'pt': 'partly', 'a.a.': 'same as above sample', 'por': 'poroussity', 'hydc': 'hydrocarbon', 'Spr': 'spore', 'hrtl': 'horizontal', 'orsh': 'orangish', 'Spl': 'sampole', 'Mn': 'manganese', 'slily': 'slightly', 'chty': 'cherty', 'micgr': 'micrograined', 'Pch': 'patch', 'Fuc': 'fucoid', 'bioh': 'biohermal', 'SOCW': 'slight oil cut water', 'DL': 'density log', 'gl': 'glassy', 'pyrbit': 'pyrobitumen', 'chk': 'chalky', 'Gil': 'gilsonite', 'Surf': 'surface', 'Allo': 'allochem', 'p': 'poorly', 'spr': 'sparry', 'G': 'gas', 'coqid': 'coquinaoid', 'LL8': 'laterolog-8', 'abnt': 'abundant', 'Cor': 'coral', 'Ool': 'oolite', 'Chal': 'chalcedony', 'thk': 'thick', 'wk': 'weak', 'Bent': 'bentonite', 'cp': 'compare', 'syn': 'syntaxial', 'Spo': 'spore', 'Cono': 'conodont', 'SGCM': 'slight gas cut mud', 'Microstyl': 'microstylolite', 'GAP': 'good air blow', 'meta': 'metamorphic', 'mar': 'maroon', 'ptg': 'parting', 'spl': 'sample', 'bit': 'bitumeninous', 'blksh': 'blackish', 'pyrcl': 'pyroclastic', 'Par': 'particle', 'Peld': 'pelletoid', 'srt': 'sorting', 'sacc': 'saccharoidal', 'intxln': 'intercrystalline', 'Repl': 'replaced', 'Hyde': 'hydrocarbon', 'BHT': 'bottom hole temperature', 'embd': 'embedded', 'vgt': 'varigated', 'Chlor': 'chlorite', 'ck': 'choke', 'stmg': 'streaming', 'rf': 'reefoid', 'V.op': 'valve open', 'Biot': 'biotite', 'cl': 'clastic', 'Biomi': 'biomicrite', 'tr': 'trace', 'Strk': 'streak', 'Exv': 'extrusive rock', 'OSR': 'oil source rock', 'Sol': 'Soution', 'sbrndd': 'sub rounded', 'repl': 'replacement', 'bot': 'botryoidal', 'qtzc': 'quartzitic', 'Pyr': 'pyrite', 'clus': 'cluster', 'BHFP': 'bottom hole flow pressure', 'Intclas': 'intraclast', 'Pyrxn': 'pyroxene', 'conch': 'conchoidal', 'Plcy': 'palecypod', 'Mic': 'micaceous', 'nac': 'nacerous', 'crd': 'cored', 'mott': 'mottled', 'vps': 'very poor samples', 'IES': 'induction electric', 'strgr': 'stringer', 'prphy': 'porphyry', 'bldr': 'boulder', 'bu': 'buff', 'vrtl': 'vertical', 'Macrofos': 'macrofossil', 'tns': 'tension', 'fos': 'fossiliferous', 'Cont': 'content', 'Scol': 'scolecodonts', 'slky': 'silky', 'Chit': 'chitinous', 'sy-Ca': 'sparry calcite', 'skel': 'skeletal', 'Crin': 'crinoidal', 'Phyl': 'phyllite', 'Jasp': 'jasper', 'musc': 'muscovite', 'D & A': 'dry and abandoned', 'Fen': 'fenestra', 'ark': 'arkosic', 'pel': 'pellet', 'chlor': 'chlorite', 'imp': 'impression', 'phen': 'phenocrysts', 'OWPB': 'oil well plugged back', 'Pend': 'pendularous', 'Bdg': 'bedding', 'w/o': 'without w/o', 'intlam': 'interlaminated', 'Pelec': 'pelecypod', 'pred': 'predominantly', 'rad': 'radiating', 'bor': 'boreding', 'or': 'orangish', 'Milid': 'miliolid', 'Lat': 'laterite', 'Mag': 'magnetite', 'Foram': 'foraminifera', 'vi': 'violet', 'conspic': 'conspicuous', 'fnly': 'finly', 'G.W.': 'granite wash', 'Lam': 'laminations', 'Gal': 'galeolaria*', 'tex': 'texture', 't.s.': 'thin section', 'intgn': 'inter grown', 'sps': 'sparsly', 'rr': 'rare', 'Bit': 'bitumen', 'diagn': 'diagenesisetic', 'sed': 'sedimentary', 'prim': 'primary', 'typ': 'typical', 'Calc': 'calcite', 'Gran': 'granule', 'lge': 'large', 'Vnlet': 'veinlet', 'bld': 'bladed', 'S.W.': 'salt water', 'BHSIP': 'bottom hole shut in pressure', 'gry': 'greyish', 'sec': 'secondary', 'chal': 'chalcedony', 'sln': 'solution', 'psool': 'pseudo oolitic', 'drlr': 'driller', 'circ': 'circulation', 'Pkst': 'packstone', 'poly': 'polygonal', 'Ooc': 'oolicast', 'Het': 'Heterostegina', 'W.R.': 'washed residue', 'Satm sat': 'saturation', 'intv': 'interval', 'slt': 'silt', 'dru': 'drusy', 'bur': 'burrowed', 'Rpl': 'ripple', 'argl': 'argillate', 'Brac': 'brachiopod', 'Ech': 'echinoid', 'splty': 'splintery', 'boudg': 'boudinage', 'crpxl': 'cryptocrystalline', 'cln': 'clean', 'GOR': 'gas-to-oil ratio', 'Volc': 'volcanic', 'BHP': 'bottom hole pressure', 'Fus': 'fusulinid', 'mic': 'micro', 'pet': 'petroleumiferous', 'Gt': 'grit', 'dend': 'dendritic', 'flor': 'fluorescence', 'Str': 'structure', 'uni': 'uniform', 'gnsh': 'greenish', 'sil': 'siliceous', 'rmn': 'remainant', 'Syring': 'syringopora*', 'FTAB': 'faint air blow', 'Cmt': 'cement', 'PPM': 'parts per million', 'fltg': 'floating', 'Trip': 'tripoli', 'abd': 'abundant', 'com': 'common', 'slb': 'slabby', 'frac': 'fractured', 'Pol': 'polish', 'gyp': 'gypsumiferous', 'Rud': 'rudist', 'Port por': 'porosity', 'Rec': 'recovery', 'Lig': 'lignite', 'u': 'upper', 'sat': 'saturated', 'phos': 'phosphatic', 'Smwt': 'somewhat', 'LL': 'laterolog', 'dom': 'dominant', 'Evap': 'evapourite', 'bioturb': 'bioturbated', 's&p': 'salt & pepper', 'PB': 'plugged back', 'FIt': 'fault', 'pbl': 'pebble (4-64 mm)', 'Para': 'paraparchites*', 'Vn': 'vein', 'crpld': 'crumpled', 'intgran': 'intergranular', 'strk': 'streaked', 'Grst': 'grainstone', 'oo': 'ooidal', 'bri': 'bright', 'och': 'ochre', 'gr': 'grained', 'mnrl': 'mineralized', 'sft': 'soft', 'lac': 'lacustrine', 'Equiv': 'equivalent', 'w': 'well', 'vcol': 'varicolored', 'Bor': 'bored', 'Wkst': 'wackestone', '@': 'at', 'gd': 'good', 'irid': 'iridescent', 'rndd': 'rounded', 'Stri': 'striae', 'unident': 'unidentifiable', 'pk': 'pink', 'IAB': 'initial air blow', 'qtz': 'quartz', 'sl': 'slightly', 'Lyr': 'layer', 'Clslt': 'calcisiltite', 'spkld': 'speckled', 'p-p': 'pin point', 'flg': 'flaggy', 'des': 'descript', 'Gwke': 'graywacke', 'Qtzt': 'quartzite', 'olvn': 'olivine', 'pres': 'preservation', 'rhmb': 'rhombic', 'Spher': 'spherule', 'KB': 'kelly bushing', 'spty': 'spottedy', 'cbl': 'cobble (64-256 mm)', 'Iran': 'granule', 'Pybit': 'pyrobitumen', 'prom': 'prominently', 'Chtz': 'chitinozoa', 'uncons': 'unconsolidated', 'Fe': 'iron-ferruginous', 'intercal': 'intercalated', 'Rbl': 'rubble', 'altg': 'alternating', 'Endo': 'endothyra*', 'Bnd': 'band', 'Mbl': 'marble', 'csg': 'casing', 'SNP': 'sidewall neutron porosity log', 'bdeye': 'birdseye', 'Tub': 'tube', 'DST': 'drill stem test', 'intclas': 'intraclastic', 'lent': 'lenticular', 'SI': 'shut in', 'oomol': 'oomoldic', 'styl': 'stylotitic', 'ang': 'angular', 'Casph': 'calcisphaera*', 'S': 'sonic, acoustilog', 'brk': 'brackish', 'str': 'streak', 'G&OCM': 'gas and oil cut mud', 'psdo': 'pseudo', 'mnut': 'minute', 'SW': 'salt water', 'insl': 'insoluble', 'Belm': 'belemnites*', 'sli': 'slightly', 'num': 'numerous', 'amb': 'amber', 'Anhy': 'anhydrite', 'Incl': 'inclusion', 'Len': 'lens', 'conc': 'concretionary', 'Sd': 'sand', 'stri': 'striated', 'Psool': 'pseudo oolite', 'Ost': 'ostracod', 'Pst': 'pumice-stone', 'Spic': 'spicule', 'Gab': 'gabbro', 'men': 'meniscus', 'xln': 'crystalline', 'Novac': 'novaculite', 'intrlam': 'interlaminated', 'resd': 'residual', 'sph': 'spherules', 'Bubl': 'bubble', 'euhed': 'euhedral', 'Tf': 'tuffaceous', 'Mdst': 'mudstone', 'Rk': 'rock', 'wthd': 'weathered', 'consol': 'consolidated', 'marn': 'marine', 'dism': 'disseminated', 'OWWO': 'old well worked over', 'xbd': 'cross-bedded', 'biocl': 'bioclastic', 'med.': 'medium', 'T.D.': 'total depth', 'Phos': 'phosphate', 'ap': 'appears', 'PD': 'per day', 'Sl': 'slate', 'Meta': 'metamorphic rock', 'crinal': 'crinoidal', 'mdy': 'muddy', 'frg': 'fringing', 'intst': 'intersticitial', 'n/s': 'no show', 'Amph': 'amphipora*', 'Glauc': 'glauconite', 'grnt': 'granite', 'Sst': 'sandstone', 'carb': 'carbonaceous', 'ab': 'above', 'Ctc': 'contact', 'WAB': 'weak air blow', 'SSO': 'slight show of oil', 'fis': 'fissile', 'aglm': 'agglomerate', 'WIP': 'weak initial puff', 'Contam': 'contamination', 'rthy': 'earthy', 'crs': 'coarse', 'Sil': 'silica', 'Su': 'sulphur', 'Dia': 'diameter', 'alt': 'altering', 'Oo': 'ooid', 'Spk': 'speck', 'mass': 'massive', 'Cal': 'caliper', 'GL': 'guard log', 'g': 'good', 'detr': 'detrital', 'porcel': 'porcelaneous', 'aren': 'arenaceous', 'frs': 'fresh', 'exclas': 'extraclastic', 'fac': 'faceted', 'Inoc': 'inoceramus*', 'gty': 'gravity', 'foram': 'foraminiferal', 'incl': 'inclusion', 'pit': 'pitted', 'Pet': 'petroleum', 'op': 'open', 'GR': 'gamma ray', 'zn': 'zone', 'lse': 'loose', 'Biost': 'biostrom', 'Piso': 'pisoid', 'SO&W': 'show of oil and water', 'Btm': 'bottom', 'hex': 'hexagonal', 'frag': 'fragmental', 'rec': 'recovered', 'pris': 'prismatic', 'Flk': 'flake', 'md': 'muddy', 'clas': 'clastic', 'Perm': 'permeability', 'sd': 'sand (1/16-2 mm)', 'purp': 'purple', 'CN': 'compensated neutron', 'rsns': 'resinous', 'cntr': 'centered', 'Fvst': 'favosites*', 'intcl': 'intraclasts', 'cncn': 'concentric', 'fld': 'feldsparthic', 'hem': 'hematitic', 'Anthr': 'anthracite', 'xl': 'crystalline', 'lchd': 'leached', 'sbang': 'subangular', 'biot': 'biotite', 'mnr': 'minor', 'hornbd': 'hornblend', 'mag': 'magnetic', 'intgwn': 'intergrown', 'Bioh': 'bioherm', 'TSTM': 'too small to measure', 'sptd': 'spottedy', 'gsy': 'grasy', 'Strom': 'stromatoporoid', 'mrl': 'marly', 'Tril': 'trilobite', 'stromlt': 'stromatolite', 'cche': 'caliche', 'est': 'estimated', 'intpt': 'interpretation', 'Rhb': 'rhomb', 'cotg': 'coateding', 'Moll': 'mollusc', 'varic': 'varicolored', 'ctd': 'coated', 'ovgth': 'overgrowth', 'Frg': 'fringe', 'f': 'finely', 'Intst': 'intersticies', 'Spfool': 'superficial olite', 'Pel': 'pellet', 'Orbit': 'Orbitolina', 'ind': 'indurated', 'Diagn': 'diagenesis', 'contam': 'contaminated', 'cons': 'considerable', 'Dist': 'distillate', 'n': 'no, none, non', 'xlam': 'cross-laminated', 'Gyp': 'gypsumiferous', 'glas': 'glassy', 'MLL': 'microlaterolog', 'sltst': 'siltstone', 'sml': 'small', 'fri': 'friable', 'volat': 'volatile', 'Schm': 'schist', 'trnsp': 'transparent', 'Mid': 'middle', 'brak': 'brackish', 'Lstr': 'lustre', 'org': 'organic', 'SGCW': 'slight gas cut water', 'Girv': 'girvanella*', 'trip': 'tripolic', 'amm': 'ammonite', 'up': 'upper', 'uncons.': 'unconsolidated', 'cpct': 'compact', 'o': 'oil', 'OC': 'oil cut', 'lstr': 'lustre', 'Stylio': 'styliolina*', 'mrlst': 'marlstone', 'Glas': 'glass', 'O str': 'Ostracod', 'Ft': 'foot', 'brit': 'brittle', 'Agg': 'aggregate', 'Mat': 'material', 'rd': 'rounded', 'elg': 'elongate', 'alg': 'algal', 'tub': 'tubular', 'metaph': 'metamorphosed', 'magn': 'magnetic', 'dtrl': 'detritalus', 'S.W.C.': 'sidewall core', 'aprox': 'approximately', 'imbd': 'imbedded', 'deb': 'debris', 'pyr': 'pyritized', 'wtr cush': 'water cushion', 'Clvg': 'cleavage', 'Fluor': 'fluoresceince', 'n.s.': 'no sample', 'plas': 'plastic', 'E': 'east', 'Pt': 'part', 'hor': 'horizontal', 'venn': 'vermillon', 'sp': 'spotty', 'sim': 'similar', 'brn': 'brown', 'PH': 'per hour', 'FAB': 'fair air blow', 'DF': 'derrick floor', 'orng': 'orange', 'piso': 'pisolitic', 'Mtrx': 'matrix', 'eqnt': 'equant', 'app': 'appear', 'coq': 'coquina', 'psi': 'pounds per square inch', 'lig': 'lignitic', 'aph': 'aphanitic', 'su': 'sulphurous', 'HO': 'heavy oil', 'peld': 'pelletoidal', 'ps': 'pseudo-', 'sphal': 'sphalerite', 'Stn': 'stain', 'ireg': 'irregular', 'Zr': 'zircon', 'hkl': 'hackly', 'ferr': 'ferruginous', 'irr': 'irregular', 'trnsl': 'translucent', 'SP': 'spontaneous potential', 'fau': 'fauna', 'grad': 'grading', 'tab': 'tabular', 'r.f.p': 'rounded frosted pitted', 'yel': 'yellow', 'Brk': 'break', 'flt': 'faulted', 'Intr': 'intrusive', 'ea': 'earthy', 'Frac': 'fracture', 'BW': 'barrels of water', 'exp': 'exposed', 'Stromlt': 'stromatolite', 'Phlog': 'phloaopite', 'dolst': 'dolostone', 'rexlzd': 'recrystallized', 'Zn': 'zone', 'cb': 'carbonized', 'MCW': 'mud cut water', 'Vad': 'vadose', 'IP': 'initial production', 'lith': 'lithographic', 'intbd': 'interbedded', 'grnl': 'granule (2-4 mm)', 'GTS': 'gas to surface', 'var': 'variable', 'Glob': 'globigerina*', 'sel': 'selenite', 'm': 'medium', 'glos': 'glossy', 'thn': 'thin', 'Microfos': 'microfossilferous', 'fib': 'fibrous', 'clr': 'clear', 'spec': 'speckled', 'ahd': 'anhedral', 'Bdst': 'boundstone', 'ox': 'oxidized', 'Coq': 'coquina', 'Cbl': 'cobble', 'Oyst': 'oyster', 'drlg': 'drilling', 'Cl': 'clay', 'bo': 'bophaceous', 'Brec': 'breccia', 'ti': 'tight', 'SIP': 'shut in pressure', 'zeo': 'zeolite', 'Fe-st': 'ironstone', 'Microspr': 'microspar', 'bas': 'basaltic', 'phr': 'phreatic', 'Chaet': 'chaetetes*', 'intxl': 'intercrystalline', 'Clcrd': 'calcirudite', 'authg': 'authigenic', '(W)': 'wildcat', 'dist': 'distillate', 'Flo': 'flora', 'Wl': 'well', 'rep': 'replacedment', 'gt': 'gritty', 'ter': 'terriginous', 'Asph': 'assemblage', 'swbd': 'swabbed', 'pap': 'papery', 'Fm': 'formation', 'amor': 'amorphous', 'Bot': 'botryoid', 'Descr': 'description', 'recem': 'recemented', 'AOF': 'absolute open flow', 'mol': 'moldic', 'Bur': 'burrow', 'mky': 'milky', 'vit': 'vitreous', 'Hal': 'halitiferous', 'bcm': 'becoming', 'sid': 'sideritic', 'Fac': 'facet', 'n.v.p.': 'no visible porosity', 'sblit': 'sublithic', 'wxy': 'waxy', 'Rad': 'radial', 'sc': 'scales', 'fr': 'fair', 'res': 'residuual', 'lit': 'lithic', 'cotd gn': 'coated grains', 'Elev': 'elevation', 'gn': 'green', 'Xl': 'crystal', 'bdd': 'bedded', 'cntrt': 'contorted', 'pch': 'patchy', 'Mbr': 'member', 'SOCM': 'slight oil cut mud', 'v': 'very', 'thru': 'throughout', 'cht': 'chert', 'bulb': 'bulbous', 'pol': 'polished', 'crbnt': 'carbonate', 'Scs': 'scarce', 'Chk': 'chalk', 'Dol': 'dolomite', 'Plt': 'plant', 'wg': 'vuggy', 'bnd': 'banded', 'depau': 'depauperate', 'DI': 'dual induction log', 'Mrl': 'marl', 'MCFG': 'thousand cubic feet of gas', 'Tex': 'texture', 'slty': 'silty', 'sa-c': 'salt castic', 'med': 'medium', 'mas': 'massive', 'devit': 'devitrified', 'struc': 'structure', 'bar': 'baritic', 'extr': 'extremely', 'N': 'Neutron', 'sb': 'sub', 'exv': 'extrusive', 'phyl': 'phyllitic', 'Cav': 'cavernous', 'ptch': 'patches', 'Clcsp': 'calcisphere', 'Clclt': 'calcilutite', 'r': 'rare', 'Stach': 'stachyodes*', 'GCM': 'gas cut mud', 'Intvl': 'interval', 'vis': 'visible', 'DLL': 'dual laterolog', 'msm': 'metasomatic', 'spsly': 'sparsly', '/': 'with', 'lmn': 'limonitic', 'Clcar': 'calcarenite', 'suc': 'sucrosic', 'gran': 'granular', 'Fspr': 'feldspar', 'lmpy': 'lumpy', 'tn': 'tan', 'dkr': 'darker', 'col': 'colored', 'Var': 'variation', 'Gns': 'gneiss', 'Strat': 'strata', 'orth': 'orthoclase', 'OTD': 'old total depth', 'microxln': 'microcrystalline', 'max': 'maximum', 'choc': 'chocolate', 'cgl': 'conglomerate', 'ex': 'excellent', 'undly': 'underlying', 'anhy': 'anhydritic', 'cly': 'clayey', 'cotd': 'coateding', 'WCM': 'water cut mud', 'sz': 'size', 'arg': 'argillaceous', 'Wtr': 'water', 'min': 'mineralized', 'fuc': 'fucoidal', 'wthrd': 'weathered', 'l': 'lower', 'SO&G': 'show of oil and gas', 'Typ': 'type', 'Shw': 'show', 'Microol': 'micro-oolite', 'ga': 'gauged', 'flk': 'flake', 'lmy': 'limy', 'LSD': 'legal subdivision', 'olv': 'olive', '₵': 'core', 'Db': 'diabase', 'fol': 'foliated', 'perf': 'perforated', 'O-Qtz': 'orthoquartzite', 'fen': 'fenestraal', 'Orth': 'orthoclase', 'sh': 'shale', 'Slick slick': 'slickenside', 'cvg': 'cavings', 'asph': 'asphaltic', 'Ivan': 'ivanovia*', 'bd': 'bed', 'dd': 'dead', 'BOPD': 'barrels of oil per day', 'kao': 'kaolin', 'crm': 'cream', 'Alg': 'algal', 'Mol': 'mollusca', 'BWPH': 'barrels of water per hour', 'bf': 'buff', 'Prod': 'production', 'Clst': 'claystone', 'Ctgs': 'cuttings', 'Bd': 'bed', 'blk': 'black', 'c': 'coarsely', 'Uc': 'underclay', 'fluor': 'fluoresceincent', 'sept': 'septate', 'ls': 'limestone', 'grnt.w': 'granite wash', 'BO': 'barrels of oil', 'Circ': 'circulate', 'MCO': 'mud cut oil', 'Lith': 'lithology', 'plty': 'platy', 'wi': 'with', 'amt': 'amount', 'Qtz': 'quartz', 'oom': 'oomoldic', 'pkish': 'pinkish', 'Col': 'color', 'Chara': 'charophytes', 'od': 'odor', 'shy': 'shaly', 'Clus': 'cluster', 'tgh': 'tough', 'abt': 'about', 'gil': 'gilsonite', 'grdg': 'grading', 'Grap': 'graptolite', 'O&G': 'oil and gas', 'lg': 'long', 'W': 'west', 'Rem': 'remains', 'Imp': 'impression', 'Bas': 'basalt', 'surf': 'surface', 'lrg': 'larger', 'apprx': 'approximate', 'Onc': 'oncolite', 'Frag': 'fragment', 'Bdeye': 'birdseye', 'decr': 'decreasing', 'mos': 'mosaic', 'Brach': 'brachiopod', 'Cgl': 'conglomerate', 'vrtb': 'vertebrate', 'intstl': 'interstitial', 'srtg': 'Sorteding', 'qtzs': 'quartzose', 'fl': 'filled', 'hetr': 'heterogeneous', 'euhd': 'euhedral', 'SAB': 'strong air blow', 'sug': 'sugary', 'volc': 'volcanics', 'deer': 'decreasing', 'stn': 'staining', 'fibr': 'fibrous', 'ss': 'sandstone', 'Oomol': 'oomold', 'intfrag': 'interfragmental', 'plag': 'plagioclase', 'PL': 'proximity log', 'hd': 'hard', 'Invtb': 'invertebrate', 'xbdg': 'cross-bedding', 'rnd': 'rounded', 'pl': 'plant', 'F.Q.G.': 'frosted quartz  grains', 'coln': 'colonial', 'bent': 'bentonitic', 'Pisol': 'pisolite', 'vn': 'vein', 'OFM': 'oil flecked mud', 'stal': 'stalactitic', 'ig': 'igneous', 'magnt': 'magnetite', 'intrapar': 'intraparticle', 'RT': 'rotary table', 'fl/': 'flowing', 'anhed': 'anhedral', 'Pbl': 'pebble', 'vrvd': 'varved', 'Sel': 'selenite', 'micr': 'micritic', 'chky': 'chalky', 'Vug': 'vug', 'OWDD': 'oil well drilled deeper', 'bl': 'bluish', 'abv': 'above', 'Cyp': 'cypridopsis*', 'V.P.S.': 'very poor sample V.P.S.'}, 'amount': ['streaks?', 'veins?', 'stringers?', 'interbed(?:s|ded)?', 'blotch(?:es)?', 'bands?', 'fragments?', 'impurit(?:y|ies)', 'minor', 'some', 'abundant', 'rare', 'flakes?', '[-\\.\\d]+%'], 'synonyms': {'Overburden': ['Drift'], 'Anhydrite': ['Gypsum'], 'Salt': ['Halite', 'Sylvite']}, 'grainsize': ['vf(?:-)?', 'f(?:-)?', 'm(?:-)?', 'c(?:-)?', 'vc', 'very fine(?: to)?', 'fine(?: to)?', 'medium(?: to)?', 'coarse(?: to)?', 'very coarse', 'v fine(?: to)?', 'med(?: to)?', 'med.(?: to)?', 'v coarse', 'grains?', 'granules?', 'pebbles?', 'cobbles?', 'boulders?'], 'splitters': [' with ', ' contain(?:s|ing) ', '\\. '], 'lithology': ['overburden', 'sandstone', 'siltstone', 'shale', 'mudstone', 'limestone', 'dolomite', 'salt', 'halite', 'anhydrite', 'gypsum', 'sylvite', 'clay', 'mud', 'silt', 'sand', 'gravel', 'boulders'], 'parts_of_speech': {'subordinate': ['amount'], 'noun': ['lithology'], 'adjective': ['colour', 'grainsize']}}
In [4]:
lexicon.synonyms
Out[4]:
{'Anhydrite': ['Gypsum'],
 'Overburden': ['Drift'],
 'Salt': ['Halite', 'Sylvite']}

Most of the lexicon works 'behind the scenes' when processing descriptions into Rock components.

In [5]:
lexicon.find_synonym('Halite')
Out[5]:
'salt'
In [6]:
s = "grysh gn ss w/ sp gy sh"
lexicon.expand_abbreviations(s)
Out[6]:
'greyish green sandstone with spotty gray shale'

Component

A set of attributes. All are optional.

In [7]:
from striplog import Component
In [8]:
print(Component.__doc__)
    Initialize with a dictionary of properties. You can use any
    properties you want e.g.:

        - lithology: a simple one-word rock type
        - colour, e.g. 'grey'
        - grainsize or range, e.g. 'vf-f'
        - modifier, e.g. 'rippled'
        - quantity, e.g. '35%', or 'stringers'
        - description, e.g. from cuttings
    

We define a new rock with a Python dict object:

In [9]:
r = {'colour': 'grey',
     'grainsize': 'vf-f',
     'lithology': 'sand'}
rock = Component(r)
rock
Out[9]:
colourgrey
grainsizevf-f
lithologysand

The Rock has a colour:

In [10]:
rock['colour']
Out[10]:
'grey'

And it has a summary, which is generated from its attributes.

In [11]:
rock.summary()
Out[11]:
'Grey, vf-f, sand'

We can format the summary if we wish:

In [12]:
rock.summary(fmt="My rock: {lithology} ({colour}, {grainsize!u})")
Out[12]:
'My rock: sand (grey, VF-F)'

The formatting supports the usual s, r, and a:

  • s: str
  • r: repr
  • a: ascii

Also some string functions:

  • u: str.upper
  • l: str.lower
  • c: str.capitalize
  • t: str.title

And some numerical ones, for arrays of numbers:

  • + or : np.sum
  • m or µ: np.mean
  • v: np.var
  • d: np.std
  • x: np.product
In [15]:
x = {'colour': ['Grey', 'Brown'],
     'bogosity': [0.45, 0.51, 0.66],
     'porosity': [0.2003, 0.1998, 0.2112, 0.2013, 0.1990],
     'grainsize': 'VF-F',
     'lithology': 'Sand',
     }

X = Component(x)

# This is not working at the moment.
#fmt  = 'The {colour[0]!u} {lithology!u} has a total of {bogosity!∑:.2f} bogons'
#fmt += 'and a mean porosity of {porosity!µ:2.0%}.'

fmt  = 'The {lithology!u} is {colour[0]!u}.'

X.summary(fmt)
Out[15]:
'The SAND is _.'
In [16]:
X.json()
Out[16]:
'{"grainsize": "VF-F", "lithology": "Sand"}'

We can compare rocks with the usual == operator:

In [17]:
rock2 = Component({'grainsize': 'VF-F',
                   'colour': 'Grey',
                   'lithology': 'Sand'})
rock == rock2
Out[17]:
True
In [18]:
rock
Out[18]:
colourgrey
grainsizevf-f
lithologysand

In order to create a Component object from text, we need a lexicon to compare the text against. The lexicon describes the language we want to extract, and what it means.

In [19]:
rock3 = Component.from_text('Grey fine sandstone.', lexicon)
rock3
Out[19]:
colourgrey
grainsizefine
lithologysandstone

Components support double-star-unpacking:

In [20]:
"My rock: {lithology} ({colour}, {grainsize})".format(**rock3)
Out[20]:
'My rock: sandstone (grey, fine)'

Position

Positions define points in the earth, like a top, but with uncertainty. You can define:

  • upper — the highest possible location
  • middle — the most likely location
  • lower — the lowest possible location
  • units — the units of measurement
  • x and y — the x and y location (these don't have uncertainty, sorry)
  • meta — a Python dictionary containing anything you want

Positions don't have a 'way up'.

In [21]:
from striplog import Position
print(Position.__doc__)
    Used to represent a position: a top or base.

    Not sure whether to go with upper-middle-lower or z_max, z_mid, z_min.
    Sticking to upper and lower, because ordering in Intervals is already
    based on 'above' and 'below'.
    
In [22]:
params = {'upper': 95,
          'middle': 100,
          'lower': 110,
          'meta': {'kind': 'erosive', 'source': 'DOE'}
          }

p = Position(**params)
p
Out[22]:
upper95.0
middle100.0
lower110.0

Even if you don't give a middle, you can always get z: the central, most likely position:

In [23]:
params = {'upper': 75, 'lower': 85}
p = Position(**params)
p
Out[23]:
upper75.0
middle
lower85.0
In [24]:
p.z
Out[24]:
80.0

Interval

Intervals are where it gets interesting. An interval can have:

  • a top
  • a base
  • a description (in natural language)
  • a list of Components

Intervals don't have a 'way up', it's implied by the order of top and base.

In [25]:
from striplog import Interval
print(Interval.__doc__)
    Used to represent a lithologic or stratigraphic interval, or single point,
    such as a sample location.

    Initialize with a top (and optional base) and a description and/or
    an ordered list of components.

    Args:
        top (float): Required top depth. Required.
        base (float): Base depth. Optional.
        description (str): Textual description.
        lexicon (dict): A lexicon. See documentation. Optional unless you only
            provide descriptions, because it's needed to extract components.
        max_component (int): The number of components to extract. Default 1.
        abbreviations (bool): Whether to parse for abbreviations.

    TODO:
        Seems like I should be able to instantiate like this:

            Interval({'top': 0, 'components':[Component({'age': 'Neogene'})

        I can get around it for now like this:

            Interval(**{'top': 0, 'components':[Component({'age': 'Neogene'})

        Question: should Interval itself cope with only being handed 'top' and
        either fill in down to the next or optionally create a point?
    

I might make an Interval explicitly from a Component...

In [26]:
Interval(10, 20, components=[rock])
Out[26]:
top10.0
primary
colourgrey
grainsizevf-f
lithologysand
summary10.00 m of grey, vf-f, sand
description
data
base20.0

... or I might pass a description and a lexicon and Striplog will parse the description and attempt to extract structured Component objects from it.

In [27]:
Interval(20, 40, "Grey sandstone with shale flakes.", lexicon=lexicon).__repr__()
Out[27]:
"Interval({'components': [Component({'colour': 'grey', 'lithology': 'sandstone'})], 'top': Position({'middle': 20.0, 'units': 'm'}), 'data': {}, 'description': 'Grey sandstone with shale flakes.', 'base': Position({'middle': 40.0, 'units': 'm'})})"

Notice I only got one Component, even though the description contains a subordinate lithology. This is the default behaviour, we have to ask for more components:

In [28]:
interval = Interval(20, 40, "Grey sandstone with black shale flakes.", lexicon=lexicon, max_component=2)
print(interval)
{'components': [Component({'colour': 'grey', 'lithology': 'sandstone'}), Component({'amount': 'flakes', 'colour': 'black', 'lithology': 'shale'})], 'top': Position({'middle': 20.0, 'units': 'm'}), 'data': {}, 'description': 'Grey sandstone with black shale flakes.', 'base': Position({'middle': 40.0, 'units': 'm'})}

Intervals have a primary attribute, which holds the first component, no matter how many components there are.

In [29]:
interval.primary
Out[29]:
colourgrey
lithologysandstone

Ask for the summary to see the thickness and a Rock summary of the primary component. Note that the format code only applies to the Rock part of the summary.

In [30]:
interval.summary(fmt="{colour} {lithology}")
Out[30]:
'20.00 m of grey sandstone with black shale'

We can change an interval's properties:

In [31]:
interval.top = 18
In [32]:
interval
Out[32]:
top18.0
primary
colourgrey
lithologysandstone
summary22.00 m of grey, sandstone with flakes, black, shale
descriptionGrey sandstone with black shale flakes.
data
base40.0
In [33]:
interval.top
Out[33]:
upper18.0
middle18.0
lower18.0

Comparing and combining intervals

In [34]:
# Depth ordered
i1 = Interval(top=61, base=62.5, components=[Component({'lithology': 'limestone'})])
i2 = Interval(top=62, base=63, components=[Component({'lithology': 'sandstone'})])
i3 = Interval(top=62.5, base=63.5, components=[Component({'lithology': 'siltstone'})])
i4 = Interval(top=63, base=64, components=[Component({'lithology': 'shale'})])
i5 = Interval(top=63.1, base=63.4, components=[Component({'lithology': 'dolomite'})])

# Elevation ordered
i8 = Interval(top=200, base=100, components=[Component({'lithology': 'sandstone'})])
i7 = Interval(top=150, base=50, components=[Component({'lithology': 'limestone'})])
i6 = Interval(top=100, base=0, components=[Component({'lithology': 'siltstone'})])
In [35]:
i2.order
Out[35]:
'depth'

Technical aside: The Interval class is a functools.total_ordering, so providing __eq__ and one other comparison (such as __lt__) in the class definition means that instances of the class have implicit order. So you can use sorted on a Striplog, for example.

It wasn't clear to me whether this should compare tops (say), so that '>' might mean 'above', or if it should be keyed on thickness. I chose the former, and implemented other comparisons instead.

In [36]:
print(i3 == i2)  # False, they don't have the same top
print(i1 > i4)   # True, i1 is above i4
print(min(i1, i2, i5).summary())  # 0.3 m of dolomite
False
True
0.30 m of dolomite
In [37]:
i2 > i4 > i5  # True
Out[37]:
True

We can combine intervals with the + operator. (However, you cannot subtract intervals.)

In [38]:
i2 + i3
Out[38]:
top62.0
primary
lithologysandstone
summary1.50 m of sandstone with siltstone
description50.0% 1.00 m of siltstone with 50.0% 1.00 m of sandstone
data
base63.5

Adding a rock adds a (minor) component and adds to the description.

In [39]:
interval + rock3
Out[39]:
top18.0
primary
colourgrey
lithologysandstone
summary22.00 m of grey, sandstone with flakes, black, shale with grey, fine, sandstone
descriptionGrey sandstone with black shale flakes. with Grey, fine, sandstone
data
base40.0
In [40]:
i6.relationship(i7), i5.relationship(i4)
Out[40]:
('partially', 'containedby')
In [41]:
print(i1.partially_overlaps(i2))  # True
print(i2.partially_overlaps(i3))  # True
print(i2.partially_overlaps(i4))  # False
print()
print(i6.partially_overlaps(i7))  # True
print(i7.partially_overlaps(i6))  # True
print(i6.partially_overlaps(i8))  # False
print()
print(i5.is_contained_by(i3))  # True
print(i5.is_contained_by(i4))  # True
print(i5.is_contained_by(i2))  # False
True
True
False

True
True
False

True
True
False
In [42]:
x = i4.merge(i5)
x[-1].base = 65
x
Out[42]:
Striplog(3 Intervals, start=63.0, stop=65.0)
In [43]:
i1.intersect(i2, blend=False)
Out[43]:
top62.0
primary
lithologysandstone
summary0.50 m of sandstone
description
data
base62.5
In [44]:
i1.intersect(i2)
Out[44]:
top62.0
primary
lithologylimestone
summary0.50 m of limestone with sandstone
description60.0% 1.50 m of limestone with 40.0% 1.00 m of sandstone
data
base62.5
In [45]:
i1.union(i3)
Out[45]:
top61.0
primary
lithologylimestone
summary2.50 m of limestone with siltstone
description60.0% 1.50 m of limestone with 40.0% 1.00 m of siltstone
data
base63.5
In [46]:
i3.difference(i5)
Out[46]:
(Interval({'components': [Component({'lithology': 'siltstone'})], 'top': Position({'middle': 62.5, 'units': 'm'}), 'data': {}, 'description': '', 'base': Position({'middle': 63.1, 'units': 'm'})}),
 Interval({'components': [Component({'lithology': 'siltstone'})], 'top': Position({'middle': 63.4, 'units': 'm'}), 'data': {}, 'description': '', 'base': Position({'middle': 63.5, 'units': 'm'})}))

©2015 Agile Geoscience. Licensed CC-BY. striplog.py