pynumeric is a Python package to read MSC Radar Numeric data
Project description
Overview
pynumeric is a Python package to read MSC Radar Numeric data.
Installation
The easiest way to install pynumeric is via the Python pip utility:
pip install pynumeric
Requirements
Python 3. Works with Python 2.7
Dependencies
Dependencies are listed in requirements.txt. Dependencies are automatically installed during pynumeric installation.
Installing pynumeric
# setup virtualenv
virtualenv --system-site-packages -p python3 pynumeric
cd pynumeric
source bin/activate
# clone codebase and install
git clone https://github.com/ECCC-MSC/pynumeric.git
cd pynumeric
python setup.py build
python setup.py install
Running
# help
pynumeric --help
# get pynumeric version
pynumeric --version
# get pynumeric GDAL version
pynumeric --gdal-version
# report on a single numeric file
pynumeric report -f </path/to/numeric_file>
# add verbose mode (ERROR, WARNING, INFO, DEBUG)
pynumeric report -f </path/to/numeric_file> --verbosity=DEBUG
# export a numeric file to GeoTIFF
pynumeric export -f </path/to/numeric_file> -o foo.tif -of GTiff
# export a numeric file to NetCDF
pynumeric export -f </path/to/numeric_file> -o foo.tif -of NetCDF
Using the API
from pynumeric import Numeric
# read Numeric data
with open('/path/to/file') as ff:
n = Numeric(ff)
for key, value in n.metadata:
print(key, value)
print(n.metadata)
print(n.data)
print(len(n.data))
# get the spatial extent
print(n.get_spatial_extent())
# get the data extent
print(n.get_data_extent())
# read Numeric data using convenience functions
# parse file
s = load('/path/to/numeric_file.dat') # returns Numeric object
# parse data string
with open('/path/to/numeric_file.dat') as ff:
numeric_string = ff.read()
s = loads(numeric_string) # returns Numeric object
# export to GeoTIFF
# Supported are any of the supported GDAL
# Raster Format Codes (http://www.gdal.org/formats_list.html)
s.to_grid('myfile.tif', 'GTiff') # creates myfile.tif on disk
Development
pip install requirements-dev.txt
Running Tests
# install dev requirements
pip install -r requirements-dev.txt
# run tests like this:
python pynumeric/tests/run_tests.py
# or this:
python setup.py test
# measure code coverage like this
coverage run --source=pynumeric -m unittest pynumeric.tests.run_tests
coverage report -m
# or this:
python setup.py coverage
Releasing
python setup.py sdist bdist_wheel --universal
twine upload dist/*
Code Conventions
Checking Code for PEP8
find . -type f -name "*.py" | xargs flake8
Bugs and Issues
All bugs, enhancements and issues are managed on GitHub.
Contact
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
pynumeric-0.1.1.tar.gz
(20.9 kB
view details)
Built Distributions
pynumeric-0.1.1-py2.7.egg
(10.7 kB
view details)
File details
Details for the file pynumeric-0.1.1.tar.gz
.
File metadata
- Download URL: pynumeric-0.1.1.tar.gz
- Upload date:
- Size: 20.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c40e5fd974c70c469062ab8a9efab7acd97a68087f67c9e9712bb9c1c706d2b0 |
|
MD5 | 6a1519e6abbec22f0e9825250597cdc1 |
|
BLAKE2b-256 | 9cb7f87998807e042665821e2341d6679f9f604f00278b49a640036af9a14fd1 |
File details
Details for the file pynumeric-0.1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: pynumeric-0.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e0aee0f7a25e0de1663a49800ddb3a63151c3ee5b7fc017b28f713eb6ea40f8 |
|
MD5 | 8907d805a8ff9057922cee9d0b5e1c30 |
|
BLAKE2b-256 | 381be3cf2c7afddae10784d01bdaf3124816714093369a493475b97e47016a5e |
File details
Details for the file pynumeric-0.1.1-py2.7.egg
.
File metadata
- Download URL: pynumeric-0.1.1-py2.7.egg
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe8a84d1301b34cae2ac9c98aa05560549111f578e73cce7edd880d6033a1ea3 |
|
MD5 | bfb5c4c5698b630f95b858bf6c3e69e4 |
|
BLAKE2b-256 | 39df82f5877b210aa63431a7a2cacc965f028177eb2fc6e5832fe80d7fdd903d |