Giter VIP home page Giter VIP logo

longhurst-province-finder's Introduction

Longhurst-Province-Finder

DOI

Takes a tsv file in format sampleID\tlatitude\tlongitude\n and returns an output with with Longhurst codes and the description of the Longhurst Province where the coordinate is located. It works by parsing a file that contains lat/long coordinates that bound each province and performing the Crossings Test on each province. The Crossings Test is used in computer graphics to quickly determine if a point is within or outside a polygon by "drawing" a line east from the input coordinate and seeing how many crossings the line makes with the polygon border. If there is an odd number of crossings, the point is within the polygon, otherwise the point is outside the polygon.

coord2longhurst.py

python coord2longhurst.py 45 -138

Returns: 45.0 N, -138.0 E --> NPPF Westerlies - N. Pacific Polar Front Province

coord2longhurst_batch.py

python coord2longhurst_batch.py 2longhurst.tsv longhurst_codes.tsv

Returns: S0001 49.7225 -42.4467 NADR Westerlies N. Atlantic Drift Province (WWDR) ... S0008 46.312 -39.658 NADR Westerlies N. Atlantic Drift Province (WWDR) ...

Original script from: @ Sara Collins. MIT. 3/18/2015 https://github.com/thechisholmlab/Longhurst-Province-Finder

Modified 30/04/2020 by @ Shane Hogle UTU/MIT for python3 compatibility and to operate in batch mode

longhurst-province-finder's People

Contributors

slhogle avatar

Watchers

 avatar

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.