EasySpin icon indicating copy to clipboard operation
EasySpin copied to clipboard

potential bug in the levelplot function call related to the line type.

Open cerium1925 opened this issue 1 year ago • 0 comments

When using levelplot to draw an energy level diagram, the Sys.lw parameter works correctly for Gaussian and Lorentzian line shapes. For example, testing with Sys.lw = [1 0] or Sys.lw = [0 1] produces the expected results. However, when setting Sys.lw = [1 1] for a Voigt line shape, an error occurs. The error is specifically related to the Lorentzian line shape function.

Theoretically, the line shape support in levelplot should be similar to other functions, where Gaussian, Lorentzian, and Voigt line shapes are all supported. The error encountered raises the question of whether the issue is due to an error in calling the Voigt line shape function, or if the original design of the levelplot function was only intended to support Gaussian and Lorentzian line shapes.

potential solutions to address the issue?

  1. Check Function Design: Review the levelplot function documentation or implementation to verify if it was designed to support the Voigt line shape. If not, this could explain the error.

  2. Error in Voigt Function Call: If levelplot was indeed intended to support the Voigt line shape, the error might stem from how the Voigt line shape function is being called or integrated within levelplot. This would require debugging the specific section of the code where the line shapes are handled. 1 2 tset code:clc, clear, clf;

% Experimental parameter---------- Exp.mwFreq = 9.8; Exp.Range = [320 380]; Exp.nPoints = 1e4;

Exp.MolFrame = [0 0 0]*pi./180; % Exp.SampleFrame = [0 -pi/2 0]; % x % % % Exp.SampleFrame = [0 -pi/2 -pi/2]; % y Exp.SampleFrame = [0 0 0]; % z

% Exp.CrystalSymmetry = 167; % R-3c Exp.Harmonic = 1;

Opt.Verbosity = 2;

Sys.S = 1/2; Sys.g = gfree; Sys.Nucs = '14N'; Sys.A = 50; Sys.lw = [1 0];

subplot(2,2,1); [b,spc,trans] = pepper(Sys,Exp,Opt); spc = normalize(spc,'range',[0 1]); plot(b,spc,'linewidth',1);
axis tight; xlabel('Magnetic field (mT)');

subplot(2,2,2); Ori = 'x'; Opt.SlopeColor = true; % Opt.StickSpectrum = true; levelsplot(Sys,Ori,Exp.Range,Exp.mwFreq,Opt);

subplot(2,2,3); Ori = 'y'; Opt.SlopeColor = true; % Opt.StickSpectrum = true; levelsplot(Sys,Ori,Exp.Range,Exp.mwFreq,Opt);

subplot(2,2,4); Ori = 'z'; Opt.SlopeColor = true; % Opt.StickSpectrum = true; levelsplot(Sys,Ori,Exp.Range,Exp.mwFreq,Opt);

cerium1925 avatar Aug 20 '24 06:08 cerium1925