# Redline All-Sky Imager Raw PGM Data Readfile (REGO)
[![Github Actions - Tests](https://github.com/ucalgary-aurora/rego-imager-readfile/workflows/tests/badge.svg)](https://github.com/ucalgary-aurora/rego-imager-readfile/actions?query=workflow%3Atests)
[![PyPI version](https://img.shields.io/pypi/v/rego-imager-readfile.svg)](https://pypi.python.org/pypi/rego-imager-readfile/)
[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)
[![PyPI Python versions](https://img.shields.io/pypi/pyversions/rego-imager-readfile.svg)](https://pypi.python.org/pypi/rego-imager-readfile/)
Python library for reading REGO All-Sky Imager (ASI) stream0 raw PGM-file data. The data can be found at https://data.phys.ucalgary.ca.
## Supported Datasets
- REGO raw: [stream0](https://data.phys.ucalgary.ca/sort_by_project/GO-Canada/REGO/stream0) PGM files
## Installation
The rego-imager-readfile library is available on PyPI:
```console
$ python3 -m pip install rego-imager-readfile
```
## Supported Python Versions
rego-imager-readfile officially supports Python 3.8+.
## Examples
Example Python notebooks can be found in the "examples" directory. Further, some examples can be found in the "Usage" section below.
## Usage
Import the library using `import rego_imager_readfile`
**Warning**: On Windows, be sure to put any `read` calls into a `main()` method. This is because we utilize the multiprocessing library and the method of forking processes in Windows requires it. Note that if you're using Jupyter or other IPython-based interfaces, this is not required.
### Read a single file
```python
>>> import rego_imager_readfile
>>> filename = "path/to/data/2020/01/01/fsmi_rego-654/ut06/20200101_0600_fsmi_rego-654_6300.pgm.gz"
>>> img, meta, problematic_files = rego_imager_readfile.read(filename)
```
### Read multiple files
```python
>>> import rego_imager_readfile, glob
>>> file_list = glob.glob("path/to/files/2020/01/01/fsmi_rego-654/ut06/*6300.pgm*")
>>> img, meta, problematic_files = rego_imager_readfile.read(file_list)
```
### Read using multiple worker processes
```python
>>> import rego_imager_readfile, glob
>>> file_list = glob.glob("path/to/files/2020/01/01/fsmi_rego-654/ut06/*6300.pgm*")
>>> img, meta, problematic_files = rego_imager_readfile.read(file_list, workers=4)
```
### Read with no output
```python
>>> import rego_imager_readfile, glob
>>> file_list = glob.glob("path/to/files/2020/01/01/fsmi_rego-654/ut06/*6300.pgm*")
>>> img, meta, problematic_files = rego_imager_readfile.read(file_list, workers=4, quiet=True)
```
### Read only the first frame of each file
```python
>>> import rego_imager_readfile, glob
>>> file_list = glob.glob("path/to/files/2020/01/01/fsmi_rego-654/ut06/*6300.pgm*")
>>> img, meta, problematic_files = rego_imager_readfile.read(file_list, first_frame=True)
```
### Exclude reading the metadata
```python
>>> import rego_imager_readfile, glob
>>> file_list = glob.glob("path/to/files/2020/01/01/fsmi_rego-654/ut06/*6300.pgm*")
>>> img, meta, problematic_files = rego_imager_readfile.read(file_list, no_metadata=True)
```
## Development
Clone the repository and install dependencies using Poetry.
```console
$ git clone https://github.com/ucalgary-aurora/rego-imager-readfile.git
$ cd rego-imager-readfile/python
$ make install
```
## Testing
```console
$ make test
[ or do each test separately ]
$ make test-flake8
$ make test-pylint
$ make test-pytest
```
Raw data
{
"_id": null,
"home_page": "https://github.com/ucalgary-aurora/rego-imager-readfile",
"name": "rego-imager-readfile",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8.1,<4.0.0",
"maintainer_email": "",
"keywords": "",
"author": "Darren Chaddock",
"author_email": "dchaddoc@ucalgary.ca",
"download_url": "https://files.pythonhosted.org/packages/d8/fe/9aa17661930caaf9818e470a241cc97e71a44dae5b98b3c84d558e779904/rego_imager_readfile-1.3.1.tar.gz",
"platform": null,
"description": "# Redline All-Sky Imager Raw PGM Data Readfile (REGO)\n\n[![Github Actions - Tests](https://github.com/ucalgary-aurora/rego-imager-readfile/workflows/tests/badge.svg)](https://github.com/ucalgary-aurora/rego-imager-readfile/actions?query=workflow%3Atests)\n[![PyPI version](https://img.shields.io/pypi/v/rego-imager-readfile.svg)](https://pypi.python.org/pypi/rego-imager-readfile/)\n[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)\n[![PyPI Python versions](https://img.shields.io/pypi/pyversions/rego-imager-readfile.svg)](https://pypi.python.org/pypi/rego-imager-readfile/)\n\nPython library for reading REGO All-Sky Imager (ASI) stream0 raw PGM-file data. The data can be found at https://data.phys.ucalgary.ca.\n\n## Supported Datasets\n\n- REGO raw: [stream0](https://data.phys.ucalgary.ca/sort_by_project/GO-Canada/REGO/stream0) PGM files\n\n## Installation\n\nThe rego-imager-readfile library is available on PyPI:\n\n```console\n$ python3 -m pip install rego-imager-readfile\n```\n\n## Supported Python Versions\n\nrego-imager-readfile officially supports Python 3.8+.\n\n## Examples\n\nExample Python notebooks can be found in the \"examples\" directory. Further, some examples can be found in the \"Usage\" section below.\n\n## Usage\n\nImport the library using `import rego_imager_readfile`\n\n**Warning**: On Windows, be sure to put any `read` calls into a `main()` method. This is because we utilize the multiprocessing library and the method of forking processes in Windows requires it. Note that if you're using Jupyter or other IPython-based interfaces, this is not required.\n\n### Read a single file\n\n```python\n>>> import rego_imager_readfile\n>>> filename = \"path/to/data/2020/01/01/fsmi_rego-654/ut06/20200101_0600_fsmi_rego-654_6300.pgm.gz\"\n>>> img, meta, problematic_files = rego_imager_readfile.read(filename)\n```\n\n### Read multiple files\n\n```python\n>>> import rego_imager_readfile, glob\n>>> file_list = glob.glob(\"path/to/files/2020/01/01/fsmi_rego-654/ut06/*6300.pgm*\")\n>>> img, meta, problematic_files = rego_imager_readfile.read(file_list)\n```\n\n### Read using multiple worker processes\n\n```python\n>>> import rego_imager_readfile, glob\n>>> file_list = glob.glob(\"path/to/files/2020/01/01/fsmi_rego-654/ut06/*6300.pgm*\")\n>>> img, meta, problematic_files = rego_imager_readfile.read(file_list, workers=4)\n```\n\n### Read with no output\n\n```python\n>>> import rego_imager_readfile, glob\n>>> file_list = glob.glob(\"path/to/files/2020/01/01/fsmi_rego-654/ut06/*6300.pgm*\")\n>>> img, meta, problematic_files = rego_imager_readfile.read(file_list, workers=4, quiet=True)\n```\n\n### Read only the first frame of each file\n\n```python\n>>> import rego_imager_readfile, glob\n>>> file_list = glob.glob(\"path/to/files/2020/01/01/fsmi_rego-654/ut06/*6300.pgm*\")\n>>> img, meta, problematic_files = rego_imager_readfile.read(file_list, first_frame=True)\n```\n\n### Exclude reading the metadata\n\n```python\n>>> import rego_imager_readfile, glob\n>>> file_list = glob.glob(\"path/to/files/2020/01/01/fsmi_rego-654/ut06/*6300.pgm*\")\n>>> img, meta, problematic_files = rego_imager_readfile.read(file_list, no_metadata=True)\n```\n\n## Development\n\nClone the repository and install dependencies using Poetry.\n\n```console\n$ git clone https://github.com/ucalgary-aurora/rego-imager-readfile.git\n$ cd rego-imager-readfile/python\n$ make install\n```\n\n## Testing\n\n```console\n$ make test\n[ or do each test separately ]\n$ make test-flake8\n$ make test-pylint\n$ make test-pytest\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Read functions for REGO ASI PGM raw files",
"version": "1.3.1",
"project_urls": {
"Homepage": "https://github.com/ucalgary-aurora/rego-imager-readfile",
"Repository": "https://github.com/ucalgary-aurora/rego-imager-readfile"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "613da18d15c142ca805efd92827c833689bdaeede53814ced9ae2cc2dd81de8f",
"md5": "617a75269192d331abe636eab1671737",
"sha256": "71031005c6a91bb769f677aadcf9bbb34288e639d8a9c93da52dfc4035ed4e01"
},
"downloads": -1,
"filename": "rego_imager_readfile-1.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "617a75269192d331abe636eab1671737",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.1,<4.0.0",
"size": 6593,
"upload_time": "2024-02-07T22:48:54",
"upload_time_iso_8601": "2024-02-07T22:48:54.005008Z",
"url": "https://files.pythonhosted.org/packages/61/3d/a18d15c142ca805efd92827c833689bdaeede53814ced9ae2cc2dd81de8f/rego_imager_readfile-1.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d8fe9aa17661930caaf9818e470a241cc97e71a44dae5b98b3c84d558e779904",
"md5": "b2078f352eafb4005ef6bcd30db98451",
"sha256": "8ee7393b78498e183e3b0995f6bfadc85d484ebb35bc5af6d07a1c0bdba77b2a"
},
"downloads": -1,
"filename": "rego_imager_readfile-1.3.1.tar.gz",
"has_sig": false,
"md5_digest": "b2078f352eafb4005ef6bcd30db98451",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.1,<4.0.0",
"size": 6210,
"upload_time": "2024-02-07T22:48:55",
"upload_time_iso_8601": "2024-02-07T22:48:55.577652Z",
"url": "https://files.pythonhosted.org/packages/d8/fe/9aa17661930caaf9818e470a241cc97e71a44dae5b98b3c84d558e779904/rego_imager_readfile-1.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-07 22:48:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ucalgary-aurora",
"github_project": "rego-imager-readfile",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "rego-imager-readfile"
}