Skip to main content

A package to extract a power spectrum from raw data of arbitrary Brillouin spectrometers.

Project description

The HDF5_BLS_treat package

This package is a part of the HDF5_BLS project. It's purpose is to unify the conversion of arbitrary Brillouin spectrometers data into a power spectrum.

Installation

To install the package, you can use pip:

pip install HDF5_BLS_analyse

To install the package from source for local development, please refer to the documentation.

Documentation

You can access the documentation of the project at this link or on the dedicated ReadTheDocs page at this link.

Example of usage

from HDF5_BLS_analyse import Analyse_VIPA
import numpy as np
import matplotlib.pyplot as plt

# Creating a mock spectrum and a mock pixel axis
def DHO(nu, nu0, gamma, a, b):
    return b + a * (gamma*nu0)**2/((nu**2-nu0**2)**2+(gamma*nu)**2)

nu = (np.linspace(-1,1,1024) + 2)**2 * 90/8 - 50 # The frequency axis is a simple quadratic polynomial here
pixel = np.arange(len(nu))
mock_spectrum = DHO(nu, nu0=-35, gamma=0.5, a=1, b=0) + DHO(nu, nu0=-25, gamma=0.5, a=1, b=0) + DHO(nu, nu0=-5, gamma=0.5, a=1, b=0) + DHO(nu, nu0=5, gamma=0.5, a=1, b=0) + DHO(nu, nu0=25, gamma=0.5, a=1, b=0) + DHO(nu, nu0=35, gamma=0.5, a=1, b=0) + np.random.normal(0, 0.05, size=1024)

# Initialising the Analyse_VIPA object on the mock spectrum
analyser = Analyse_VIPA(x = np.arange(mock_spectrum.size), y = mock_spectrum)

# Creating a blank algorithm to perform the analysis
analyser.silent_create_algorithm(algorithm_name="VIPA spectrum analyser", 
                            version="v0", 
                            author="Pierre Bouvet", 
                            description="This algorithm allows the user to recover a frequency axis basing ourselves on a single Brillouin spectrum obtained with a VIPA spectrometer. Considering that only one Brillouin Stokes and anti-Stokes doublet is visible on the spectrum, the user can select the peaks he sees, and then perform a quadratic interpolation to obtain the frequency axis. This interpolation is obtained either by entering a value for the Brillouin shift of the material or by entering the value of the Free Spectral Range (FSR) of the spectrometer. The user can finally recenter the spectrum either using the average between a Stokes and an anti-Stokes peak or by choosing an elastic peak as zero frequency.")

# Adding points corresponding to peaks to the algorithm
analyser.add_point(position_center_window=79, type_pnt="Anti-Stokes", window_width=5)
analyser.add_point(position_center_window=252, type_pnt="Stokes", window_width=5)
analyser.add_point(position_center_window=513, type_pnt="Anti-Stokes", window_width=5)
analyser.add_point(position_center_window=619, type_pnt="Stokes", window_width=5)
analyser.add_point(position_center_window=810, type_pnt="Anti-Stokes", window_width=5)
analyser.add_point(position_center_window=895, type_pnt="Stokes", window_width=5)

# Defining the FSR of the VIPA used
analyser.interpolate_elastic_inelastic(FSR = 30)

# Identifying the central peaks and recentering the spectrum to have them be symetric
analyser.add_point(position_center_window=33.7, type_pnt="Stokes", window_width=1)
analyser.add_point(position_center_window=43.8, type_pnt="Anti-Stokes", window_width=1)
analyser.center_x_axis(center_type = "Inelastic")

# # Plotting the results
plt.plot(analyser.x, analyser.y)
plt.xlabel("Frequency (GHz)")
plt.ylabel("PSD (a.u.)")
plt.show()

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

hdf5_bls_analyse-1.1.1.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hdf5_bls_analyse-1.1.1-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file hdf5_bls_analyse-1.1.1.tar.gz.

File metadata

  • Download URL: hdf5_bls_analyse-1.1.1.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for hdf5_bls_analyse-1.1.1.tar.gz
Algorithm Hash digest
SHA256 2cdb2384e5b4919288ff05bda23d7dcba70844aa5f8b73801034fda41d3d8296
MD5 1fae9b19ea369d6425396f87bed7e703
BLAKE2b-256 9f1f08234844d9219c62c656404e7c3c6b730d7c06015dde40fdcdf77150785a

See more details on using hashes here.

File details

Details for the file hdf5_bls_analyse-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for hdf5_bls_analyse-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a85beaabab96bff2ee60abff43f94d936ffa0e1a1cb71285a33790bdbd3debf
MD5 bbaf9b603fac5406c38c80ac87d98f00
BLAKE2b-256 a5c34e0fb3fd62c0554930fcde1786e8b493147839b5a41ee5d09c4bdbb3096d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page