GithubHelp home page GithubHelp logo

earodriguezm / raman-spectroscopy Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.46 MB

This script analyzes RAMAN data with multiple peaks, automatically detecting the peaks and fitting Lorentzian models to each of them. It extracts and prints the fitted parameters (amplitude, center and sigma) for each peak.

License: GNU General Public License v3.0

Jupyter Notebook 100.00%

raman-spectroscopy's Introduction

RAMAN Data Analysis Tool

This Python script is designed to analyze RAMAN spectroscopy data. It processes raw data files, splits them into header and data sections, performs peak detection, and fits multiple Lorentzian models to the detected peaks.

Stars Badge Forks Badge Pull Requests Badge Issues Badge GitHub contributors License Badge

Loved the project? Please consider giving a Star ⭐️ to help it improve!

Features

  • Automatic encoding detection for input files
  • Splitting of input files into header and data sections
  • Data visualization of raw RAMAN spectra
  • Peak detection
  • Multiple Lorentzian peak fitting
  • Generation of fitted spectra plots
  • Extraction and reporting of fitted peak parameters

Requirements

  • Python 3.x
  • Required Python packages:
    • csv
    • chardet
    • matplotlib
    • numpy
    • lmfit
    • scipy

Usage

  1. Place your RAMAN data files in a folder named 'Data' in the same directory as the script.
  2. Run the script. It will process all files in the 'Data' folder.
  3. Results will be saved in a 'Results' folder, with subfolders for each processed file.

Output

For each processed file, the script generates:

  • A header file with the equipment parameters(header.txt)
  • A CSV file with the raw data (data.csv)
  • A plot of the raw spectrum (.png and .svg formats)
  • A plot of the fitted spectrum with individual peak components (.png and .svg formats)
  • A text file with detailed fit results (results_fitted.txt)
  • A text file with summarized peak information (results_peaks_info.txt)

Functions

  • files_path_searcher: Finds all files in the specified folder
  • path_helper: Generates necessary file paths for output
  • detect_encoding: Automatically detects the encoding of input files
  • split_file: Splits the input file into header and data sections
  • read_data: Reads the data and generates a raw spectrum plot
  • lorentzian: Defines the Lorentzian function for peak fitting
  • analyze_data: Performs peak detection, fitting, and generates result plots and files

raman-spectroscopy's People

Contributors

earodriguezm avatar

Watchers

 avatar

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.