Warning: Trying to access array offset on value of type null in /home/site/wwwroot/lib/plugins/move/action/rename.php on line 42

Warning: Cannot modify header information - headers already sent by (output started at /home/site/wwwroot/lib/plugins/move/action/rename.php:42) in /home/site/wwwroot/inc/actions.php on line 38
insert_peak [topas wiki]

User Tools

Site Tools


insert_peak

This is an old revision of the document!


Insert_Peak

A single line macro to add a peak to a Rietveld fit. There are lots of different ways of doing this. The second macro uses fit_obj to plot the peak in the gui.

Insert_Peak(twotheta, 20, lor, 0.1, fwhm, 0.15, int, 100)

''Description: add single peak to e.g. rietveld fit
''Description: Insert_Peak(twotheta, 20, lor, 0.1, fwhm, 0.15, int, 100)
''Why: simple one line makes things easier
''Contributed by: John Evans
 
macro Insert_Peak(p1,v1,p2,v2,p3,v3,p4,v4) {
#m_argu p1 ''2theta
#m_argu p2 ''lor
#m_argu p3 ''fwhm
#m_argu p4 ''int
If_Prm_Eqn_Rpt(p1, v1, min =0.9*v1; max =1.1*v1;)
If_Prm_Eqn_Rpt(p2, v2, min .000000000001 max 1)
If_Prm_Eqn_Rpt(p3, v3, min .000000000001 max 1)
If_Prm_Eqn_Rpt(p4, v4, min .000000000001 max 1e9)
xo_Is xo =CeV(p1,v1);  peak_type pv pv_lor =CeV(p2,v2);  pv_fwhm =CeV(p3,v3); I =CeV(p4,v4);
}

Insert_Peak_Plot(peak_name,twotheta, 20, lor, 0.1, fwhm, 0.15, int, 100)

'Insert a peak in  data using fit_obj to plot 
	macro Insert_Peak_Plot(v0,p1,v1,p2,v2,p3,v3,p4,v4) {
	#m_argu p1 '2theta
	#m_argu p2 'lor
	#m_argu p3 'fwhm
	#m_argu p4 'int
	If_Prm_Eqn_Rpt(p1, v1, min =0.9*v1; max =1.1*v1;)
	If_Prm_Eqn_Rpt(p2, v2, min .000000000001 max 1)
	If_Prm_Eqn_Rpt(p3, v3, min .000000000001 max 1)
	If_Prm_Eqn_Rpt(p4, v4, min .000000000001 max 1e9)
	fit_obj =  CeV(p4,v4) * ( CeV(p2,v2) * Lorentzian(CeV(p1,v1),CeV(p3,v3)) + (1 - CeV(p2,v2)) *  Gauss(CeV(p1,v1),CeV(p3,v3)) );
	dummy_str space_group P1 phase_name v0
	}
insert_peak.1749108369.txt.gz · Last modified: 2025/06/05 07:26 by johnsoevans