Code Monkey home page Code Monkey logo

pyaraucaria's Introduction

Common Routines of OCA Observatory and Araucaria Project

This library is intended to group various common routines and commandline tools used in Araucaria Project and OCA observatory software.

Routines of this library should contain external dependencies as limited as possible and be compatible with Python 3.6+.

The compatibility with Python 2.7 is also valuable.

Installation

Basic install:

    $ pip install git+https://github.com/araucaria-project/pyaraucaria.git

or, more modern and safer

    $ python -m pip install git+https://github.com/araucaria-project/pyaraucaria.git

Developer install

For those who want to contribute

    $ git clone https://github.com/araucaria-project/pyaraucaria.git
    $ cd pyaraucaria
    $ pip install -e ./

Usage in your project

Add the following line to your requirements.txt file (and/or to install_requires section of your setup.py if you use one):

git+https://github.com/araucaria-project/pyaraucaria.git

Routines

Coordinates

coordinates.py contains dependency-free fast routines to parse/format sexagesimal coordinates.

Lookup Objects

Lookup for objects/targets parameters using one of its aliases. Uses Objects.database nad TAB.ALL files.

Example

>>> from pyaraucaria.lookup_objects import ObjectsDatabase
>>> od = ObjectsDatabase()
>>> od.lookup_object('lmc105_8_11987')
{'name': 'CEP25', 
 'ra': '05:18:12.8', 
 'dec': '-71:17:15.4', 
 'per': 3.4050955, 
 'hjd0': 2160.55457, 
 'aliases': ['LMC-T2CEP-085', 'lmc105.8_11987', 'lmc105_8_11987', 'cepii_lmc105_8_11987'], 
 'hname': 'LMC-T2CEP-085'
}

Command Line

$ lookup_objects -j hd167003
{"hd167003": {"name": "HIP37", "ra": "18:14:43.3", "dec": "-33:08:41.8", "aliases": ["hd_167003", "hd167003"]}}

See also

$ lookup_objects --help

Optional dependencies

For YAML output (-y option), some yaml python package should be installed.

Star Object Data Library

Set of routines for parsing TAB.ALL-like files

Example

>>> from pyaraucaria import libobject
>>> ol = libobject.ObjectList('TAB.ALL')
>>> ol.get_object('AL_Dor').data
{'I': None,
 'K': None,
 'V': 7.8,
 'aop': 1.8771,
 'band': 'V',
 'comment': None,
 'dec': '-60:36:14',
 'ecc': 0.1952,
 'file': None,
 'group': 'hipp',
 'hjd0': 2452764.100149,
 'k1': 57.477,
 'k2': 57.253,
 'lc': 'I',
 'obstype': None,
 'per': 14.90519957,
 'phext': None,
 'ra': '04:46:52.2',
 'status': None,
 'v0': 11.836}

pyaraucaria's People

Contributors

mmiirrkk avatar majkelx avatar sosenka4 avatar ernestworkspace 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.