Skip to content

laboratoiredebiophotonique/transient_grating_artifact_filter

Repository files navigation

Two-dimensional filtering in the Fourier domain of transient grating coherent artifacts in time-resolved spectroscopy

DOI Python 3.8 license Website

  • Removal of coherent artifacts is important in the analysis of time and wavelength resolved spectroscopy data. By taking advantage of the strong correlation between spectra acquired sequentially in time, artifact removal can be formulated as a 2D problem for improved effectiveness. This code implements a 2D method to remove transient grating coherent artifacts from femtosecond time-resolved spectroscopy data based on filtering in the Fourier domain, leading to better estimation of the material parameters from the measured data.
  • Algorithmic steps:
    • Separate the input image (time-resolved spectroscopy map) into "smooth" and "periodic" components (Moisan, 2010) to reduce the effect of the "cross" pattern at the center of the Discrete Fourier transform due to the non-periodic nature of the image.

    • Filter the artifact from the periodic component in the Fourier domain using an elliptically-shaped stop-band with a pass-band at the center to preserve the low-frequency content of the baseline data. Additional pass-band areas can be added to fine-tune the filtering (see Optional parameters below). The process to build the filter is described in detail in the Filter class declaration.

    • Recombine the filtered periodic component with the smooth component.

    • Apply a light gaussian low-pass filter to remove any remaining high frequency noise.

Transient Grating Artifact filter image

Reference: M. Vega, J.-F. Bryche, P.-L. Karsenti, P. Gogol, M. Canva, P.G. Charette. Two-dimensional filtering in the Fourier domain of transient grating coherent artifacts in time-resolved spectroscopy, Analytica Chimica Acta, 2023, 341820. https://doi.org/10.1016/j.aca.2023.341820

Usage:

transient_grating_artifact_filter(fname, lambda0_pump, artifact_extent_lambda, artifact_extent_t, threshold_ellipse_stop_band, threshold_center_pass_band)
  • Required parameters:

    • fname (str): Matlab or Excel format input file name in the data subdirectory containing the following data (see examples files in the data subdirectory):

      • Data: nt (rows) x (columns) spectroscopy measurements (arbitrary units)
      • Wavelength: wavelength samples (nm)
      • Time: nt time samples (ps)
      • NB: The script can accommodate non-uniformly sampled data in time and/or wavelength.
    • Artifact class object parameters (see class definition for details):

      • lambda0_pump (float): pump central wavelength (nm)
      • artifact_extent_t (float): artifact extent in time (ps)
      • artifact_extent_lambda (float): artifact extent in wavelength (nm)
    • Filter class object parameters (see class definition for details):

      • threshold_ellipse_stop_band (float): threshold for filter elliptical stop band pixel identification and segmentation ([0..1])
      • threshold_center_pass_band (float): threshold for filter central pass-band pixel identification and segmentation ([0..1])
      • NB: threshold_center_pass_band > threshold_ellipse_stop_band
  • Optional parameters:

    • upper_left_lower_right_quadrant_pass_band (bool): enable/disable filter pass-band areas for upper-left and lower-right quadrants of the Fourier plane, excluding the horizontal and vertical axes (default = True).
    • cross_pass_band_width (int): width of a an additional cross-shaped pass-band in the filter along the central horizontal and vertical axes of the Fourier plane to pass (i.e. not filter) any remaining non-periodic content left over from the smooth/periodic decomposition (default = 0, i.e. no cross pass-band).
    • gaussian_blur_sigma (float): standard deviation of the gaussian blur used for the final low-pass filtering (default = 3.0).
    • lambda_time_profile (float): Wavelength at which the time line-profile is plotted (nm, if 0 default to lambda0_pump).
  • Output: Plot displays and files written to the output subdirectory (created automatically if it doesn't exist)

  • Debugging/tuning:

    • The threshold_ellipse_stop_band and threshold_center_pass_band parameters must be adjusted to reach the optimal compromise between removing the artifact and preserving the underlying baseline spectroscopy data.
    • The script draws a cross-hair pattern based on the artifact_extent_t and artifact_extent_lambda parameters over the elliptical portion of the filter mask identified with threshold_ellipse_stop_band. The artifact_extent_t and artifact_extent_lambda parameters can be fine-tuned to line up the cross-hair with the ellipse axes to compensate for uncertainties in these parameters.

Examples: run the transient_grating_artifact_filter_exec.py script or the transient_grating_artifact_filter_exec.ipynb notebook.

Installation

  • Checkout the repository
git clone https://github.com/laboratoiredebiophotonique/transient_grating_artifact_filter.git
  • Install all prerequisite modules
pip install -r requirements.txt
  • The moisan2011 package is required, it can either be installed automatically as above via requirements.txt or manually from GitHub.

About

Two-dimensional filtering in the Fourier domain of transient grating coherent artifacts in time-resolved spectroscopy

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors