Skip to content

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

Notifications You must be signed in to change notification settings

EARodriguezM/Raman-Spectroscopy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published