Read functions for Rainbow ASI PNM raw files
Project description
Rainbow All-Sky Imager Raw PGM Data Readfile (GO-Canada AGO/CGSM Rainbow)
Python library for reading Rainbow All-Sky Imager (GO-Canada AGO/CGSM Rainbow) stream0 raw PGM-file data. The data can be found at https://data.phys.ucalgary.ca.
Installation
The rainbow-imager-readfile library is available on PyPI:
$ python3 -m pip install rainbow-imager-readfile
Supported Python Versions
rainbow-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 rainbow_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 rainbow_imager_readfile
>>> filename = "path/to/data/2015/01/01/fsmi_rainbow-11/ut06/20150101_0600_fsmi_rainbow-11_full.pgm.gz"
>>> img, meta, problematic_files = rainbow_imager_readfile.read(filename)
Read multiple files
>>> import rainbow_imager_readfile, glob
>>> file_list = glob.glob("path/to/files/2015/01/01/fsmi_rainbow-11/ut06/*full.pgm*")
>>> img, meta, problematic_files = rainbow_imager_readfile.read(file_list)
Read using multiple worker processes
>>> import rainbow_imager_readfile, glob
>>> file_list = glob.glob("path/to/files/2015/01/01/fsmi_rainbow-11/ut06/*full.pgm*")
>>> img, meta, problematic_files = rainbow_imager_readfile.read(file_list, workers=4)
Read with no output
>>> import rainbow_imager_readfile, glob
>>> file_list = glob.glob("path/to/files/2015/01/01/fsmi_rainbow-11/ut06/*full.pgm*")
>>> img, meta, problematic_files = rainbow_imager_readfile.read(file_list, workers=4, quiet=True)
Development
Clone the repository and install dependencies using Poetry.
$ git clone https://github.com/ucalgary-aurora/rainbow-imager-readfile.git
$ cd rainbow-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
Hashes for rainbow_imager_readfile-1.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac3cd1e052f34b3e2878e6734350f3da7f1b2b254131079aea48f5ab3c052e1d |
|
MD5 | 8f499ba090df10c152e703800e67bb7f |
|
BLAKE2b-256 | 21c79ab4e75b7f2de048f45654e9c16dcb4ea63ef8bf0d844bbaf863e0c4fe2f |
Hashes for rainbow_imager_readfile-1.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a07eea22156a4ef878b6f6a9b7a566df86101050c31064690d6e08e0d25487d5 |
|
MD5 | e26a75e9aad8c0c1cdc7517553de5a7b |
|
BLAKE2b-256 | 27ed3b0dbe83de4425985b337632673bc72e74d418f27cec96cd29513cc1bf94 |