Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

AstroColor

A Python library for converting between photometric systems, true color calculation, and space image processing.

It performs synthetic photometry on low-resolution (5-nm wavelength grid step) spectra as well as spectral reconstruction from measurements in filters based on Tikhonov regularization.

Pre-alpha version! Do not use!

Installation

Use AstroColor in a virtual environment:

python3 -m venv .venv
.venv/bin/pip install git+https://github.com/Askaniy/AstroColor.git

Or add AstroColor to your uv project:

uv add git+https://github.com/Askaniy/AstroColor.git

Key features

  • Calculate synthetic photometry
import astrocolor as ac

spectrum = ac.Spectrum(
    wavelength_nm=[400, 500, 600, 700],
    spectral_dist=[1, 2, 2, 1]
)
v_band = ac.Filter.get('Generic/Bessell.V')
flux_value, flux_error = ac.get_photometry(spectrum, v_band)
  • Create a filter system
johnson_system = ac.FilterSet.get(
    'Generic/Bessell.B',
    'Generic/Bessell.V',
    'Generic/Bessell.R'
)
photospectrum_BVR = ac.get_photometry(spectrum, johnson_system)
  • Reconstruct photometry measurements into a smooth spectrum
reconstructed = ac.spectral_reconstruction(photospectrum_BVR, requested_wavelengths=[400, 700])
  • Convert measurements directly between photometric systems
sloan_system = ac.FilterSet.get('SLOAN/SDSS.g', 'SLOAN/SDSS.r')
photospectrum_gr = ac.get_photometry(photospectrum_BVR, sloan_system)
  • Work on your wavelengths
custom_filter_set = ac.Filter.monochromatic(656.279) | ac.Filter.monochromatic(486.135)
  • Calculate true colors
color_xyz = ac.ColorPoint.from_spectral_data(ac.sun_CALSPEC)
color_system = ac.ColorSystem('sRGB', 'Illuminant E') # recommended
color_rgb = color_xyz.to_color_system(color_system)
color_rgb.maximize_brightness = True
color_html = color_rgb.to_html()
  • Model spectra
bb_3000K = get_spectrometry(ac.BlackBodyModel(3000), [400, 700])
  • Process images via spectral cube reconstruction
# coming soon after debugging
  • Error propagation with covariance matrices
# coming soon after debugging

History

TrueColorTools were created in 2020 to resolve disputes regarding the color of celestial bodies. It features a graphical user interface and a user-expandable spectral database. Over time, the core of the program became self-contained enough to be spun off into a library. The refactoring took place in 2026; it opens up a general astronomical application.

For developers

Use uv sync --group dev to set the environment and build the library. Use uv run pytest for testing. Use \dev folder for local experiments.

Any changes suggested by AI must be thoroughly reviewed by the person who generated them. The responsibility always lies with the person.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

astrocolor-0.1.0b0.tar.gz (108.8 kB view details)

Uploaded Source

Built Distribution

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

astrocolor-0.1.0b0-py3-none-any.whl (117.5 kB view details)

Uploaded Python 3

File details

Details for the file astrocolor-0.1.0b0.tar.gz.

File metadata

  • Download URL: astrocolor-0.1.0b0.tar.gz
  • Upload date:
  • Size: 108.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for astrocolor-0.1.0b0.tar.gz
Algorithm Hash digest
SHA256 b85acbaea8c33809d3393ff7ee484555125780eabcc683cd955d0326c11ebbbd
MD5 0d5b09819254ed8d3480decf58434a74
BLAKE2b-256 1142cb6c31649d7b78c9a03acf0efbf225f23f6d7ff9b1fc3e5bf8f138cb54ae

See more details on using hashes here.

File details

Details for the file astrocolor-0.1.0b0-py3-none-any.whl.

File metadata

  • Download URL: astrocolor-0.1.0b0-py3-none-any.whl
  • Upload date:
  • Size: 117.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for astrocolor-0.1.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ff1c02d54035b210ee151463e9131e90dbd1f08133edc5b295f62c4e9edd7e6
MD5 95a52a1130508f036a562791daebab1f
BLAKE2b-256 39d95c41f4351efd669d8168b96c8400d252a00404b5956f4b174fe4691c6699

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0b0 This release

2 files

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