Skip to main content

A fast generic spectrum simulator

Project description

PyEchelle

PyEchelle is a simulation tool, to generate realistic 2D spectra, in particular cross-dispersed echelle spectra. However, it is not limited to echelle spectrographs, but allows simulating arbitrary spectra for any fiber-fed or slit spectrograph, where a model file is available. Optical aberrations are treated accurately, the simulated spectra include photon and read-out noise.

PyEchelle uses numba for implementing fast Python-based simulation code. It also comes with CUDA support for major speed improvements.

Example usage

You can use PyEchelle directly from the console:

pyechelle --spectrograph MaroonX --fiber 2-4 --sources Phoenix --phoenix_t_eff 3500 -t 10 --rv 100 -o mdwarf.fit

If you rather script in python, you can do the same as above with the following python script:

from pyechelle.simulator import Simulator
from pyechelle.sources import Phoenix
from pyechelle.spectrograph import ZEMAX

sim = Simulator(ZEMAX("MaroonX"))
sim.set_ccd(1)
sim.set_fibers([2, 3, 4])
sim.set_sources(Phoenix(t_eff=3500))
sim.set_exposure_time(10.)
sim.set_radial_velocities(100.)
sim.set_output('mdwarf.fits', overwrite=True)
sim.run()

Both times, a PHOENIX M-dwarf spectrum with the given stellar parameters, and a RV shift of 100m/s for the MAROON-X spectrograph is simulated.

The output is a 2D raw frame (.fits) and will look similar to:

Check out the Documentation for more examples.

Pyechelle is the successor of Echelle++ which has a similar functionality but was written in C++. This package was rewritten in python for better maintainability, easier package distribution and for smoother cross-platform development.

Installation

As simple as

pip install pyechelle

Check out the Documentation for alternative installation instruction.

Usage

See

pyechelle -h

for all available command line options.

See Documentation for more examples.

Concept:

The basic idea is that any spectrograph can be modelled with a set of wavelength-dependent transformation matrices and point spread functions which describe the spectrographs' optics:

First, wavelength-dependent affine transformation matrices are extracted from the ZEMAX model of the spectrograph. As the underlying geometric transformations (scaling, rotation, shearing, translation) vary smoothly across an echelle order, these matrices can be interpolated for any intermediate wavelength.

Second, a wavelength-dependent point spread functions (PSFs) is applied on the transformed slit images to properly account for optical aberrations. Again, the PSF is only slowly varying across an echelle order, allowing for interpolation at intermediate wavelength.

Echelle simulation

Both, the matrices and the PSFs have to be extracted from ZEMAX only once. It is therefore possible to simulate spectra without access to ZEMAX

Citation

Please cite this paper if you find this work useful in your research.

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

pyechelle-0.3.7.tar.gz (48.7 kB view details)

Uploaded Source

Built Distribution

pyechelle-0.3.7-py3-none-any.whl (52.5 kB view details)

Uploaded Python 3

File details

Details for the file pyechelle-0.3.7.tar.gz.

File metadata

  • Download URL: pyechelle-0.3.7.tar.gz
  • Upload date:
  • Size: 48.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.13 Linux/5.15.0-102-generic

File hashes

Hashes for pyechelle-0.3.7.tar.gz
Algorithm Hash digest
SHA256 1499b72322bb83e43ce217d8ab1abaae91ab6d9741dcbfc9b071d097e31fa105
MD5 df0d5131f3fded863d94cbf20b853a5f
BLAKE2b-256 bab799683ce5ade9a7fddd2f8c15e2400964a376e68089510c4a20bb791caf6c

See more details on using hashes here.

File details

Details for the file pyechelle-0.3.7-py3-none-any.whl.

File metadata

  • Download URL: pyechelle-0.3.7-py3-none-any.whl
  • Upload date:
  • Size: 52.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.13 Linux/5.15.0-102-generic

File hashes

Hashes for pyechelle-0.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 4549b0aa890effc67d59e40bee1c22ca65afe4c2b896a36ce27a37096512a2e9
MD5 32a345bfd8572dab91b58a8b1fd11e95
BLAKE2b-256 6e966a6d8cd82ce6e189d4b5231054400b1bd78c05672e3837e9aab5f5616e76

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