export_context¶
petrophys.reporting.context.export_context
Also available as petrophys.export_context, petrophys.reporting.export_context
- export_context(
- data,
- output_path=None,
- *,
- layout='well',
- max_bytes=DEFAULT_MAX_BYTES,
- max_total_bytes=DEFAULT_MAX_TOTAL_BYTES,
- overwrite=False,
- context_profile=None,
- split_by_lithology=True,
- **options,
Write a well summary or a fully computed context package.
layout="well"(the default) summarizes one well or interpretation result in one JSON file atoutput_path; withoutoutput_paththe summary is returned as a dict (categoryselects one category’s document).layout="package"interprets every well file of thedatafolder and writes the context package to the new folderoutput_path: one folder per category, well and formation (or zone), one JSON file per group.formations,lithologyandlithology_codesare the formation tops, lithology intervals and lithology codebook, as forpetrophys.read(); a tops or zones table for several wells needs awellcolumn.Without
context_profile, package layouts read the well files in thedatafolder, apply optional formation and lithology inputs, interpret each well with the suppliedworkflow_configor defaults, and write context JSON. Files are read bypetrophys.read()from their extension: LAS, DLIS, CSV or TSV.patternselects them (default"*.las"; e.g."*.dlis"or"*.csv"), andreader_optionsare passed to the reader, e.g.{"depth_unit": "m"}for a CSV or TSV file, which records no depth unit, or{"step": 0.1524}for a DLIS sampling step in metres.zones(package layout only) is a CSV or Excel file or a table of your own intervals: one row per zone with its name (zoneorname),topandbottom, and awellcolumn when it covers several wells. The zones take the place of the formations, and their documents carryzone_infoandzone_name. Setting columns (rw,m…) apply inside their zone, as inpetrophys.interpret(well, zones=...).Interpretation settings for every well of a package are keywords, as for
petrophys.interpret()(rw=0.07, sw_model="indonesia"), or a completeworkflow_config; keywords override its fields.In a package each formation (or zone; the whole well without either) is split into lithology groups, runs of samples with one lithology, or with
split_by_lithology=Falseis one group; such a group’s documents give itsdominant_lithology.context_profilecomputes a published package from its delivery’s raw LAS files with the package’s own pipeline and calculations (petrophys.reporting.context_profiles):"geolink"(data: the rawevalfolder; alsoformations, the NPD picks workbook, andlithology_codes, the GeoLink lithology codebook),"geolink_train"(theLAS_with_petrophys_paramsraw LAS; also the NPD picks workbook and the GeoLink codebook),"danish"(the Danish raw LAS; also its tops workbook and the codebook) or"costa"(the COSTA LAS, or None for the copies bundled with petrophys). A profile fixes the package’s settings, soworkflow_configand the other interpretation options are rejected; onlywell_names,pattern,formationsandlithology_codesapply. Context profiles apply only to the package layout, and only the context JSON is written tooutput_path.max_bytes(default 1,000,000) is the largest size of one JSON document andmax_total_bytes(default: no limit) that of a whole package; a larger export raisesContextSizeErrorand writes nothing. A well summary is not written over an existing file unlessoverwrite=True; a package always needs a folder that does not exist yet. The well layout returns the summary (a dict) or the path of the written file, and the package layout a list with one export result per written context file (source_file,output_file,success,warningsanderrors).