Skip to main content

A Python package that provides astronomical constants.

Project description

AstroConst

PyPI PyPI - Downloads Documentation Status PyPI - License

A Python package that provides astronomical constants. The code is being developed by Marc van der Sluys of the department of Astrophysics at the Radboud University Nijmegen, the Institute of Nuclear and High-Energy Physics (Nikhef), and the Institute for Gravitational and Subatomic Physics (GRASP) at Utrecht University, all in The Netherlands. The AstroConst package can be used under the conditions of the EUPL 1.2 licence.

Note that the package is currently is its alpha stage, and things may still change as I start using this.

Installation

This package can be installed using pip install astroconst. This should automatically install the dependency package numpy, if it has't been installed already. If you are installing by hand, ensure that this package is installed as well.

Example use

SI units should be used everywhere - no ergs, dyn or cm (sorry!). Values include mathematical constants (like π), angle-conversion factors (from/to radians, degrees, hours, arcseconds, ...), calendar stuff (names of weekdays and months, JDs, lengths of days, months and years), solar-system objects (Sun, Moon, planet names diameters, orbital separations, etc. - note that Moon = planet #0), and some basic physical constants ((Stefan-)Bolzmann, Planck, speed of light, etc.).

The submodule aa contains constants published by the Astronomical Almanac, converted to Python.

"""Example Python script using the AstroConst package."""

import astroconst as ac

print(ac.c)     # 299792458 (speed of light, quick access)
print(ac.aa.c)  # Access constants from Astronomical Almanac

print(ac.jd2000)  # 2451545
print(ac.m_sun)  # 1.9891e+30 (kg)
print(ac.sol_const)  # 1361.5 (W/m2)

print(ac.year_jul)  # 31557600.0 (s)
print(ac.year_jul/ac.day)  # 365.25 (days)
print(ac.month_syn/ac.day)  # 29.530588853 (days)

print('The diameter of '+ac.plname_en[5]+' is '+str(ac.pl_d[5]/ac.km)+' km')
# The diameter of Jupiter is 142984 km

print('a_'+ac.plname_en[0]+' = '+str(ac.pl_a[0]/ac.km)+' km')
# a_Moon = 384400.0 km (Moon = planet #0)

print(ac.dow_en_abr[0])  # Sun
print(ac.months_en[3])  # March

AstroConst pages

Author and licence

References

Copyright (c) 2022 Marc van der Sluys

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

astroconst-0.0.10.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

astroconst-0.0.10-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file astroconst-0.0.10.tar.gz.

File metadata

  • Download URL: astroconst-0.0.10.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for astroconst-0.0.10.tar.gz
Algorithm Hash digest
SHA256 bba5b14cbaa7260021f23d5d9e803eba6654e592094aa2bb7094de5ec9754693
MD5 f1bf4dfb289960a329784b3c80b20aad
BLAKE2b-256 f88f6fbaf659158536524ce5e68cb0da4085eb4cc593d953dc518a4fa49055e2

See more details on using hashes here.

File details

Details for the file astroconst-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: astroconst-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for astroconst-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 817f7987d4f792ee054ae9a35710f7d82614e3141ab480ad845546a4c1a23953
MD5 37f26a66929dd866160aac9a6e5aebd1
BLAKE2b-256 0baf5cf716153922af8bc8b7c34d6964599aaa7d511cc5afb6883f024deb1ae6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page