Giter Club home page Giter Club logo

davies's Introduction

Davies

Davies is a Python package for manipulating cave survey data.

It is currently in a early phase of development, and its interfaces may change as it matures.

Current support includes:

  • Reading of Compass Project (.MAK) and Data (.DAT) source files, as well as compiled Plot (.PLT) files.
  • Writing Compass Data (.DAT) files.
  • Reading PocketTopo exported .TXT survey files.
  • That's it! No loop closure algorithms, no visualization or editing tools (though our examples directory contains scripts with which to build tools of this sort)

Browse the Davies API documentation.

Example usage with Compass survey data:

from davies import compass

# Parse a .DAT file
datfile = compass.DatFile.read('MYCAVE.DAT')

print len(datfile)  # number of surveys in .DAT
>> 17

print datfile.length  # total surveyed footage including splays, etc.
>> 5332.2

print datfile.included_length  # total surveyed footage after discarding excluded shots
>> 5280.0

survey = datfile['BS']  # grab a survey by its survey designation

print survey.name
>> A

print survey.date
>> 2006-09-30

print survey.length  # surveyed footage including splays, etc.
>> 5332.2

print survey.included_length  # surveyed footage after discarding excluded shots
>> 5280.0

print survey.shots[0]
>> {'FROM': 'A1', 'TO': 'A2', 'LENGTH': 16.8, 'BEARING': 158.0, 'INC': -30.0, 'LEFT': 12.0, 'RIGHT': 15.0, 'UP': 15.0, 'DOWN': 20.0}

print survey.shots[0].azm  # azimuth after averaging front and backsights, magnetic declination
155.2

This example shows who has surveyed the most footage in your Compass project:

from davies import compass

cavers = {}

for datfilename in sys.argv[1:]:
    for survey in compass.DatFile.read(datfilename):
        for member in survey.team:
            cavers[member] = cavers.get(member, 0.0) + survey.length

for name in sorted(cavers, key=cavers.get, reverse=True):
    print "%s:\t%0.1f" % (name, cavers[name])

Installation

This software requires Python 2.7. It will NOT work with older Python releases, though it may work with Python 3.3+.

Releases are available for installation from the Python Package Index, see installation instructions or simply run the following command on Mac OS X or most Linux distributions:

$> pip install davies

If you've downloaded a source distribution or checked out from the git repository, install locally with:

$> python setup.py install

Development happens on GitHub.

https://travis-ci.org/riggsd/davies.svg?branch=master

Name

The name "Davies" is a tribute to William E. Davies, who pioneered the systematic cave survey of West Virginia and authored Caverns of West Virginia in 1949. Bill Davies later did the statewide cave survey for the state of Maryland, served the roles of President and Vice-President of the National Speleological Society, and published the definitive US-wide karst map, Engineering Aspects of Karst. Davies still serves as an inspiration today to the cave mappers of West Virginia, of the United States, and the World over.

License

Davies is Free / Open Source software licensed under the MIT License, and is copyright (C) 2013 - 2016 Myotisoft LLC.

davies's People

Contributors

riggsd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

mx-speleosurvey

davies's Issues

Invalid Date Format String on Windows

Davies 0.1.0 on Windows 7 (64-bit)

Traceback (most recent call last):
  File "C:\Users\dariggs\AppData\Local\Anaconda2\lib\site-packages\davies\compass\__init__.py", line 159, in _serialize
    'SURVEY DATE: %s  COMMENT:%s' % (self.date.strftime('%-m %d %Y'), self.comment),
ValueError: Invalid format string

Python's terrible strftime accepts arguments based upon the underlying C library, which differs on Windows vs Posix.

Compass Survey expects a date format without zero-padded month (eg "3" rather than "03" for March). The "%-m" specifier works on Posix, but apparently fails on Windows.

I believe that Compass will accept either month format, though it writes the non-padded version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.