well
¶from striplog import Well
print(Well.__doc__)
Well contains everything about the well. It inherits from las.LASReader. For example, well will contain header fields, curves, and other data from the 'basic' LAS file. We will then read supplementary LAS files, and/or maybe CSV data, into one main other attribute of Well: the striplog. If we start using pandas dataframes, this is the place to do it. Args: f (str): The path to an LAS file. null_subs (float): Something to substitute for the declared null value, which is probably -999.25. Often it's convenient to use np.nan. unknown_as_other (bool): Whether you'd like to load unknown sections as plain text blocks. A hack to cope with LAS3 files without having to handle arbitrary sections. Note: This module is not very general. It was written to support a very specific workflow. If it seems to be useful for other things, we can come back and try to generalize it. Essentially, this entire thing needs to be replaced by Something that properly supports the LAS 3.0 format, both reading and writing.
fname = 'P-129_out.LAS'
well = Well(fname)
well.data['GR']
array([ 46.69865036, 46.69865036, 46.69865036, ..., 92.24622345, 92.24622345, 92.24622345])
well.well.DATE.data
'10-Oct-2007'
striplog
and add it to the well
¶from striplog import Striplog, Legend
legend = Legend.default()
f = 'P-129_280_1935.png'
name, start, stop = f.strip('.png').split('_')
striplog = Striplog.from_img(f, float(start), float(stop), legend=legend, tolerance=35)
%matplotlib inline
striplog.plot(legend, ladder=True, interval=(5,50), aspect=5)
well.add_striplog(striplog, "striplog")
Striplogs are added as a dictionary, but you can access them via attributes too:
well.striplog
{'striplog': Striplog(185 Intervals, start=280.0, stop=1935.0)}
well.striplog.striplog.source
'Image'
well.striplog.striplog.start
280.0
striplog
and add it¶We can also make striplog
s from cuttings data, for example. So let's read cuttings data from an Excel spreadsheet and add another striplog to the well.
import xlrd
xls = "_Cuttings.xlsx"
book = xlrd.open_workbook(xls)
sh = book.sheet_by_name("P-129")
tops = [c.value for c in sh.col_slice(0, 4)]
bases = [c.value for c in sh.col_slice(1, 4)]
descr = [c.value for c in sh.col_slice(3, 4)]
rows = [i for i in zip(tops, bases, descr)]
rows[:5]
[(280.0, 282.0, 'Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, poor porosity'), (282.0, 299.5, 'Sandstone: orange brown to white, fine lower to medium lower grained, sub angular to sub rounded, moderate to well sorted, interbeds of light grey shale and red brown siltstone, poor to fair porosity, Sneider 1D'), (299.5, 315.0, 'Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, poor porosity, local lenses and stringers of sandstone, as above'), (315.0, 328.0, 'Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, poor porosity, local lenses and stringers of sandstone, as above'), (328.0, 340.0, 'Siltstone: as above with inter beds of light grey limestone, mudstone, microcrystalline, silty locally, tight')]
from striplog import Lexicon
lexicon = Lexicon.default()
cuttings = Striplog.from_array(rows, lexicon)
cuttings
Striplog(155 Intervals, start=280.0, stop=1935.0)
cuttings.plot(interval=(5,50), aspect=5)
print(cuttings[:5])
top: 280.0, base: 282.0, description: 'Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, poor porosity', components: [Component("colour":"red", "lithology":"siltstone", "grainsize":"very fine")] top: 282.0, base: 299.5, description: 'Sandstone: orange brown to white, fine lower to medium lower grained, sub angular to sub rounded, moderate to well sorted, interbeds of light grey shale and red brown siltstone, poor to fair porosity, Sneider 1D', components: [Component("colour":"brown", "amount":"interbeds", "lithology":"sandstone", "grainsize":"fine")] top: 299.5, base: 315.0, description: 'Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, poor porosity, local lenses and stringers of sandstone, as above', components: [Component("colour":"red", "amount":"stringers", "lithology":"siltstone", "grainsize":"very fine")] top: 315.0, base: 328.0, description: 'Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, poor porosity, local lenses and stringers of sandstone, as above', components: [Component("colour":"red", "amount":"stringers", "lithology":"siltstone", "grainsize":"very fine")] top: 328.0, base: 340.0, description: 'Siltstone: as above with inter beds of light grey limestone, mudstone, microcrystalline, silty locally, tight', components: [Component("lithology":"siltstone")]
well.add_striplog(cuttings, "cuttings")
well.striplog.cuttings[3:5]
Striplog(2 Intervals, start=315.0, stop=340.0)
print(well.striplogs_to_las3(use_descriptions=True))
~Version VERS . 3.0 :CWLS LOG ASCII STANDARD - VERSION 3.0 WRAP . NO :ONE LINE PER DEPTH STEP DLM . COMMA :DELIMITING CHARACTER PROG . striplog.py :LAS Program name and version CREA . 2015/07/09 16:29 :LAS Creation date {YYYY/MM/DD hh:mm} ~Well #MNEM .UNIT DATA DESCRIPTION #---- ------ -------------- ----------------------------- STRT .M 1.067 :START DEPTH STOP .M 1939.138 :STOP DEPTH STEP .M -999.2500 :STEP NULL . -999.2500 :NULL VALUE WELL . Kennetcook #2 :WELL FLD . UNDEFINED :FIELD CTRY . CA :COUNTRY PROV . NOVA SCOTIA :PROVINCE UWI . Long = 63* 45'24.460 W :UNIQUE WELL ID LIC . P-129 :LICENSE NUMBER ~Parameter #MNEM .UNIT VALUE DESCRIPTION #---- ------ -------------- ----------------------------- #Required parameters RUN . ONE :RUN NUMBER PDAT . GL :PERMANENT DATUM APD .M 4.500 :ABOVE PERM DATUM DREF . KB :DEPTH REFERENCE EREF .M 94.800 :ELEVATION OF DEPTH #Remarks R1 . :REMARK LINE 1 R2 . :REMARK LINE 2 R3 . :REMARK LINE 3 ~Cuttings_Parameter CUTT . : Cuttings source {S} CUTTD. MD : Cuttings depth reference {S} ~Cuttings_Definition CUTTT.M : Cuttings top depth {F} CUTTB.M : Cuttings base depth {F} CUTTD. : Cuttings description {S} ~Cuttings_Data | Cuttings_Definition 280.000, 282.000, "Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, poor porosity" 282.000, 299.500, "Sandstone: orange brown to white, fine lower to medium lower grained, sub angular to sub rounded, moderate to well sorted, interbeds of light grey shale and red brown siltstone, poor to fair porosity, Sneider 1D" 299.500, 315.000, "Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, poor porosity, local lenses and stringers of sandstone, as above" 315.000, 328.000, "Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, poor porosity, local lenses and stringers of sandstone, as above" 328.000, 340.000, "Siltstone: as above with inter beds of light grey limestone, mudstone, microcrystalline, silty locally, tight" 340.000, 360.000, "Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, poor porosity, local lenses and stringers of limestone" 360.000, 373.000, "Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, poor porosity" 373.000, 381.000, "Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, poor porosity, local lenses and stringers of sandstone" 381.000, 400.000, "Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, poor porosity" 400.000, 412.000, "Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout" 412.000, 416.000, "Shale: light grey, blocky, silty, locally calcareous" 416.000, 420.000, "Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout" 420.000, 427.500, "Shale: light grey, blocky, silty, locally calcareous" 427.500, 439.500, "Anhydrite: snow white, dense, poor sample quality" 439.500, 454.000, "Anhydrite: snow white, dense, poor sample quality, stringers and interbeds of limestone, grey, microcrystalline, as above" 454.000, 458.000, "Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout" 458.000, 475.000, "Siltstone: red brown, grading to a very fine lower sandstone, interbeds of grey shale, locally slightly calcareous, minor thin limestone stringers, light to moderate grey, mudstone" 475.000, 495.000, "Siltstone: red brown, grading to a very fine lower sandstone, stringers of grey shale, light to moderate grey" 495.000, 507.000, "Siltstone: red brown, grading to a very fine lower sandstone, stringers of grey shale, light to moderate grey" 507.000, 510.000, "Shale: light to moderate grey, blocky" 510.000, 514.500, "Siltstone: as above" 514.500, 517.500, "Shale: as above" 517.500, 520.000, "Siltstone: as above" 520.000, 525.000, "Sandstone: light grey white to grey white, very fine lower to fine lower, sub angular, very well sorted, very slightly calcareous, siltstone and grey silty shale stringers, hard, dense" 525.000, 532.000, "Anhydrite: snow white, dense, stringers of limestone, grey, microcrystalline, as above" 532.000, 545.500, "Limestone: dark grey, mudstone, very well cemented, grading to grainstone near the base of the unit" 545.500, 565.000, "Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, local stringers of grey shale" 565.000, 585.500, "Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, local stringers of grey shale" 585.500, 588.000, "Interbedded Siltstone and Limestone: Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, Limestone is dark grey, mudstone, very well cemented" 588.000, 615.000, "Siltstone: red to red brown, grading to very fine lower sandstone, sandy throughout, local stringers of grey shale" 615.000, 620.000, "Anhydrite: snow white, dense, stringers of limestone, grey, microcrystalline, as above" 620.000, 645.000, "Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, local stringers of grey shale" 645.000, 655.000, "Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, local stringers of grey shale and anhydrite" 655.000, 675.000, "Siltstone: red to red brown, grading to very fine lower sandstone, very slightly calcareous, sandy throughout, local anhydrite" 675.000, 680.000, "Interbedded Siltstone and Shale: Siltstone is as above, Shale is moderate to dark grey, blocky, slightly calcareous" 680.000, 685.000, "Sandstone: white to clear, poorly consolidated, kaolinite, fine lower to fine upper, sub rounded, moderately well sorted, 6 to 9 % porosity, Sneider 1D to 1C" 685.000, 701.500, "Gypsum: clear to white, selinite crystals, stringers to interbeds of red siltstone to grey shale, and sandstone" 701.500, 702.500, "Anhydrite: Anhydrite: sandy lenses, common selenite crystals" 702.500, 703.500, "Sandstone: white to clear, loosely consolidated, kaolinite, fine lower to fine upper, sub rounded, moderately well sorted, 6 % porosity, Sneider 1C" 703.500, 710.000, "Anhydrite: white to light grey white, massive, minor thin limestone stringers and grey shale stringers, as above" 710.000, 725.000, "Anhydrite: white to light grey white, massive, minor thin limestone stringers and grey shale stringers, as above" 725.000, 750.000, "Anhydrite: white to light grey white, massive, minor thin limestone stringers and grey shale stringers, as above" 750.000, 765.000, "Anhydrite: white to light grey white, massive, minor thin limestone stringers and grey shale stringers, as above" 765.000, 785.000, "Anhydrite: white to light grey white, massive, minor thin limestone stringers and grey shale stringers, as above" 785.000, 807.000, "Anhydrite: white to light grey white, massive, minor thin limestone stringers and grey shale stringers, as above" 807.000, 809.500, "Limestone: Limestone: moderate to dark grey, mudstone, microcrystalline, dense, very hard, tight" 809.500, 826.000, "Interbedded Sandstone, Siltstone and Shale: predominantly brick red siltstone and some light grey calcareous siltstone, micro micaceous, minor white to clear sandstone stringers, fine lower, well sorted, sub rounded, kaolinitic, siliceous, 6 to 9 % porosity, Sneider 1B to 2, trace grey shale" 826.000, 842.000, "Siltstone: brick red siltstone, micro micaceous, minor white to clear sandstone stringers, as above" 842.000, 855.000, "Interbedded Sandstone, Siltstone and Shale: predominantly brick red siltstone, micro micaceous, minor white to clear sandstone stringers, fine lower, well sorted, sub angular, siliceous, 6 to 9 % porosity, Sneider 2, minor conglomeratic sandstone" 855.000, 860.000, "Sandstone: moderate grey, majority of the sample is disaggregated grains, very poorly consolidated, fine lower to fine upper, sub rounded, moderately well sorted, 6 to 9 % porosity, Sneider 1D" 860.000, 878.000, "Siltstone: brick red siltstone, micro micaceous, minor white to clear sandstone stringers, to conglomeratic stringers, siltstone grades to very fine grained sandstone" 878.000, 882.000, "Sandstone: moderate grey, poorly consolidated, fine lower to fine upper, sub rounded, moderately well sorted, 6 % porosity, Sneider 1D" 882.000, 890.000, "Siltstone: brick red siltstone, micro micaceous, minor white to clear sandstone stringers, to conglomeratic stringers, siltstone grades to very fine grained sandstone" 890.000, 890.500, "Sandstone: as above" 890.500, 910.000, "Siltstone: brick red siltstone, micro micaceous, minor white to clear sandstone stringers, to conglomeratic stringers, siltstone grades to very fine grained sandstone" 910.000, 925.000, "Sandstone: white to light grey white and clear, loosely consolidated, kaolinite, fine lower to fine upper, sub rounded, moderately well sorted, 6 % porosity, Sneider 1D, interbeds to stringers of clear fine grained sub rounded well sorted quartz arenite, slightly calcareous, and stringers of greenish grey shale" 925.000, 943.000, "Sandstone: white to light grey white and clear, loosely consolidated, kaolinite, fine lower to fine upper, sub rounded, moderately well sorted, 6 % porosity, Sneider 1D, interbeds to stringers of clear fine grained sub rounded well sorted quartz arenite, slightly calcareous, and stringers of conglomeratic sandstone" 943.000, 947.500, "Shale: light greenish grey and reddish brown, sub fissile, waxy, with stringers of sandstone as above" 947.500, 956.500, "Sandstone: white to light grey white and clear, loosely consolidated, fine lower to fine upper, sub rounded, moderately well sorted, 6 % porosity,1D, interbeds to stringers of clear fine grained sub rounded well sorted quartz, and stringers of conglomeratic sandstone, local shale interbeds" 956.500, 963.500, "Interbedded Grey and Red Shale: grey is light greenish grey, sub fissile, waxy, with stringers of sandstone as above, red is brick red, blocky, and silty throughout" 963.500, 970.000, "Siltstone: Brick red to brown red, micromicaceous, silty throughout, blocky, slightly waxy, grading to silty shale" 970.000, 985.000, "Siltstone: Brick red to brown red, micromicaceous, silty throughout, blocky, slightly waxy, with interbeds and stringers of grey shale and sandstone as above" 985.000, 1000.000, "Siltstone: Brick red to brown red, micromicaceous, silty throughout, blocky, slightly waxy, with interbeds and stringers of grey shale and sandstone as above" 1000.000, 1014.500, "Siltstone: Brick red to brown red, micromicaceous, silty throughout, blocky, slightly waxy, with interbeds and stringers of grey shale and sandstone as above" 1014.500, 1020.000, "Sandstone: white to light grey white and clear, loosely consolidated, kaolinite, fine lower to fine upper, sub rounded, moderately well sorted, 6 % porosity, Sneider 1D, interbeds to stringers of clear fine grained sub rounded well sorted quartz arenite, slightly calcareous, and stringers siltstone as above" 1020.000, 1028.000, "Interbedded Siltstone and Shale: as above, with local sandstone stringers" 1028.000, 1034.000, "Siltstone: Brick red to brown red, micromicaceous, silty throughout, blocky, slightly waxy, with interbeds and stringers of very fine grained sandstone, kaolinitic, calcareous, with thin lenses of conglomeratic sandstone" 1034.000, 1042.000, "Siltstone: as above, interbedded with grey shale, silty" 1042.000, 1050.000, "Shale: grey to white grey, silty throughout, blocky to sub fissile, grading regularly to very fine grained sandstone" 1050.000, 1060.000, "Shale: grey to white grey, silty throughout, blocky to sub fissile, grading regularly to very fine grained sandstone, interbedded with siltstone as above" 1060.000, 1080.000, "Interbedded Siltstone and Shale: grey to white grey, silty throughout, blocky to sub fissile, grading regularly to very fine grained sandstone, interbedded with siltstone, brick red to brown red, micromicaceous, silty throughout, blocky" 1080.000, 1091.500, "Interbedded Siltstone and Shale: grey to white grey, silty throughout, blocky to sub fissile, grading regularly to very fine grained sandstone, interbedded with siltstone, brick red to brown red, micromicaceous, silty throughout, blocky" 1091.500, 1097.500, "Shale: grey to white grey, silty throughout, blocky to sub fissile, grading regularly to very fine grained sandstone" 1097.500, 1110.500, "Interbedded Siltstone and Shale: grey to white grey, silty throughout, blocky to sub fissile, grading regularly to very fine grained sandstone, interbedded with siltstone, brick red to brown red, micromicaceous, silty throughout, blocky" 1110.500, 1115.000, "Interbedded Siltstone and Shale: grey to white grey, silty throughout, blocky to sub fissile, grading regularly to very fine grained sandstone, interbedded with siltstone, brick red to brown red, micromicaceous, silty throughout, blocky" 1115.000, 1125.000, "Shale: grey to white grey, silty throughout, blocky to sub fissile, grading regularly to very fine grained sandstone" 1125.000, 1145.000, "Shale: grey to white grey, silty throughout, blocky to sub fissile, grading regularly to very fine grained sandstone" 1145.000, 1160.000, "Shale: grey to white grey, silty throughout, blocky to sub fissile, grading regularly to very fine grained sandstone" 1160.000, 1165.000, "Sandstone: white to clear, quartz arenite, very loosely consolidated, trace kaolinite, fine lower to fine upper, sub rounded, moderately well sorted, 6 %porosity, Sneider 1C" 1165.000, 1188.000, "Sandstone: white to clear, quartz arenite, very loosely consolidated, trace kaolinite, fine lower to fine upper, sub rounded, moderately well sorted, 6 %porosity, Sneider 2, with interbeds locally of grey shale" 1188.000, 1204.000, "Sandstone: white to clear, quartz arenite, very loosely consolidated, trace kaolinite, fine lower to fine upper with some medium upper, sub rounded, moderately sorted, 6 %porosity, Sneider 2, with interbeds locally of grey shale, and stringers to interbeds of dark grey to black fissile shale, carbonaceous" 1204.000, 1215.000, "Sandstone: white to clear, quartz arenite, very loosely consolidated, trace kaolinite, fine lower to fine upper and medium, sub angular, moderately well sorted, 6 %porosity, Sneider 2, with interbeds locally of grey shale, and stringers to interbeds of dark grey to black fissile shale, carbonaceous" 1215.000, 1234.500, "Sandstone: white to clear, quartz arenite, very loosely consolidated, kaolinite, fine lower to fine upper to medium upper, sub angular, moderately well sorted, 6 %porosity, Sneider 2, with interbeds locally of grey shale, and stringers to interbeds of dark grey to black fissile shale, carbonaceous" 1234.500, 1240.000, "Shale: moderate grey to black grey, sub fissile to fissile, silty" 1240.000, 1246.500, "Sandstone: white to clear, quartz arenite, very loosely consolidated, kaolinite, fine lower to fine upper to medium upper, sub angular, moderately well sorted, 6 %porosity, Sneider 2" 1246.500, 1253.000, "Shale: moderate grey to black grey, sub fissile to fissile, silty, with carbonaceous shale" 1253.000, 1279.500, "Sandstone: white to clear, quartz arenite, very loosely consolidated, kaolinite, fine lower to fine upper to medium upper, sub angular, moderately well sorted, 6 %porosity, Sneider 2, with interbeds locally of grey shale, and stringers to interbeds of dark grey to black fissile shale, carbonaceous" 1279.500, 1291.000, "Shale: moderate grey to black grey, sub fissile to fissile, silty, with interbeds of carbonaceous shale" 1291.000, 1294.000, "Sandstone: as above" 1294.000, 1305.000, "Shale: moderate grey to black grey, sub fissile to fissile, silty, with interbeds of carbonaceous shale" 1305.000, 1316.000, "Shale: moderate grey to black grey, sub fissile to fissile, silty, with interbeds of carbonaceous shale" 1316.000, 1333.000, "Sandstone: white, kaolinitic, fine lower to fine upper to medium upper, sub angular, moderately well sorted, 6 % porosity, Sneider 2, with interbeds locally of grey shale, and stringers to interbeds of dark grey to black fissile shale, carbonaceous" 1333.000, 1340.000, "Shale: moderate grey to black grey, sub fissile to fissile, silty, with interbeds of carbonaceous shale" 1340.000, 1349.000, "Sandstone: white, kaolinitic, fine lower to fine upper to medium upper, sub angular, moderately well sorted, 6 % porosity, Sneider 2, with interbeds locally of grey shale, and stringers to interbeds of dark grey to black fissile shale, carbonaceous" 1349.000, 1353.500, "Shale: as above" 1353.500, 1370.500, "Sandstone: white, kaolinitic, fine lower to fine upper to medium upper, sub angular, moderately well sorted, 6 % porosity, Sneider 2, with interbeds locally of grey shale, and stringers to interbeds of dark grey to black fissile shale, carbonaceous" 1370.500, 1374.000, "Shale: moderate grey to black grey, sub fissile to fissile, silty, with interbeds of carbonaceous shale" 1374.000, 1380.000, "Sandstone: white, kaolinitic, fine lower to fine upper to medium upper, sub angular, moderately well sorted, 6 % porosity, Sneider 2, with interbeds locally of grey shale, and stringers to interbeds of dark grey to black fissile shale, carbonaceous" 1380.000, 1384.000, "Shale: as above" 1384.000, 1395.000, "Sandstone: white, kaolinitic, fine lower to fine upper to medium upper, sub angular, moderately well sorted, 6 % porosity, Sneider 2, with interbeds locally of grey shale, and stringers to interbeds of dark grey to black fissile shale, carbonaceous" 1395.000, 1410.000, "Sandstone: white, kaolinitic, fine lower to fine upper to medium upper, sub angular, moderately well sorted, 6 % porosity, Sneider 2, with interbeds locally of grey shale, and stringers to interbeds of dark grey to black fissile shale, carbonaceous" 1410.000, 1440.000, "Sandstone: white, kaolinitic, fine lower to fine upper, sub angular, moderately well sorted, 6 % porosity, Sneider 2, with interbeds locally of grey shale, and stringers to interbeds of dark grey to black fissile shale, carbonaceous" 1440.000, 1450.000, "Shale: black, carbonaceous, locally silty, fissile to very fissile, with stringers of sandstone as above" 1450.000, 1465.000, "Interbedded Sandstone and Shale: sandstone is white, kaolinitic, fine lower to fine upper, sub angular, moderately well sorted, 6 % porosity, Sneider 2, with interbeds locally of grey shale, and stringers to interbeds of dark grey to black fissile shale, carbonaceous" 1465.000, 1483.500, "Interbedded Sandstone and Shale: sandstone is white, kaolinitic, fine lower to fine upper, sub angular, moderately well sorted, 6 % porosity, Sneider 2, with interbeds locally of grey shale, and stringers to interbeds of dark grey to black fissile shale, carbonaceous, degassing" 1483.500, 1486.500, "Sandstone: sandstone is quartz arenite, white, kaolinitic, fine lower to fine upper, sub angular, well sorted, 6 % porosity, Sneider 2 to 1D, sandstone is bubbling slightly" 1486.500, 1488.000, "Varved sandstone and black shale as above, local degassing" 1488.000, 1488.500, "Shale: black carbonaceous" 1488.500, 1490.500, "Sandstone: as above" 1490.500, 1492.000, "Mixed Sandstone and Dark shale:" 1492.000, 1494.000, "Shale: black, carbonaceous, locally silty, fissile to very fissile, local degassing signs" 1494.000, 1495.500, "Mixed Shale and Sandstone: quartz arenite, white, kaolinitic, fine lower to medium upper, sub angular, well sorted, 6 % porosity, Sneider 2 to 1D, sandstone is bubbling slightly" 1495.500, 1503.000, "Sandstone with thin wisps’ of dark black shale, the shale is degassing" 1503.000, 1504.000, "Varved Shale and Sandstone: as above" 1504.000, 1512.500, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium upper, sub angular, well sorted, 6 % porosity, Sneider 2 to 1D, with local stringers to interbeds of black carbonaceous shale" 1512.500, 1518.000, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium upper, sub angular, well sorted, 3 % porosity, Sneider 2 to 1D, with local stringers to interbeds of black carbonaceous shale" 1518.000, 1540.000, "Sandstone: quartz arenite, white, kaolinitic, fine lower to coarse grained, sub angular, well sorted, 3 % porosity, Sneider 2 to 1D, with local stringers to interbeds of black carbonaceous shale" 1540.000, 1542.000, "Shale: black, carbonaceous, locally silty, fissile to very fissile, local degassing signs" 1542.000, 1553.000, "Sandstone: quartz arenite, white, kaolinitic, fine lower to coarse grained, sub angular, well sorted, 3 % porosity, Sneider 2 to 1D" 1553.000, 1554.000, "Shale: black, carbonaceous, plant fragments, bordering on coal, degassing bubbles" 1554.000, 1556.500, "Sandstone: as above" 1556.500, 1558.500, "Varved Sandstone and Shale grading to Shale: black, carbonaceous, plant fragments, bordering on coal, degassing bubbles, bioturbated, burrowed" 1558.500, 1561.000, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, well sorted, 3 % porosity, Sneider 2 to 1D, with local stringers to interbeds of black carbonaceous shale" 1561.000, 1571.000, "Sandstone: as above with interbeds of carbonaceous shale and varved sandstone and shale" 1571.000, 1579.500, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, well sorted, 1 to 3 % porosity, Sneider 2, with local stringers of black carbonaceous shale" 1579.500, 1587.000, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, well sorted, 1 to 3 % porosity, Sneider 2, with local stringers of black carbonaceous shale" 1587.000, 1594.500, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, well sorted, 1 to 3 % porosity, Sneider 2, with local stringers of black carbonaceous shale" 1594.500, 1610.000, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, well sorted, 1 to 3 % porosity, Sneider 2, with local stringers of black carbonaceous shale" 1610.000, 1625.000, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, well sorted, 1 to 3 % porosity, Sneider 2, with local stringers of black carbonaceous shale" 1625.000, 1635.000, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, well sorted, 1 to 3 % porosity, Sneider 2, with local stringers of black carbonaceous shale" 1635.000, 1648.000, "Interbedded Sandstone and Shale: sandstone is white, kaolinitic, fine lower to medium upper, sub angular, moderately well sorted, 3 % porosity, Sneider 2, with interbeds locally of grey shale" 1648.000, 1665.500, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, well sorted, 1 to 3 % porosity, Sneider 2, with local stringers of black carbonaceous shale" 1665.500, 1667.000, "Varved Sandstone and Shale grading to Shale: black" 1667.000, 1680.000, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, well sorted, 1 to 3 % porosity, Sneider 2, with local stringers of black carbonaceous shale" 1680.000, 1695.000, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, well sorted, 1 to 3 % porosity, Sneider 2, with local stringers of black carbonaceous shale" 1695.000, 1702.500, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, well sorted, 1 to 3 % porosity, Sneider 2, with local stringers of black carbonaceous shale" 1702.500, 1715.000, "Sandstone as above interbedded with and varved with silty carbonaceous shale" 1715.000, 1725.000, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, well sorted, 1 to 3 % porosity, Sneider 2, with interbeds of black carbonaceous shale and varved shale and sandstone" 1725.000, 1740.000, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, well sorted, 1 to 3 % porosity, Sneider 2, with interbeds of black carbonaceous shale and varved shale and sandstone" 1740.000, 1756.500, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, well sorted, 1 to 3 % porosity, Sneider 2, with interbeds of black carbonaceous shale and varved shale and sandstone" 1756.500, 1770.500, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, well sorted, 1 to 3 % porosity, Sneider 2, with interbeds of black carbonaceous shale and grey silty shale and sandstone" 1770.500, 1790.000, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, well sorted, 1 to 3 % porosity, Sneider 2, with stringers to interbeds of black carbonaceous and grey silty shale" 1790.000, 1800.000, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, moderately sorted, 1 to 3 % porosity, Sneider 2, with stringers to interbeds of black carbonaceous and grey silty shale" 1800.000, 1815.000, "Sandstone: quartz arenite, white, kaolinitic, fine lower to medium grained, sub angular, moderately sorted, 1 to 3 % porosity, Sneider 2, with stringers to interbeds of black carbonaceous and grey silty shale" 1815.000, 1830.000, "Sandstone: quartz arenite, white and clear, kaolinitic, fine lower to coarse grained, sub angular, moderately sorted, 1 to 2 % porosity, Sneider 2, with stringers grey silty shale" 1830.000, 1845.000, "Sandstone: quartz arenite, white and clear, kaolinitic, fine lower to coarse grained, sub angular, moderately sorted, 1 to 2 % porosity, Sneider 2, with stringers grey silty shale" 1845.000, 1860.500, "Sandstone: quartz arenite, white and clear, kaolinitic, fine lower to coarse grained, sub angular, moderately sorted, 1 to 2 % porosity, Sneider 2, with stringers grey silty shale" 1860.500, 1882.500, "Sandstone: quartz arenite, white and clear, kaolinitic, fine lower to coarse grained, sub angular, moderately sorted, 1 to 2 % porosity, Sneider 2, with stringers grey silty shale" 1882.500, 1883.500, "Shale: dark grey, silty, blocky, with stringers of carbonaceous shale and thin laminated coal stringers, coal shows degassing signs on coarse undried cuttings" 1883.500, 1888.000, "Sandstone: as above" 1888.000, 1889.500, "Shale: dark grey, silty, blocky, with stringers of carbonaceous shale and thin laminated coal stringers" 1889.500, 1901.500, "Sandstone: as above" 1901.500, 1905.500, "Shale: interbedded grey silty shale and black carbonaceous shale, coal laminae, undried samples show degassing signs" 1905.500, 1911.500, "Sandstone: quartz arenite, white and clear, kaolinitic, fine lower to coarse grained, sub angular, moderately sorted, 1 to 2 % porosity, Sneider 2, with stringers grey silty shale" 1911.500, 1935.000, "Quartzite: light greenish cream, schistose texture, minor pyrite crystals" ~Striplog_Parameter STRP . Image : Striplog source {S} STRPD. MD : Striplog depth reference {S} ~Striplog_Definition STRPT.M : Striplog top depth {F} STRPB.M : Striplog base depth {F} STRPD. : Striplog description {S} ~Striplog_Data | Striplog_Definition 280.000, 299.986, "Red, siltstone" 299.986, 304.008, "Grey, sandstone, vf-f" 304.008, 328.016, "Red, siltstone" 328.016, 328.990, "Limestone" 328.990, 330.007, "Red, siltstone" 330.007, 333.987, "Limestone" 333.987, 338.983, "Red, siltstone" 338.983, 340.931, "Limestone" 340.931, 345.927, "Red, siltstone" 345.927, 346.944, "Limestone" 346.944, 414.946, "Red, siltstone" 414.946, 416.936, "Grey, mudstone" 416.936, 422.440, "Red, heterolithic" 422.440, 423.414, "Grey, mudstone" 423.414, 426.929, "Red, heterolithic" 426.929, 427.902, "Grey, mudstone" 427.902, 449.921, "Anhydrite" 449.921, 452.927, "Limestone" 452.927, 528.974, "Red, heterolithic" 528.974, 532.446, "Anhydrite" 532.446, 537.485, "Red, heterolithic" 537.485, 539.983, "Limestone" 539.983, 586.009, "Red, heterolithic" 586.009, 589.016, "Limestone" 589.016, 591.006, "Red, siltstone" 591.006, 592.996, "Limestone" 592.996, 594.012, "Red, siltstone" 594.012, 594.986, "Limestone" 594.986, 615.014, "Red, siltstone" 615.014, 621.492, "Anhydrite" 621.492, 639.996, "Red, siltstone" 639.996, 642.960, "Anhydrite" 642.960, 645.966, "Red, siltstone" 645.966, 649.989, "Anhydrite" 649.989, 652.487, "Red, siltstone" 652.487, 656.002, "Anhydrite" 656.002, 669.975, "Red, heterolithic" 669.975, 674.971, "Grey, sandstone, vf-f" 674.971, 703.468, "Anhydrite" 703.468, 703.976, "Grey, sandstone, vf-f" 703.976, 705.966, "Anhydrite" 705.966, 707.448, "Grey, sandstone, vf-f" 707.448, 714.477, "Anhydrite" 714.477, 715.451, "Limestone" 715.451, 719.473, "Anhydrite" 719.473, 724.470, "Limestone" 724.470, 734.462, "Anhydrite" 734.462, 735.436, "Limestone" 735.436, 761.900, "Anhydrite" 761.900, 764.907, "Limestone" 764.907, 778.922, "Anhydrite" 778.922, 779.938, "Limestone" 779.938, 805.937, "Anhydrite" 805.937, 809.959, "Limestone" 809.959, 827.955, "Red, sandstone, vf-f" 827.955, 829.945, "Grey, sandstone, vf-f" 829.945, 838.921, "Red, sandstone, vf-f" 838.921, 840.954, "Grey, sandstone, vf-f" 840.954, 847.432, "Red, sandstone, vf-f" 847.432, 853.953, "Grey, sandstone, vf-f" 853.953, 859.966, "Red, sandstone, vf-f" 859.966, 862.930, "Grey, sandstone, vf-f" 862.930, 872.457, "Red, sandstone, vf-f" 872.457, 874.955, "Grey, sandstone, vf-f" 874.955, 878.935, "Red, sandstone, vf-f" 878.935, 880.925, "Grey, sandstone, vf-f" 880.925, 893.924, "Red, sandstone, vf-f" 893.924, 894.941, "Grey, sandstone, vf-f" 894.941, 905.950, "Red, sandstone, vf-f" 905.950, 918.949, "Grey, sandstone, vf-f" 918.949, 919.923, "Red, mudstone" 919.923, 939.908, "Grey, sandstone, vf-f" 939.908, 947.403, "Red, mudstone" 947.403, 955.914, "Grey, sandstone, vf-f" 955.914, 984.918, "Red, sandstone, vf-f" 984.918, 991.947, "Grey, sandstone, vf-f" 991.947, 1015.913, "Red, sandstone, vf-f" 1015.913, 1019.936, "Grey, sandstone, vf-f" 1019.936, 1134.938, "Red, heterolithic" 1134.938, 1137.436, "Grey, sandstone, vf-f" 1137.436, 1152.425, "Grey, heterolithic" 1152.425, 1154.924, "Grey, sandstone, vf-f" 1154.924, 1159.920, "Grey, mudstone" 1159.920, 1164.959, "Grey, sandstone, vf-f" 1164.959, 1201.966, "Grey, heterolithic" 1201.966, 1204.972, "Grey, sandstone, f-m" 1204.972, 1207.005, "Grey, heterolithic" 1207.005, 1210.011, "Grey, sandstone, f-m" 1210.011, 1217.506, "Grey, heterolithic" 1217.506, 1221.486, "Grey, sandstone, f-m" 1221.486, 1238.000, "Grey, heterolithic" 1238.000, 1246.002, "Grey, sandstone, f-m" 1246.002, 1252.481, "Grey, mudstone" 1252.481, 1262.982, "Grey, sandstone, f-m" 1262.982, 1272.509, "Grey, heterolithic" 1272.509, 1277.505, "Grey, sandstone, f-m" 1277.505, 1287.498, "Grey, heterolithic" 1287.498, 1294.019, "Grey, sandstone, f-m" 1294.019, 1304.012, "Grey, mudstone" 1304.012, 1309.008, "Grey, sandstone, f-m" 1309.008, 1332.000, "Grey, heterolithic" 1332.000, 1333.990, "Grey, sandstone, f-m" 1333.990, 1343.009, "Grey, heterolithic" 1343.009, 1349.996, "Grey, sandstone, f-m" 1349.996, 1357.490, "Grey, heterolithic" 1357.490, 1359.988, "Grey, sandstone, f-m" 1359.988, 1367.991, "Grey, heterolithic" 1367.991, 1369.981, "Grey, sandstone, f-m" 1369.981, 1374.978, "Grey, mudstone" 1374.978, 1377.010, "Grey, sandstone, f-m" 1377.010, 1393.524, "Grey, heterolithic" 1393.524, 1399.028, "Grey, sandstone, f-m" 1399.028, 1414.018, "Grey, heterolithic" 1414.018, 1425.027, "Grey, sandstone, vf-f" 1425.027, 1428.033, "Grey, heterolithic" 1428.033, 1435.019, "Grey, sandstone, vf-f" 1435.019, 1443.996, "Grey, heterolithic" 1443.996, 1448.992, "Grey, sandstone, vf-f" 1448.992, 1455.979, "Grey, heterolithic" 1455.979, 1458.985, "Grey, sandstone, vf-f" 1458.985, 1460.002, "Grey, mudstone" 1460.002, 1463.474, "Grey, sandstone, vf-f" 1463.474, 1482.020, "Grey, heterolithic" 1482.020, 1484.010, "Grey, mudstone" 1484.010, 1487.524, "Grey, sandstone, vf-f" 1487.524, 1489.049, "Grey, mudstone" 1489.049, 1491.081, "Grey, sandstone, vf-f" 1491.081, 1495.569, "Grey, heterolithic" 1495.569, 1507.552, "Grey, sandstone, f-m" 1507.552, 1515.089, "Grey, heterolithic" 1515.089, 1525.082, "Grey, sandstone, f-m" 1525.082, 1527.072, "Grey, mudstone" 1527.072, 1540.071, "Grey, sandstone, f-m" 1540.071, 1542.061, "Grey, mudstone" 1542.061, 1545.068, "Grey, sandstone, f-m" 1545.068, 1547.524, "Grey, mudstone" 1547.524, 1553.028, "Grey, sandstone, f-m" 1553.028, 1554.002, "Grey, mudstone" 1554.002, 1556.500, "Grey, sandstone, f-m" 1556.500, 1557.516, "Grey, mudstone" 1557.516, 1560.015, "Grey, sandstone, f-m" 1560.015, 1562.005, "Grey, mudstone" 1562.005, 1568.017, "Grey, sandstone, f-m" 1568.017, 1570.007, "Grey, mudstone" 1570.007, 1571.998, "Grey, sandstone, f-m" 1571.998, 1573.014, "Grey, mudstone" 1573.014, 1600.028, "Grey, sandstone, f-m" 1600.028, 1602.992, "Grey, mudstone" 1602.992, 1635.046, "Grey, sandstone, f-m" 1635.046, 1640.042, "Grey, heterolithic" 1640.042, 1644.530, "Grey, sandstone, f-m" 1644.530, 1648.045, "Grey, mudstone" 1648.045, 1655.539, "Grey, sandstone, f-m" 1655.539, 1657.572, "Grey, mudstone" 1657.572, 1675.102, "Grey, sandstone, f-m" 1675.102, 1677.092, "Grey, mudstone" 1677.092, 1698.559, "Grey, sandstone, f-m" 1698.559, 1700.084, "Grey, mudstone" 1700.084, 1713.040, "Grey, sandstone, f-m" 1713.040, 1715.031, "Grey, mudstone" 1715.031, 1733.534, "Grey, sandstone, f-m" 1733.534, 1734.550, "Grey, mudstone" 1734.550, 1737.049, "Grey, sandstone, f-m" 1737.049, 1738.531, "Grey, mudstone" 1738.531, 1742.045, "Grey, sandstone, f-m" 1742.045, 1743.019, "Grey, mudstone" 1743.019, 1756.018, "Grey, sandstone, f-m" 1756.018, 1770.034, "Grey, mudstone" 1770.034, 1784.049, "Grey, sandstone, f-m" 1784.049, 1784.557, "Grey, mudstone" 1784.557, 1797.514, "Grey, sandstone, f-m" 1797.514, 1800.520, "Grey, mudstone" 1800.520, 1836.511, "Grey, sandstone, f-m" 1836.511, 1837.019, "Grey, mudstone" 1837.019, 1841.000, "Grey, sandstone, f-m" 1841.000, 1842.016, "Grey, mudstone" 1842.016, 1847.986, "Grey, sandstone, f-m" 1847.986, 1849.002, "Grey, mudstone" 1849.002, 1853.956, "Grey, sandstone, f-m" 1853.956, 1858.445, "Grey, mudstone" 1858.445, 1873.942, "Grey, sandstone, f-m" 1873.942, 1892.446, "Grey, mudstone" 1892.446, 1898.967, "Grey, sandstone, f-m" 1898.967, 1904.471, "Grey, mudstone" 1904.471, 1935.000, "Volcanic"
fname = 'P-129_striplog_from_image.las'
p129 = Well(fname, lexicon=lexicon, unknown_as_other=True)
p129.striplog
{'lithology': Striplog(185 Intervals, start=280.0, stop=1935.0)}
p129.striplog.lithology.plot(legend, interval=(10,50))
import matplotlib.pyplot as plt
Now we have all the well data in one place, we should be able to make some nice plots. For example, use the striplog in a log plot, or use the striplog to define categories for colouring a cross-plot.
First, let's try filling an ordinary curve – the GR log — with lithlogy colours. A classic workaround for this is to plot the striplog, then plot the GR log, then fill the GR log with white to mask the striplog.
z = well.data['DEPT']
log = well.data['GR']
lineweight = 0.5
plot_min = 0
plot_max = 200
# Set up the figure.
fig = plt.figure(figsize=(4,16))
# Plot into the figure.
# First, the lith log, the full width of the log.
ax = fig.add_subplot(111)
well.striplog.striplog.plot_axis(ax, legend, default_width=plot_max)
# Plot the DT with a white fill to fake the curve fill.
ax.plot(log, z, color='k', lw=lineweight)
ax.fill_betweenx(z, log, plot_max, color='w', zorder = 2)
# Limit axes.
ax.set_xlim(plot_min, plot_max)
ax.set_ylim(z[-1], 0)
# Show the figure.
#plt.savefig('/home/matt/filled_log.png')
plt.show()
Now let's try a cross-plot. To facilitate this, generate a new log with the striplog.to_log()
method:
z, lith = well.striplog.striplog.to_log(start=well.start, stop=well.stop, step=well.step, legend=legend)
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(4, 10))
ax = fig.add_subplot(121)
ax.plot(lith, z)
ax.set_ylim(z[-1], 0)
ax.get_yaxis().set_tick_params(direction='out')
ax2 = fig.add_subplot(122)
striplog.plot_axis(ax2, legend=legend)
ax2.set_ylim(z[-1], 0)
ax2.get_xaxis().set_ticks([])
ax2.get_yaxis().set_ticks([])
#plt.savefig('/home/matt/discretized.png')
plt.show()
Next step: make a colourmap from the legend. This could be a method of the legend
, but it's so easy it hardly seems worth the trouble.
import matplotlib.colors as clr
cmap = clr.ListedColormap([i.colour for i in legend])
plt.figure(figsize=(10,7))
plt.scatter(well.data['GR'], well.data['DT'],
c=lith,
edgecolors='none',
alpha=0.8,
cmap=cmap, vmin=1)
plt.xlim(0, 200); plt.ylim(0,150)
plt.xlabel('GR'); plt.ylabel('DT')
plt.grid()
ticks = [int(i) for i in list(set(lith))]
ix = [int(i)-1 for i in list(set(lith)) if i]
labels = [i.component.summary() for i in legend[ix]]
cbar = plt.colorbar()
cbar.set_ticks(ticks)
cbar.set_ticklabels(labels)
plt.show()
We can get a bit fancier still:
from matplotlib.patches import Rectangle
# Start the plot.
fig = plt.figure(figsize=(12,10))
# Crossplot.
ax = fig.add_axes([0.15,0.15,0.6,0.6])
ax.scatter(well.data['GR'], well.data['DT'],
c=lith, edgecolors='none', alpha=0.67,
cmap=cmap, vmin=1)
ax.set_xlim(0, 200); plt.ylim(0,150)
ax.set_xlabel('GR $API$'); ax.set_ylabel(r'DT $\mu s/m$')
ax.grid()
# Draw the legend.
axc = fig.add_axes([0.775,0.2,0.15,0.5])
i = 0
for d in legend:
if i+1 in lith:
tcolour = 'k'
talpha = 1.0
tstyle = 'medium'
else:
tcolour = 'k'
talpha = 0.25
tstyle = 'normal'
rect = Rectangle((0, i),
1, 1,
color=d.colour,
alpha=0.67 )
axc.add_patch(rect)
text = axc.text(0.5, 0.5+i,
d.component.summary(default="Unassigned"),
color=tcolour, ha='center', va='center',
fontsize=10, weight=tstyle, alpha=talpha)
i += 1
axc.set_xlim(0,1); axc.set_ylim(len(legend), 0)
axc.set_xticks([]); axc.set_yticks([])
axc.set_title('Lithology', fontsize=12)
# Finish.
#plt.savefig('/home/matt/crossplot.png')
plt.show()
©2015 Agile Geoscience. Licensed CC-BY. striplog.py