lasfile


Namelasfile JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
SummaryA Python library for reading LAS files.
upload_time2024-09-11 16:03:40
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseNone
keywords las cwls las logs petrophysical logs
VCS
bugtrack_url
requirements numpy pandas apinum
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # lasfile
 Library for reading CWLS Log ASCII Standard v. 1.2, 2.0, and 3.0 .las files.

## Installation
```bash
pip install lasfile
```

## Usage
### Read LAS file
```python
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
```python
las.sections
```
### View section data in LAS file
#### Using dot notation
##### As raw ascii text
```python
las.well.raw_data
```
##### As pandas dataframe
```python
las.well.df
```
#### Using dictionary notation
##### As raw ascii text
```python
las['well']['raw_data']
```
##### As pandas dataframe
```python
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:
```python
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
```python
las.errors
```

#### View specific errors
```python
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
```python
lasfile.error_check(las)
```
##### Check for all errors
```python
lasfile.error_check(las, critical_only=False)
```
##### LASSection objects can also be passed to error_check
```python
lasfile.error_check(las.well)
```


## License
[MIT](https://choosealicense.com/licenses/mit/)
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "lasfile",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "las, CWLS, las logs, petrophysical logs",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/12/9f/cc28403da21228d1adf53bf4e5af7db3294564f558d78c00df98659ca4e8/lasfile-0.2.0.tar.gz",
    "platform": null,
    "description": "# lasfile\n Library for reading CWLS Log ASCII Standard v. 1.2, 2.0, and 3.0 .las files.\n\n## Installation\n```bash\npip install lasfile\n```\n\n## Usage\n### Read LAS file\n```python\nimport lasfile\n\nlas = lasfile.LASFile(file_path='path/to/file.las')\n```\n#### In order for an lasfile to properly read, and pass a critical error check, it must have the following sections:\n- Version\n- Well\n- Curves\n- Data\n\n### View sections in LAS file\n```python\nlas.sections\n```\n### View section data in LAS file\n#### Using dot notation\n##### As raw ascii text\n```python\nlas.well.raw_data\n```\n##### As pandas dataframe\n```python\nlas.well.df\n```\n#### Using dictionary notation\n##### As raw ascii text\n```python\nlas['well']['raw_data']\n```\n##### As pandas dataframe\n```python\nlas['well']['df']\n```\n\n### Write LAS file\nThe `write` function allows you to write LAS files based on the sections available in the `LASFile` object.\n\n#### Usage:\n```python\nfrom lasfile import write\n\nwrite(las, overwrite=False, file_path='path/to/output/file.las')\n```\n\n#### Functionality:\n- 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'.\n\n#### Limitations:\n- Currently, the write functionality **cannot** write LAS v. 3.0 files. This feature is under development.\n- 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.\n\n### Read and Write Capabilities\n| Version | Read       | Write         |\n|---------|------------|---------------|\n| 1.2     | \u2714 Working  | \u2714 Working     |\n| 2.0     | \u2714 Working  | \u2714 Working     |\n| 3.0     | \u2714 Working  | \ud83d\udea7 In Development |\n\n### Errors\n#### View all errors\n```python\nlas.errors\n```\n\n#### View specific errors\n```python\nlas.open_error\nlas.read_error\nlas.split_error\nlas.version_error\nlas.parse_error\nlas.validate_error\n```\n\n#### Check for errors\n##### Check for only critical errors\n```python\nlasfile.error_check(las)\n```\n##### Check for all errors\n```python\nlasfile.error_check(las, critical_only=False)\n```\n##### LASSection objects can also be passed to error_check\n```python\nlasfile.error_check(las.well)\n```\n\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python library for reading LAS files.",
    "version": "0.2.0",
    "project_urls": {
        "homepage": "https://github.com/bzlmnop/lasfile"
    },
    "split_keywords": [
        "las",
        " cwls",
        " las logs",
        " petrophysical logs"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "87f39c5d86e812f2ebb9b60b6ee8d95223195185c02dbf2117a1c0577c2d9ee4",
                "md5": "27bc1899085b1ce467c5b20463df437f",
                "sha256": "2d5765487c6e99d23631b788ebc65fd753f6a0831686e45fb7c1f8311ab9b31a"
            },
            "downloads": -1,
            "filename": "lasfile-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "27bc1899085b1ce467c5b20463df437f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 23537,
            "upload_time": "2024-09-11T16:03:39",
            "upload_time_iso_8601": "2024-09-11T16:03:39.356020Z",
            "url": "https://files.pythonhosted.org/packages/87/f3/9c5d86e812f2ebb9b60b6ee8d95223195185c02dbf2117a1c0577c2d9ee4/lasfile-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "129fcc28403da21228d1adf53bf4e5af7db3294564f558d78c00df98659ca4e8",
                "md5": "9173983b6f1587e22c037e6f3b130a70",
                "sha256": "02271c997faa6363a7ec4836106a5b2a15ca8739b09585eeedb52ba9f75eed45"
            },
            "downloads": -1,
            "filename": "lasfile-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9173983b6f1587e22c037e6f3b130a70",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 24587,
            "upload_time": "2024-09-11T16:03:40",
            "upload_time_iso_8601": "2024-09-11T16:03:40.697941Z",
            "url": "https://files.pythonhosted.org/packages/12/9f/cc28403da21228d1adf53bf4e5af7db3294564f558d78c00df98659ca4e8/lasfile-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-11 16:03:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bzlmnop",
    "github_project": "lasfile",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "pandas",
            "specs": []
        },
        {
            "name": "apinum",
            "specs": []
        }
    ],
    "lcname": "lasfile"
}
        
Elapsed time: 0.35834s