e1


Namee1 JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/LANL-seismoacoustics/e1
SummaryPython support for the e1 compression format.
upload_time2023-01-17 23:09:28
maintainer
docs_urlNone
authorJonathan MacCarthy
requires_python
licenseMIT
keywords seismology geophysics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # e1.py

Python support for the e1 seismic compression format.

"e1" is a variable-length compression algorithm for int32 data.


## Installation

```python
pip install e1
```

## Usage

### Decompress data from a file

```python
import e1

file_name = 'some_file.w'
byte_offset = 0
nsamples = 1000

with open(file_name, 'rb') as f:
    f.seek(byte_offset)
    data = e1.decompress_file(f, nsamples)

```

### Decompress raw bytes

```python
with open(file_name, 'rb') as f:
    # Read 5 times as many bytes as you expecte from nsamples x 4-byte values,
    # just to make sure all your nsamples are in it.  Though it may be more data
    # than you need, this gaurds against poorly-compressed data.  
    # In e1, you don't know a priori how many bytes it took to compress your data.
    nbytes = 5 * nsamples * 4
    byts = f.read(nbytes)

data = decompress(byts, nsamples)
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/LANL-seismoacoustics/e1",
    "name": "e1",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "seismology,geophysics",
    "author": "Jonathan MacCarthy",
    "author_email": "jkmacc@lanl.gov",
    "download_url": "https://files.pythonhosted.org/packages/02/6a/1f9a3915dd16165065f7ec70d7fc4433362821052424bc3d16400051a267/e1-0.1.2.tar.gz",
    "platform": "Mac OS X",
    "description": "# e1.py\n\nPython support for the e1 seismic compression format.\n\n\"e1\" is a variable-length compression algorithm for int32 data.\n\n\n## Installation\n\n```python\npip install e1\n```\n\n## Usage\n\n### Decompress data from a file\n\n```python\nimport e1\n\nfile_name = 'some_file.w'\nbyte_offset = 0\nnsamples = 1000\n\nwith open(file_name, 'rb') as f:\n    f.seek(byte_offset)\n    data = e1.decompress_file(f, nsamples)\n\n```\n\n### Decompress raw bytes\n\n```python\nwith open(file_name, 'rb') as f:\n    # Read 5 times as many bytes as you expecte from nsamples x 4-byte values,\n    # just to make sure all your nsamples are in it.  Though it may be more data\n    # than you need, this gaurds against poorly-compressed data.  \n    # In e1, you don't know a priori how many bytes it took to compress your data.\n    nbytes = 5 * nsamples * 4\n    byts = f.read(nbytes)\n\ndata = decompress(byts, nsamples)\n```\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python support for the e1 compression format.",
    "version": "0.1.2",
    "split_keywords": [
        "seismology",
        "geophysics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "665d1b589431f6808d3d2a211b20d030407dbcd0fc199752d4f846c0afd9a386",
                "md5": "b9076c5b4d94430910d037d5013576d4",
                "sha256": "a75c0d30dce0ff7ec5e2326873dba5048c86db36d4cb601d8c06151d4ba17544"
            },
            "downloads": -1,
            "filename": "e1-0.1.2-cp38-cp38-macosx_10_9_x86_64.whl",
            "has_sig": false,
            "md5_digest": "b9076c5b4d94430910d037d5013576d4",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": null,
            "size": 9917,
            "upload_time": "2023-01-17T23:09:25",
            "upload_time_iso_8601": "2023-01-17T23:09:25.995980Z",
            "url": "https://files.pythonhosted.org/packages/66/5d/1b589431f6808d3d2a211b20d030407dbcd0fc199752d4f846c0afd9a386/e1-0.1.2-cp38-cp38-macosx_10_9_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "026a1f9a3915dd16165065f7ec70d7fc4433362821052424bc3d16400051a267",
                "md5": "46f17174e10436227147356d06da5fff",
                "sha256": "f49ed551496db8f8f05ca994089dea6f2f3d281cdd2498d63349a804fd7f9a3e"
            },
            "downloads": -1,
            "filename": "e1-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "46f17174e10436227147356d06da5fff",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 12962,
            "upload_time": "2023-01-17T23:09:28",
            "upload_time_iso_8601": "2023-01-17T23:09:28.668859Z",
            "url": "https://files.pythonhosted.org/packages/02/6a/1f9a3915dd16165065f7ec70d7fc4433362821052424bc3d16400051a267/e1-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-17 23:09:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "LANL-seismoacoustics",
    "github_project": "e1",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "e1"
}
        
Elapsed time: 0.03545s