pynumeric是一个python包,用于读取msc雷达数字数据

pynumeric的Python项目详细描述


Build StatusCoverage Status

概述

pynumeric是一个要读取MSC Radar Numeric data的python包。

安装

安装pynumeric的最简单方法是通过python pip实用程序:

pip install pynumeric

要求

依赖性

依赖项列在requirements.txt中。 依赖项在pynumeric安装期间自动安装。

安装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

运行

# 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

使用api

frompynumericimportNumeric# read Numeric datawithopen('/path/to/file')asff:n=Numeric(ff)forkey,valueinn.metadata:print(key,value)print(n.metadata)print(n.data)print(len(n.data))# get the spatial extentprint(n.get_spatial_extent())# get the data extentprint(n.get_data_extent())# read Numeric data using convenience functions# parse files=load('/path/to/numeric_file.dat')# returns Numeric object# parse data stringwithopen('/path/to/numeric_file.dat')asff: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

开发

pip install requirements-dev.txt

运行测试

# 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

释放

python setup.py sdist bdist_wheel --universal
twine upload dist/*

代码约定

检查pep8

的代码
find . -type f -name "*.py"| xargs flake8

错误和问题

所有错误、增强和问题都在 GitHub

联系人

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
IntelliJ中的java默认Maven项目结构不一致   java我希望链接(在帖子和页面上)在一些访问者加载时被自动点击   java如何使用单独的方法隐藏JButton并在新类中调用   java KStream leftJoin KStream具有相同的密钥   java图像在垂直滚动窗格视图端口中消失   java从指定的起始点开始以n的增量填充数组   java JLabel和JTextField不在swing表单中应用   java springboot mongo如果没有映像,请使用现有映像   类似C++映射的java容器   java如何在没有Valgrind错误的情况下调用JNI_CreateJavaVM?   java如何在安卓中运行后台服务   java onPostExecute不运行