Code Monkey home page Code Monkey logo

orca_ir's Introduction

orca-ir

A Python 3 script for (hassle-free) plotting of IR spectra from ORCA output files with peak dectection and annotation. It combines the stick spectrum with the convoluted spectrum (gaussian line shape). The full spectrum or parts of the spectrum (via matplotlib window) can be plotted.

External modules

re numpy matplotlib scipy

Quick start

Start the script with:

python3 orca-ir.py filename

it will save the plot as PNG bitmap: filename-ir.png

Command-line options

  • filename , required: filename
  • -w N , optional: line width (in cm-1) of the gaussian (default is N = 15)
  • -s , optional: shows the matplotlib window
  • -n , optional: do not save the spectrum
  • -e , optional: export the line spectrum in a csv-like fashion; filename of the export is input filename + "-mod.dat"

Script options

There are numerous ways to configure the spectrum in the script: Check # plot config section - configure here in the script. Here, you can configure an absorption or transmittance plot for example. You can even configure the script to plot of the single gaussian functions.

The delimiter for the line spectrum export can be changed by changing the value of export_delim =.

Code options

Colors, line thickness, line styles, level of peak detection and more can be changed in the code directly.

Remarks

The spectrum always starts at zero and ends at the maximum wave number. If you need only a part of the spectrum, you can start the script with:

python3 orca-ir.py filename -s

and use the matplotlib window to zoom to an area of interest and save it. The PNG file will be replaced everytime you start the script with the same output file. If you want to keep the file, you have to rename it.

Examples:

show Example 1 Example 2 Example 3

orca_ir's People

Contributors

radi0sus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jyarger

orca_ir's Issues

Colored gaussians

Dear Sir,
in order to produce a plot similar to the last one with colored gaussians, it should be enough to make the following changes?

ax.set_prop_cycle('color', plt.cm.tab10.colors)
for index, freq in enumerate(freqlist):
    #single gauss function line plot
    if show_single_gauss:
        ax.plot(plt_range_x,gauss(intenslist[index], plt_range_x, freq, w),alpha=0.5) 
    #single gauss function filled plot
    if show_single_gauss_area:
        ax.fill_between(plt_range_x,gauss(intenslist[index], plt_range_x, freq, w),alpha=0.5)

Thanks in advance,
Rafael RP

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.