Skip to main content

A package for Synthetic Stellar Photometry

Project description

pysysp: Synthetic Stellar Photometry for Python

This is a set of tools to compute synthetic photometry in a simple way, ideal to integrate in larger projects.

The inputs are photonic response functions for the desired photometric bands and stellar spectra. The units used in this package are: erg cm^-2 s^-1 Ang^-1 for fluxes; Ang^-1 for wavelength. Note that this implies units of cm Ang^-1 for the speed of light. These units must be used in all inputs for the package to operate properly.

It is possible to compute magnitudes in Vega and AB systems, and interstellar extinction, for any given photometric passband, given an extinction law, which must be a callable object function of wavelength only. The only extinction law provided is the one by Cardelli, Clayton & Mathis (1989), but others can be easily added if needed.

At the moment only the bandpasses for Bessel’s UBVRI and Gaia’s G filters are provided.

References

  • Casagrande & VandenBerg (2014)

  • Bessel & Murphy (2012)

Acknowledgments

Usage example

 >>> import pysysp

 # Load a spectrum from a fits file
 >>> vega = pysysp.StarSpectrum('alpha_lyr_stis_006.fits')

 # Print the flux
 >>> vega.flux
 array([  1.23810533e-17,   1.67559561e-17,   1.78002369e-17, ...,
          1.40140733e-19,   1.38734358e-19,   1.26490663e-19], dtype=float32)

 # Check available filters
 >>> pysysp.showfilters
 {'Gaia': ['G'], 'Bessel': ['B', 'I', 'R', 'U', 'V']}

 # Load the photonic response for the bands B and V with linear smoothing
 >>> V = pysysp.BandPass('V', smt='linear')
 >>> B = pysysp.BandPass('B', smt='linear')

 # You can also load any ascii file with two columns (first wavelength, second filter response)
 >>> B2 = pysysp.BandPass('./filters/B.dat')

 # You can also permanently add a new filter to the library of available filters
 >>> pysysp.add_filter('test.txt', name='T')

 # Compute the V magnitude in Vega system
 # The magnitude of Vega in V band is not 0, so in order to
 # compute the correct value we should correct the zero point
 >>> vega.apmag(V, mag='Vega', mzero=0.03)
 0.03

 # Same in AB system
 >>> vega.apmag(V, mag='AB')
 0.0062420242892642364

 # Compute E(B-V) for a (monochromatic) extinction Av=0.5
 >>> ab = vega.extinction(B, law='cardelli', A=0.5, Rv=3.1)
 >>> av = vega.extinction(V, law='cardelli', A=0.5, Rv=3.1)
 >>> ab - av
 0.15954421668471008

Changelog

Changelog

1.0.0 (09/04/2015)

  • Initial release.

1.0.1 (21/10/2015)

  • Added MANIFEST.in file

2.0.1 (11/07/2024)

  • Compatibility with Python 3

  • Can now add new filters

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

pysysp-2.0.1.tar.gz (166.4 kB view details)

Uploaded Source

Built Distribution

pysysp-2.0.1-py3-none-any.whl (165.1 kB view details)

Uploaded Python 3

File details

Details for the file pysysp-2.0.1.tar.gz.

File metadata

  • Download URL: pysysp-2.0.1.tar.gz
  • Upload date:
  • Size: 166.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for pysysp-2.0.1.tar.gz
Algorithm Hash digest
SHA256 a9b38db232f89af52a28876003d9704fcbfaab8396ecfbbdaf87e43545056807
MD5 c691fdeec4da63aa36e542736d71e8ef
BLAKE2b-256 f58d255b9cb3a45ccb059562f5555a3255765dff72257941109b454dd64f8336

See more details on using hashes here.

File details

Details for the file pysysp-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: pysysp-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 165.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for pysysp-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c34ac2072d3f9c2c7c374bbdeff235419cfcf7cd24f9383157b209c6ef9d042
MD5 1236ca8469a305c27e707268ba8a229c
BLAKE2b-256 6f1a57d1a8ad0dc7189f9de4dd901d0c721b31aac54bbf064937483a27a2d867

See more details on using hashes here.

Supported by

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