A Python library for reading LAS files.
Project description
lasfile
Library for reading CWLS Log ASCII Standard v. 1.2, 2.0, and 3.0 .las files.
Installation
pip install lasfile
Usage
Read LAS file
import lasfile
las = lasfile.LASFile(file_path='path/to/file.las')
In order for an lasfile to properly read, and pass a critical error check, it must have the following sections:
- Version
- Well
- Curves
- Data
View sections in LAS file
las.sections
View section data in LAS file
Using dot notation
As raw ascii text
las.well.raw_data
As pandas dataframe
las.well.df
Using dictionary notation
As raw ascii text
las['well']['raw_data']
As pandas dataframe
las['well']['df']
Write LAS file
The write
function allows you to write LAS files based on the sections available in the LASFile
object.
Usage:
from lasfile import write
write(las, overwrite=False, file_path='path/to/output/file.las')
Functionality:
- If a 'file_path' is not passed to the function, the 'write' function will attempt to overwrite the existing file stored in the 'file_path' variable of the LASFile object. Overwrite functionality is disabled by default but can be enabled by setting the 'overwrite' attribute to 'True'.
Limitations:
- Currently, the write functionality cannot write LAS v. 3.0 files. This feature is under development.
- LAS v. 3.0 files can be written to LAS v. 2.0 format by setting the 'version' keyword argument of the 'write' function to '2.0'. However, this will result in the loss of any data stored in sections not found in the LAS v. 2.0 format.
Read and Write Capabilities
Version | Read | Write |
---|---|---|
1.2 | ✔ Working | ✔ Working |
2.0 | ✔ Working | ✔ Working |
3.0 | ✔ Working | 🚧 In Development |
Errors
View all errors
las.errors
View specific errors
las.open_error
las.read_error
las.split_error
las.version_error
las.parse_error
las.validate_error
Check for errors
Check for only critical errors
lasfile.error_check(las)
Check for all errors
lasfile.error_check(las, critical_only=False)
LASSection objects can also be passed to error_check
lasfile.error_check(las.well)
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lasfile-0.2.0.tar.gz
(24.6 kB
view details)
Built Distribution
lasfile-0.2.0-py3-none-any.whl
(23.5 kB
view details)
File details
Details for the file lasfile-0.2.0.tar.gz
.
File metadata
- Download URL: lasfile-0.2.0.tar.gz
- Upload date:
- Size: 24.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02271c997faa6363a7ec4836106a5b2a15ca8739b09585eeedb52ba9f75eed45 |
|
MD5 | 9173983b6f1587e22c037e6f3b130a70 |
|
BLAKE2b-256 | 129fcc28403da21228d1adf53bf4e5af7db3294564f558d78c00df98659ca4e8 |
File details
Details for the file lasfile-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: lasfile-0.2.0-py3-none-any.whl
- Upload date:
- Size: 23.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d5765487c6e99d23631b788ebc65fd753f6a0831686e45fb7c1f8311ab9b31a |
|
MD5 | 27bc1899085b1ce467c5b20463df437f |
|
BLAKE2b-256 | 87f39c5d86e812f2ebb9b60b6ee8d95223195185c02dbf2117a1c0577c2d9ee4 |