Welcome to PyONGC’s documentation!

PyOngc

A python interface for accessing OpenNGC database data

https://img.shields.io/pypi/v/PyOngc.svg https://img.shields.io/pypi/status/PyOngc.svghttps://img.shields.io/pypi/pyversions/PyOngc.svghttps://github.com/mattiaverga/PyOngc/actions/workflows/python-package.yml/badge.svg?branch=master https://coveralls.io/repos/github/mattiaverga/PyOngc/badge.svg?branch=master

Description

PyOngc provides a python module to access astronomical data about NGC and IC objects.

The data is based on OpenNGC database https://github.com/mattiaverga/OpenNGC.

It is composed by a python module and a command line interface named (guess what) ongc, which can be used to quickly see object details or build object lists based on several parameters.

PyOngc can pass data to PyEphem in a simple way to get ephemerides of NGC/IC objects: see the documentation about ongc.xephemFormat method.

Usage

>>> import pyongc
>>> DSOobject = pyongc.get("NGC7000")
>>> DSOobject.coords
array([[20.  , 59.  , 17.14],
       [44.  , 31.  , 43.6 ]])

Object data is easily available from command line also:

$ ongc view NGC7000 --details
+-----------------------------------------------------------------------------+
| Id: 13055     Name: NGC7000           Type: HII Ionized region              |
| R.A.: 20:59:17.14      Dec.: +44:31:43.6      Constellation: Cyg            |
| Common names:                                                               |
|    North America Nebula                                                     |
+-----------------------------------------------------------------------------+
| Major axis: 120.0'     Minor axis: 30.0'      Position angle: N/A           |
| B-mag: 4.0     V-mag: N/A     J-mag: N/A     H-mag: N/A     K-mag: N/A      |
|                                                                             |
+-----------------------------------------------------------------------------+
| Other identifiers:                                                          |
|    C 020, LBN 373                                                           |
+-----------------------------------------------------------------------------+
| OpenNGC notes:                                                              |
|    B-Mag taken from LEDA                                                    |
+-----------------------------------------------------------------------------+

The full documentation is available at https://pyongc.readthedocs.io/en/latest/.

License

PyOngc is licensed under MIT.

The ongc python module

Classes provided by ongc module

Functions provided by ongc module

Public Functions

Private Functions

These functions are usually only useful internally.

Custom exceptions for PyOngc

Exceptions for PyONGC.

exception InvalidCoordinates(text: Optional[str] = None)

Raised when coordinates are not valid.

Maybe you’re passing an object without registered coordinates (typically an Unknown object) to some function; or you input coordinates as text in a wrong format: to be recognized the input text must be in the format HH:MM:SS.ss +/-DD:MM:SS.s.

exception ObjectNotFound(name: Optional[str] = None)

Raised when a valid object identifier isn’t found in the database.

The identifier is recognized to be part of one of the supported catalogs, but the object isn’t in the database (or doesn’t exist at all).

For example, pyongc.Dso(‘NGC7000A’) is valid, but it doesn’t exist.

exception UnknownIdentifier(text: Optional[str] = None)

Raised when input text can’t be recognized as a valid object identifier.

You’re asking for an identifier using the wrong format, or using an identifier which refers to a catalog not supported by PyOngc.

The CLI interface

Synopsis

ongc COMMAND [OPTIONS] [ARGS]…

Description

ongc is the command line interface to used to browse ONGC database data. It can be used to query data about an object or to build up lists based on some parameters.

Commands

Nearby

The nearby command allows to list objects in proximity of given J2000 coordinates. If the ouput exceed 20 objects, the user can choose to view the list in a pager.

The coordinates must be expressed in the form HH:MM:SS(.SS) +/-DD:MM:SS(.S)

ongc nearby [options] RA DEC

RA

Right Ascension in the form HH:MM:SS(.SS)

DEC

Declination in the form +/-DD:MM:SS(.S)

--radius INTEGER

It’s the radius ot the search, expressed in arcmin. If it’s not provided, the search is made with a default value of 60’.

--catalog [all|NGC|IC]

Allows to list only objects from NGC or IC catalog. By default the search will ouput all objects.

Neighbors

The neighbors command allows to list objects in proximity of another object. If the ouput exceed 20 objects, the user can choose to view the list in a pager.

ongc neighbors [options] NAME

NAME

The identifier of the object. It can be the main identifier (NGC or IC id) or one of the alternative identifier.

--radius INTEGER

It’s the radius ot the search, expressed in arcmin. If it’s not provided, the search is made with a default value of 30’.

--catalog [all|NGC|IC]

Allows to list only objects from NGC or IC catalog. By default the search will ouput all objects.

Separation

The separation command returns the apparent angular separation between two objects.

ongc separation OBJ1 OBJ2

OBJ1

The identifier of the object. It can be the main identifier (NGC or IC id) or one of the alternative identifier.

OBJ2

The identifier of the object. It can be the main identifier (NGC or IC id) or one of the alternative identifier.

Stats

The stats command shows some information about the database in use.

ongc stats

View

The view command allows to gather information about a specific object.

ongc view [options] NAME

Without options, prints a brief description of the object composed by the main identifier used in ONGC database, the object type and the constellation where the object is located.

NAME

The identifier of the object. It can be the main identifier (NGC or IC id) or one of the alternative identifier.

-D, --details

Prints all the available information about the object.

The output is rendered in a table suited to be viewed in a 80cols terminal.

Help

If you find bugs in ongc (or in the man page), please feel free to file a bug report or a pull request:

https://github.com/mattiaverga/PyOngc