Skip to main content

Python package to download Calspec spectra

Project description

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()

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

getcalspec-2.3.4.tar.gz (33.6 kB view details)

Uploaded Source

Built Distribution

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

getcalspec-2.3.4-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

Details for the file getcalspec-2.3.4.tar.gz.

File metadata

  • Download URL: getcalspec-2.3.4.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for getcalspec-2.3.4.tar.gz
Algorithm Hash digest
SHA256 1947576d47dd2e9ce01a54242928be3b0b86f5a970b63e0f7aa360ef2340a9fe
MD5 36554f44b97caf8b2dd9b3cf717d6ba3
BLAKE2b-256 7b77a97969baa6e3171a824fe042ba0e72f028e4fe3d235528e462e89aefd05c

See more details on using hashes here.

File details

Details for the file getcalspec-2.3.4-py3-none-any.whl.

File metadata

  • Download URL: getcalspec-2.3.4-py3-none-any.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for getcalspec-2.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9b1740571e289145d644d7879e7879672d952abdc1af55412aedb3f0c6fb2c9b
MD5 115fefd6baa66373ee3ba894fd483fa2
BLAKE2b-256 e2da30473b3f39a7d9462da7e6513af61ce59f1345c1918285f3c2a0261cdb45

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