Skip to main content

Read functions for NASCAM ASI raw files

Project description

NASCAM All-Sky Imager Raw PGM Data Readfile

Github Actions - Tests PyPI version MIT license PyPI Python versions

Python library for reading NASCAM All-Sky Imager (ASI) stream0 raw PNG-file data. The data can be found at https://data.phys.ucalgary.ca.

Supported Datasets

Installation

The nascam-imager-readfile library is available on PyPI:

$ python3 -m pip install nascam-imager-readfile

Supported Python Versions

nascam-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 nascam_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 nascam_imager_readfile
>>> filename = "path/to/data/2010/01/01/atha_nascam-iccd04/ut06/20100101_0600_atha_nascam-iccd04.png.tar"
>>> img, meta, problematic_files = nascam_imager_readfile.read(filename)

Read multiple files

>>> import nascam_imager_readfile, glob
>>> file_list = glob.glob("path/to/files/2010/01/01/atha_nascam-iccd04/ut06/*.tar")
>>> img, meta, problematic_files = nascam_imager_readfile.read(file_list)

Read using multiple worker processes

>>> import nascam_imager_readfile, glob
>>> file_list = glob.glob("path/to/files/2010/01/01/atha_nascam-iccd04/ut06/*.tar")
>>> img, meta, problematic_files = nascam_imager_readfile.read(file_list, workers=4)

Read with no output

>>> import nascam_imager_readfile, glob
>>> file_list = glob.glob("path/to/files/2010/01/01/atha_nascam-iccd04/ut06/*.tar")
>>> img, meta, problematic_files = nascam_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/nascam-imager-readfile.git
$ cd nascam-imager-readfile/python
$ make install

Testing

$ make test
[ or do each test separately ]
$ make test-flake8
$ make test-pylint
$ make test-pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nascam_imager_readfile-1.4.3.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

nascam_imager_readfile-1.4.3-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page