Skip to main content

pynumeric is a Python package to read MSC Radar Numeric data

Project description

Build Status Coverage Status

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

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


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.0.tar.gz (20.7 kB view details)

Uploaded Source

Built Distributions

pynumeric-0.1.0-py2.py3-none-any.whl (8.7 kB view details)

Uploaded Python 2 Python 3

pynumeric-0.1.0-py2.7.egg (10.6 kB view details)

Uploaded Source

File details

Details for the file pynumeric-0.1.0.tar.gz.

File metadata

  • Download URL: pynumeric-0.1.0.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pynumeric-0.1.0.tar.gz
Algorithm Hash digest
SHA256 da456d0fcac031ec41eb982f93dae056dd1ed48e341ccf81f8bb546c7f7a540f
MD5 a6d743170301dafdc9dfb9f5f493d6d2
BLAKE2b-256 610b59d54c18f399ee7595447090e5637fdd875d480a3113056c0cf3b876fe4d

See more details on using hashes here.

File details

Details for the file pynumeric-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pynumeric-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4127c2fe23287e75e608df03453478b5d9cfe1fa204187a5ea9736e3c606711c
MD5 6c4d062e04be18d0a95436259c4e628f
BLAKE2b-256 358eb75d209163217395dcf09c72fe8aa742512d055c468bd376ea107078e744

See more details on using hashes here.

File details

Details for the file pynumeric-0.1.0-py2.7.egg.

File metadata

File hashes

Hashes for pynumeric-0.1.0-py2.7.egg
Algorithm Hash digest
SHA256 7f69855d3ab30024ff5a1beeace10d43b492634b9746be19f2ee84bfe9466bfd
MD5 70c130d32978433566999ad146a40dd7
BLAKE2b-256 9d1df1b358d12ff638a047262cc13b1f1f89a0c7b8bce77c98c725d4a5ba5603

See more details on using hashes here.

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