Skip to main content

maglimit

codeastro pypi DOI CI Documentation Status

A package to determine observability of an astronomical object using its magnitude and telescope's limiting magnitude. As a rule of thumb, the limiting magnitude of a telescope depends on the aperture of mirror / lens:

$$L_{mag} = 2 + 5\log{D_0}$$ Where $D_0$ is the aperture in mm. lim_mag() uses this formula and ignores the sky; sky_lim_mag() also takes sky brightness and the eyepiece into account. sky_lim_mag() is a simplified estimate that hasn't been calibrated against real observations yet, and eyes vary, so treat its result as a guide. With no eyepiece, it assumes low power, where the exit pupil matches your eye. It can come out above the rule of thumb, because higher magnification darkens the sky background.

Installation

Requires Python 3.10+.

pip install maglimit

or, in a uv project:

uv add maglimit

Quick start

import maglimit as ml

scope = ml.Telescope(aperture=100, fstop=4.5)   # 100 mm f/4.5
scope.lim_mag()                                  # 12.0
scope.magnification(f_eyepiece=25)               # 18.0
ml.is_object_observable("M31", scope.lim_mag())  # True (queries NED)
ml.smallest_scope("NGC 244", fs=4.5)             # (13.83, <Quantity 232.27 mm>, <Quantity 1045.22 mm>)

site = ml.Site(bortle=5)                         # or sqm=20.1
scope.sky_lim_mag(site)                          # 11.19, at low power
scope.sky_lim_mag(site, eyepiece=10)             # 12.46
scope.exit_pupil(25)                             # 5.56 (mm)
scope.dawes_limit()                              # 1.16 (arcseconds)

From the command line, for a summary of a telescope and its eyepieces:

maglimit scope --aperture 200 --fstop 5 --eyepieces 32,25,10 --bortle 5

Add --json to get the same numbers as JSON.

Development

git clone https://github.com/iamstarstuff/maglimit
cd maglimit
uv sync --all-groups
uv run pytest                     # add -m "not network" to skip the live NED test
uv run sphinx-build -b html docs docs/_build/html

Releases are published to PyPI from GitHub releases via trusted publishing (see .github/workflows/publish.yml).

Tutorials

You can find the tutorial here: docs/Tutorial/limiting_magnitude.ipynb

Future Goals:

  • We use astroquery.ipac.ned catalogue to query the object by Messier and NGC name. Further we plan to add cross-catalogue query feature.

Metadata

Release files for maglimit 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for maglimit 0.2.0
File Size Uploaded Provenance Actions
maglimit-0.2.0.tar.gz 12.5 kB Without provenance Details for maglimit-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for maglimit 0.2.0
File Interpreter ABI Platform Actions
maglimit-0.2.0-py3-none-any.whl Python 3 none any Details for maglimit-0.2.0-py3-none-any.whl

Total release size: 22.9 kB

Release files / maglimit-0.2.0.tar.gz

Download URL maglimit-0.2.0.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6c867fd9d48b0c0a7cd0d9895050a73842b1f1cb5d1347a38e50fcc349e370fb
BLAKE2b-256 checksum
How to use checksums
c313cd36921ffa62d3c456a003fc6112d95b81b53b6d50fea6a67dd8c7c30d8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / maglimit-0.2.0-py3-none-any.whl

Download URL maglimit-0.2.0-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43134a5e33cb2a02d1efe269f4c645d3045d5e18cc9ba77ac3bc41774faee147
BLAKE2b-256 checksum
How to use checksums
4c8965a6d759eb00f22472a51e96d16aebe307d0b06aaba7a72860ef23b651fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for maglimit 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page