Skip to main content

PyPI version Documentation Status Code style: black

getCalspec

Python package to download Calspec spectra.

The main function query the Calspec table located in calspec_data/calspec.csv to download spectrum FITS files from STSC archive.

Example:

from getCalspec.getCalspec import *

test = is_calspec("eta1 dor")
c = Calspec("eta1 dor")
print("Gaia source id:", c.source_id)
c.get_spectrum_table(type="stis", date="latest")  # download and return an Astropy table
c.get_spectrum_numpy(type="mod", date="2010-12-11")  # download and return a dictionnary of numpy arrays with units
c.plot_spectrum()  # download and plot the spectrum

To get Calspec table and the list of available Calspec names:

from getCalspec.getCalspec import getCalspecDataFrame

df = getCalspecDataFrame()
print(df.Name.values)
# Gaia IDs
print(df.source_id.values)

To get all Calspec data in one time in cache, write:

from getCalspec.rebuild import rebuild_cache
rebuild_cache()

When the STSC webpage is updated, it might be necessary to rebuild the calspec_data/calspec.csv table and the cache:

from getCalspec.rebuild import rebuild_tables, rebuild_cache
rebuild_tables()
rebuild_cache()

Metadata

Release files for getCalspec 2.3.4

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

Source distribution (sdist)

Source distribution for getCalspec 2.3.4
File Size Uploaded
getcalspec-2.3.4.tar.gz 33.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for getCalspec 2.3.4
File Interpreter ABI Platform
getcalspec-2.3.4-py3-none-any.whl Python 3 none any Details

Total release size: 65.3 kB

Release files / getcalspec-2.3.4.tar.gz

Download URL getcalspec-2.3.4.tar.gz
Size 33.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1947576d47dd2e9ce01a54242928be3b0b86f5a970b63e0f7aa360ef2340a9fe
BLAKE2b-256 checksum
How to use checksums
7b77a97969baa6e3171a824fe042ba0e72f028e4fe3d235528e462e89aefd05c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.8

Release files / getcalspec-2.3.4-py3-none-any.whl

Download URL getcalspec-2.3.4-py3-none-any.whl
Size 31.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b1740571e289145d644d7879e7879672d952abdc1af55412aedb3f0c6fb2c9b
BLAKE2b-256 checksum
How to use checksums
e2da30473b3f39a7d9462da7e6513af61ce59f1345c1918285f3c2a0261cdb45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.8

Release history Release notifications | RSS feed

This release

2.3.4 This release

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.1

1 release file

2.3

1 release file

2.2.3

1 release file

2.2.2

1 release file

2.2.1

1 release file

2.1.0

3 release files

2.0.0

2 release files

0.1.6

1 release file

0.1.5

1 release file

0.1.4

2 release files

0.1.3

2 release files

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

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