Read functions for REGO ASI PGM raw files
Project description
Redline All-Sky Imager Raw PGM Data Readfile (REGO)
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 PGM files
Installation
The rego-imager-readfile library is available on PyPI:
$ 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
>>> 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
>>> 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
>>> 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
>>> 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
>>> 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
>>> 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.
$ git clone https://github.com/ucalgary-aurora/rego-imager-readfile.git
$ cd rego-imager-readfile/python
$ make install
Testing
$ make test
[ or do each test separately ]
$ make test-flake8
$ make test-pylint
$ make test-pytest
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
Built Distribution
File details
Details for the file rego_imager_readfile-1.3.1.tar.gz
.
File metadata
- Download URL: rego_imager_readfile-1.3.1.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Linux/6.5.0-15-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ee7393b78498e183e3b0995f6bfadc85d484ebb35bc5af6d07a1c0bdba77b2a |
|
MD5 | b2078f352eafb4005ef6bcd30db98451 |
|
BLAKE2b-256 | d8fe9aa17661930caaf9818e470a241cc97e71a44dae5b98b3c84d558e779904 |
File details
Details for the file rego_imager_readfile-1.3.1-py3-none-any.whl
.
File metadata
- Download URL: rego_imager_readfile-1.3.1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.7 Linux/6.5.0-15-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71031005c6a91bb769f677aadcf9bbb34288e639d8a9c93da52dfc4035ed4e01 |
|
MD5 | 617a75269192d331abe636eab1671737 |
|
BLAKE2b-256 | 613da18d15c142ca805efd92827c833689bdaeede53814ced9ae2cc2dd81de8f |