-------------------------------------------------------------------------------
--                                                                           --
--                          Experiment Source Code                           --
--              Delta NMR Experiment & Machine Control Interface             --
--                                                                           --
--                     Copyright (c) 2000 JEOL Ltd                           --
--                            All Rights Reserved                            --
--                                                                           --
-------------------------------------------------------------------------------
-- HELP.eng: spin echo
-- Category: solids, spin echo, solids relaxation

header
	filename        => "RNTQ_3D";
	sample_id       => "";
	comment         => "RNTQ_2D";
    process   		=  "1d_solid.list";
	include "header_solid";
end header;

instrument
	include "instrument_solid";
end instrument;

acquisition
	x_domain		=>	"Proton";
	x_offset		=>	5[ppm];
	x_sweep			=>	100[kHz];
	x_points		=>	1024;
	scans			=>	16;
	x_prescans		=>	0;
	mod_return		=>	1;

    y_domain         =  x_domain;
    y_offset         =  x_offset * 3;
    y_sweep          => x_sweep;
    y_dwell          =? 1/y_sweep;
    y_points         => 16;

    z_domain         =  x_domain;
    z_offset         =  x_offset * 2;
    z_sweep          => x_sweep;
    z_dwell          =? 1/z_sweep;
    z_points         => 16;

    include "acquisition_solid";
    include "acquisition_2d";
end acquisition;

pulse
	collect COMPLEX,OBS COMPLEX COMPLEX;
	initial_wait		=	10.0[ms];

Pulse_Setup	=? "-----------Setup hard pulses-----------";

	obs_width_90		=>	x90,										help "90deg pulse width";
	obs_width_2q		=>	x90,										help "90deg pulse width";
	obs_amp_pulse		=>	100[%];

RN_Setup	=? "-----------Setup RN pulses-----------";
	spinning_freq		=> 100 [kHz];
	number_large_N		=>	12;
	number_n		=>	2;
	number_nu		=>	5;
	number_RN		=>	1;
	obs_amp_RN		=>	0[%];
	obs_phs_RN_p		=	180*number_nu/number_large_N;
	obs_phs_RN_m		=	-obs_phs_RN_p;
	obs_width_RN		=	(number_n/spinning_freq)/number_large_N;
	supercycle			=>	"S0", ("S0","S0Sinv");
	recoupling			=?	if supercycle = "S0" then number_RN*number_n/spinning_freq
					else	if supercycle = "S0Sinv" then 2*number_RN*number_n/spinning_freq
					else 0[us];

	z_filter		=>	100[us];

MISC_Setup	=? "-----------Setup Miscellaneous-----------";

	relaxation_delay	=>	5.0[s],										help "inter-pulse delay";
	repetition_time		=?	relaxation_delay + x_acq_time,				help "relaxation_delay+x_acq_time";
	

	obs_atn				=>	xatn,										help "attenuator for x pulse";

--------------------------------------------
--found: COG 16 (15,1,0; 8)
--selected pathways: 2
--#0:
--nuc 1: 0 -3 2 0 
--#1:
--nuc 1: 0 3 -2 0 
--------------------------------------------

	obs_phs_exc		=	{  0..15*15*360/16:15*360/16,  30..(30+15*15*360/16):15*360/16,
						   0..15*15*360/16:15*360/16,  30..(30+15*15*360/16):15*360/16}.ystep(60%2);

	obs_phs_exc2q	=	{  0..15*1*360/16:1*360/16,  0..15*1*360/16:1*360/16,
						   18..(18+15*1*360/16):1*360/16,  18..(18+15*1*360/16):1*360/16}.zstep(36%2);
	obs_phs_rec2q	=	{  0};
	obs_phs_rec		=	{  0};

	obs_phs_restore	=	{16(  0),16(120),16(240)};
	obs_phs_acq		=	{8(  0,180),8(120,300),8(240, 60)}.ystep(180%2).zstep(180%2);

	include "pulse_solid";
	module_config		=	"solid_sample";

begin
	initial_wait;
		relaxation_delay;
	

loop number_RN times
loop number_large_N/2 times
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_p+obs_phs_exc),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_m+obs_phs_exc),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
end loop;
when supercycle = "S0Sinv" do
loop number_large_N/2 times
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_m+obs_phs_exc),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_p+obs_phs_exc),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
end loop;
end when;
end loop;

loop number_RN times
loop number_large_N/2 times
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_p+obs_phs_exc+120),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_m+obs_phs_exc+120),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
end loop;
when supercycle = "S0Sinv" do
loop number_large_N/2 times
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_m+obs_phs_exc-120),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_p+obs_phs_exc-120),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
end loop;
end when;
end loop;

loop number_RN times
loop number_large_N/2 times
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_p+obs_phs_exc+240),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_m+obs_phs_exc+240),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
end loop;
when supercycle = "S0Sinv" do
loop number_large_N/2 times
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_m+obs_phs_exc-240),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_p+obs_phs_exc-240),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
end loop;
end when;
end loop;

	0[us] ystep 1/y_sweep;

	obs_width_2q,	(obs.gate, obs.phs.obs_phs_exc2q, obs.amp.obs_amp_pulse, obs.atn.obs_atn);

	0[us] zstep 1/z_sweep;

	obs_width_2q,	(obs.gate, obs.phs.obs_phs_rec2q, obs.amp.obs_amp_pulse, obs.atn.obs_atn);

loop number_RN times
loop number_large_N/2 times
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_p+obs_phs_rec),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_m+obs_phs_rec),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
end loop;
when supercycle = "S0Sinv" do
loop number_large_N/2 times
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_m+obs_phs_rec),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_p+obs_phs_rec),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
end loop;
end when;
end loop;

loop number_RN times
loop number_large_N/2 times
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_p+obs_phs_rec+120),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_m+obs_phs_rec+120),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
end loop;
when supercycle = "S0Sinv" do
loop number_large_N/2 times
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_m+obs_phs_rec+120),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_p+obs_phs_rec+120),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
end loop;
end when;
end loop;

loop number_RN times
loop number_large_N/2 times
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_p+obs_phs_rec+240),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_m+obs_phs_rec+240),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
end loop;
when supercycle = "S0Sinv" do
loop number_large_N/2 times
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_m+obs_phs_rec+240),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
	obs_width_RN,	(obs.gate,	obs.phs.(obs_phs_RN_p+obs_phs_rec+240),	obs.amp.obs_amp_RN,	obs.atn.obs_atn);
end loop;
end when;
end loop;

	z_filter;

	obs_width_90,		(obs.gate,	obs.phs.obs_phs_restore,		obs.amp.obs_amp_pulse,	obs.atn.obs_atn);
	acq( dead_time, delay, obs_phs_acq );
end pulse;