Read functions for THEMIS ASI PGM raw files
Project description
THEMIS All-Sky Imager Raw PGM Data Readfile
Python library for reading THEMIS All-Sky Imager (ASI) stream0 raw PGM-file data. The data can be found at https://data.phys.ucalgary.ca or http://themis.igpp.ucla.edu/index.shtml.
Supported Datasets
- THEMIS ASI raw: stream0 PGM files
Installation
The themis-imager-readfile library is available on PyPI:
$ python3 -m pip install themis-imager-readfile
Supported Python Versions
themis-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 themis_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 themis_imager_readfile
>>> filename = "path/to/data/2020/01/01/atha_themis02/ut06/20200101_0600_atha_themis02_full.pgm.gz"
>>> img, meta, problematic_files = themis_imager_readfile.read(filename)
Read multiple files
>>> import themis_imager_readfile, glob
>>> file_list = glob.glob("path/to/files/2020/01/01/atha_themis02/ut06/*full.pgm*")
>>> img, meta, problematic_files = themis_imager_readfile.read(file_list)
Read using multiple worker processes
>>> import themis_imager_readfile, glob
>>> file_list = glob.glob("path/to/files/2020/01/01/atha_themis02/ut06/*full.pgm*")
>>> img, meta, problematic_files = themis_imager_readfile.read(file_list, workers=4)
Read with no output
>>> import themis_imager_readfile, glob
>>> file_list = glob.glob("path/to/files/2020/01/01/atha_themis02/ut06/*full.pgm*")
>>> img, meta, problematic_files = themis_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/themis-imager-readfile.git
$ cd themis-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 themis_imager_readfile-1.2.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82f933556ab5c6cb7989226af3887dd82a2c08b91e47ba5f354ebb51bf81063e |
|
MD5 | a50de6c6f70e7c6ea43ba0e22e516ddf |
|
BLAKE2b-256 | 0978582cc2ebffdcb2f3bd928309775532d9a863901602ac19551b75d42df72b |
Hashes for themis_imager_readfile-1.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3aca646dfe1003628e6150aa28a3742ca5e01eba4d82449b63f85e247261c8f1 |
|
MD5 | ee83b06c91fbf31309700d101fb65dea |
|
BLAKE2b-256 | a96c1e1e7cbf8466d0ebaabc4550ec9e77d7ec300dbb2253a753680f25581915 |