Loading...
Loading...
Read, write, and manipulate LAS (Log ASCII Standard) well log files for borehole geophysical and petrophysical data. Use when Claude needs to: (1) Read/parse LAS 1.2 or 2.0 files, (2) Extract well headers or curve data, (3) Convert LAS to DataFrame/CSV/Excel, (4) Create new LAS files from arrays, (5) Modify existing LAS files, (6) Handle problematic or malformed LAS files, (7) Batch process multiple well files.
npx skill4agent add steadfastasart/geoscience-skills lasioimport lasio
# Read
las = lasio.read("well.las")
# Access data
df = las.df() # DataFrame (depth as index)
gr = las['GR'] # Single curve as numpy array
depth = las['DEPT']
# Well info
well_name = las.well['WELL'].value
uwi = las.well['UWI'].value
# Write
las.write('output.las')| Class | Purpose |
|---|---|
| Main container - holds headers, curves, data |
| Single curve with mnemonic, unit, data array |
| Header entry (mnemonic, unit, value, descr) |
las = lasio.read("well.las")
print(las.curves.keys()) # Available curves
print(las.well) # Well section headers
print(las.version) # LAS version info# As numpy arrays
gr = las['GR']
depth = las['DEPT']
# With metadata
curve = las.curves['GR']
print(curve.unit, curve.descr) # 'GAPI', 'Gamma Ray'import numpy as np
las = lasio.LASFile()
las.well['WELL'] = lasio.HeaderItem('WELL', value='Test-1')
las.well['UWI'] = lasio.HeaderItem('UWI', value='12345678901234')
depth = np.arange(1000, 2000, 0.5)
las.append_curve('DEPT', depth, unit='M', descr='Depth')
las.append_curve('GR', gr_data, unit='GAPI', descr='Gamma Ray')
las.write('output.las')las = lasio.read("well.las")
las.append_curve('GR_NORM', las['GR'] / 150, unit='V/V')
del las.curves['BAD_CURVE']
las.well['WELL'].value = 'New Name'
las.write('modified.las')# Ignore header errors
las = lasio.read("messy.las", ignore_header_errors=True)
# Check null value
null_val = las.well['NULL'].value # Usually -999.25import numpy as np
null_val = float(las.well['NULL'].value)
df = las.df().replace(null_val, np.nan)from pathlib import Path
for path in Path('wells/').glob('*.las'):
las = lasio.read(path)
df = las.df()
# Process...| Tool | Best For |
|---|---|
| lasio | Direct LAS file I/O, header manipulation, format conversion |
| welly | Higher-level well analysis, curve processing, multi-well projects |
| dlisio | DLIS/RP66 binary format files (not LAS) |
- [ ] Read LAS file with `lasio.read()`, handle encoding if needed
- [ ] Inspect curves: `las.curves.keys()` and well headers
- [ ] Replace null values: `df.replace(null_val, np.nan)`
- [ ] Validate depth range and sample interval
- [ ] Check for missing curves or anomalous values
- [ ] Export to DataFrame with `las.df()` or write cleaned LAS| Issue | Solution |
|---|---|
| Encoding errors | |
| Missing curves | Check |
| Header errors | Use |
| Wrong null value | Check |