Skip to main content

Synthesizing and fitting coherent anti-Stokes Raman spectra (CARS) in Python

Project description

CARSpy

https://img.shields.io/pypi/v/carspy.svg https://img.shields.io/travis/chuckedfromspace/carspy.svg Documentation Status

Synthesizing and fitting coherent anti-Stokes Raman spectra (CARS) in Python

Background

Having no access to the source codes of any of the existing CARS programs, I started this project simply as a way to learn more about CARS. I ended up spending a lot of time sifting through literatures from the past decades, trying to figure out what were done to analyze experimental CARS spectra and how they were implemented. The latter proved rather challenging as specific implementations weren’t always laid out in sufficient (mathematical) details to facilitate comprehension and replication (e.g., things as trivial as units for different constants weren’t always made clear in some publications).

In an effort to put together a fully-functioning CARS fitting program, I thought it would perhaps benefit other CARS practitioners (especially the newcomers) if I open source my implementations. I hope to also benefit from this transparency and openness to public scrutiny. Although the “draft” code (not available in this public repo) already lives up to my original purpose (least-square fit of experimental broadband CARS spectra), it is most likely not error-free and has a lot of room left for improvement. Therefore, I plan to rewrite the important modules (spectrum synthesis and least-square fit) and slowly bring all features (see below) up to date. I am also looking forward to feedbacks and potential collaborators from the community.

NOTE: Nitrogen is currently the only species implemented/tested in carspy. Other common species will be added in the future (or can be readily introduced via customization).

Features

  • CARSpy (stands for Coherent Anti-Stokes Raman Spectroscopy):

carspy structure
  • The CARS model:

cars model

Highlights

  1. Option to incorporate equilibrium composition using an external chemical equilibrium calculator (such as cantera), such that temperature is the only fitting parameter for thermometry

  2. Vibrational and rotational nonequilibrium: vibrational temperature can be varied independently from rotational temperature

Comparisons with CARSFT

vs_CARSFT_01

Figure 1 Synthesized CARS spectra in N2 at 1 atm, 2400 K, with a pump linewidth of 0.5 cm-1, using Voigt lineshape and cross-coherence convolution.

vs_CARSFT_02

Figure 2 Synthesized CARS spectra in N2 at 10 atm, 2400 K, with a pump linewidth of 0.5 cm-1, using modified exponential gap law (MEG) and cross-coherence convolution.

Roadmap

The above features currently present in the draft code will be gradually improved and included in the main branch. Here is a tentative plan:

  1. (Implemented) Module for synthesizing CARS spectra (optional with cantera)

  2. (Short-term) Module for least-square fit (with lmfit)

  3. (Mid-term) Multiprocessing

  4. (Mid-term) Docs

  5. (Mid-term) Tutorials

  6. (Long-term) Other common diatomic species

  7. (Long-term) Dualpump/Wide CARS

Citation

Please consider citing this repository if you use carspy for your research as:

@misc{Yin2021,
  author = {Yin, Zhiyao},
  title = {CARSpy: Synthesizing and fitting coherent anti-Stokes Raman spectra (CARS) in Python},
  year = {2021},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/chuckedfromspace/carspy}}
}

History

0.2.0 (2021-02-13)

  • Implement modules for synthesizing N2 CARS spectra

0.1.0 (2021-02-13)

  • First release on PyPI.

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

carspy-0.2.0.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

carspy-0.2.0-py2.py3-none-any.whl (18.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file carspy-0.2.0.tar.gz.

File metadata

  • Download URL: carspy-0.2.0.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.7.0 requests/2.23.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.6

File hashes

Hashes for carspy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8ebeaceac0303f696d62ff30c407425a296fb6553c59911843630c8b76908551
MD5 e63ac9d48cdf3fa17257e02b83010274
BLAKE2b-256 4b09707fc95e5699ca22a34b6c696a10d140bfb16188423570ca3a4237a06b45

See more details on using hashes here.

File details

Details for the file carspy-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: carspy-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.7.0 requests/2.23.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.6

File hashes

Hashes for carspy-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 947ca9664b694076328a160eb11831bd7e05e7b87ed0ab876ea2f068f1b33edd
MD5 ba452f2fc7c1f0584dc724d711304fac
BLAKE2b-256 839665518d09e43e486f3bdf34fa912d2073cd45b355650635df98d6d9fb4074

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