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

# 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=12, type_pnt="Elastic", window_width=5)
analyser.add_point(position_center_window=37, type_pnt="Anti-Stokes", window_width=5)
analyser.add_point(position_center_window=236, type_pnt="Stokes", window_width=5)
analyser.add_point(position_center_window=259, type_pnt="Elastic", window_width=5)
analyser.add_point(position_center_window=282, type_pnt="Anti-Stokes", window_width=5)
analyser.add_point(position_center_window=466, type_pnt="Stokes", window_width=5)
analyser.add_point(position_center_window=488, type_pnt="Elastic", window_width=5)
analyser.add_point(position_center_window=509, type_pnt="Anti-Stokes", window_width=5)

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

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

# Saving the algorithm to a standalone JSON file
analyser.silent_save_algorithm(filepath = "algorithms/Analysis/VIPA spectrometer/Test.json", save_parameters=True)

# Extracting the PSD and frequency axis from the analyser object
frequency = analyser.x
PSD = analyser.y

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.0.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.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hdf5_bls_analyse-1.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 49848f9f900fcb37ae63c11498d9b54b4c5c8504c496402d60612008f2230762
MD5 0e30f078054aacc15c5816238e48dd83
BLAKE2b-256 120e54e753ef84cf4799c28838cf7441b082c7e4de820f3ac2ab6922f5d20edb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hdf5_bls_analyse-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b01152e44f3214e1ae1a72debf4a0c1dad5f4965216a0d7bc8e657a68240cbe5
MD5 a25cc10c661615c8d278eb05b8ce4287
BLAKE2b-256 f79f8ed407c850772bfcaddcc4f952c6975fdd62c1e5ca27255a01b2e7f07114

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