Skip to main content

Python map overlay software to read CNO and CNOB files.

Project description

pycno

Python map overlay software to read CNO and CNOB files. This provides a light-weight interface to add overlays to matplotlib plots. For longitude/latitude plots, no additional prerequisites are required. For data with projected coordinates, see "projection support." This allows for pure python installation with supplemental support if desired.

status

Build Status

Early development. Useful light weight mapping library. Interface may change.

install

  • Latest release: pip install pycno
  • Lastest development: pip install https://github.com/barronh/pycno/archive/main.zip

example usage

By default, this adds coasts and countries to the current axes. If the current axes has no other data on it, provide the xlim/ylim keywords to define the extents.

import pycno
import matplotlib.pyplot as plt


cno = pycno.cno(xlim=(-180, 180), ylim=(-90, 90))
cno.draw()
plt.savefig('coasts_countries.png')

Use the cnopath keyword to specify another overlay. If you specify a downloadable cnopath you don't have, it will automatically be downloaded. For a list of downloadable cnob, see pycno.downloadable. Currently, this includes the Panoply Overlay cnobs. For example, cno.draw('MWDB_Coasts_NA_1.cnob') will download a high-resolution version of North American coasts, continents, and states.

projection support

pycno.cno supports the pyproj projections. If you provide the proj keyword, then overlays coordinates will be converted to the projection space before being plotted. In this case, the xlim/ylim keyworkds will need to be provided in projection space. This should work for most projections, but has only been tested with Lambert Conformal Conic and Polar Stereographic. If you test it with another projection, please post a comment under issues and let us know.

lambert conic conformal

Example uses LCC domain used by EPA and called 12US2

import pycno
import pyproj
import matplotlib.pyplot as plt


proj = pyproj.Proj(
  (
    '+proj=lcc +lat_0=40 +lon_0=-97 +lat_1=33 +lat_2=45 ' +
    '+x_0=2412000 +y_0=1620000 +R=6370000 +to_meter=12000 ' +
    '+no_defs'
  ),
  preserve_units=True
)
plt.axis('image')
cno = pycno.cno(proj=proj, xlim=(0, 396), ylim=(0, 246))
cno.draw()
plt.savefig('coasts_countries_lcc.png')

polar stereographic

Example uses Polar Stereographic domain used by EPA and called 108NHEMI2

import pycno
import pyproj
import matplotlib.pyplot as plt


proj = pyproj.Proj(
  (
    '+proj=stere +lat_0=90 +lat_ts=45 +lon_0=-98 ' +
    '+x_0=10098000 +y_0=10098000 +R=6370000 +to_meter=108000 ' +
    '+no_defs'
  ),
  preserve_units=True
)
plt.axis('image')
cno = pycno.cno(proj=proj, xlim=(0, 187), ylim=(0, 187))
cno.draw()
plt.savefig('coasts_countries_ps.png')

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

pycno-0.1.2.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

pycno-0.1.2-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file pycno-0.1.2.tar.gz.

File metadata

  • Download URL: pycno-0.1.2.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.1

File hashes

Hashes for pycno-0.1.2.tar.gz
Algorithm Hash digest
SHA256 afbc483af4f4d29ba4e600ec5d64961eab260c2dff7e84920dd3c605f6576e7e
MD5 46fa1a18d917cd5624821a55b1915e63
BLAKE2b-256 9bf079c7f8ed2212027d0390977f62c2abdea873a538e76fcbd0d51d34eacd75

See more details on using hashes here.

File details

Details for the file pycno-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pycno-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.1

File hashes

Hashes for pycno-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7a88240767a2e092b090ce94312128bf2124d99f68758a1848c86fab926b15b8
MD5 e56e00b25b9379ed92aaf435bba80b7b
BLAKE2b-256 cf4c66c50a57b1d3ddc6c9d24a245353cc6eb1570252fe955f1e6c85dac2ff48

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