-------------------------------------------------------------------------------
--                                                                           --
--                          Experiment Source Code                           --
--              Delta NMR Experiment & Machine Control Interface             --
--                                                                           --
--                     Copyright (c) 2009 JEOL Ltd                           --
--                            All Rights Reserved                            --
--                                                                           --
-------------------------------------------------------------------------------
-- HELP.eng: Cross Polarization
-- Category: solids, 1D standard, cpmas
-- By Rongchun Zhang, 2022/02/21
header
    filename  		=> "cpmas-rinept";
    sample_id 		=> "";
    comment   		=> "Cross Polarization with RINEPT";
    process   		=  "1d_solid.list";
    include "header_solid";
end header;

instrument
    include "instrument_solid";
end instrument;

acquisition
	x_domain			=>	"Carbon13";
	x_offset			=>	100[ppm];
	x_sweep			=>	400[ppm];
----	x_points			=>	2048;
     x_points_input       =>    1024;
     x_points             =?    if x_points_input/x_sweep < 51 [ms] then x_points_input else 2;
	scans				=>	4;
	x_prescans			=>	0;
	mod_return			=>	1;
	include "acquisition_solid";
end acquisition;

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

	irr_Setup			=? "#Setup Irradiation#";
	irr_domain			=>	"Proton",									help "decoupled nucleus";
	irr_offset			=>	5[ppm],										help "decoupler offset";

--	include "cp_solid";

	include "dec_solid";
  --   irr_amp_cwdec  => 80[%],0[%]->100[%]:0.05[%];


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

        obs_width_90	=> x90;
        obs_width_180	=> x90*2;
        obs_amp_pulse	=> 100[%];

	irr_width_90	=> irr90;
	irr_width_180	=> irr_width_90*2;
	irr_amp_pulse	=> 100[%];

RINEPT_setup		=? "#Setup RINEPT Times#";
    tau1 => 1[ms];
    tau2 => 1[ms];
    recycle_Setup		=? "#Setup Recycle Times#";
	relaxation_delay	=>	5.0[s],										help "relaxation delay";
	repetition_time		=?	relaxation_delay + x_acq_time,				help"relaxation_delay+x_acq_time";

    atn_Setup           =? "#Experiment Attenuator Settings#";
	obs_atn				=>	xatn,										help "attenuator for obs";
	irr_atn				=>	irratn,										help "attenuator for irr";

	irr_phs_prep	=	{ 8(0), 8(180)};
	
	irr_phs_dec	=	{ 270};

     irr_phs_180_1     ={0,180,0,180};
     irr_phs_180_2     ={0,180,0,180};
     irr_phs_90        ={90,90,270,270};
     obs_phs_180_1     ={0,180,0,180};
     obs_phs_180_2     ={0,180,0,180,90,270,90,270};
     obs_phs_90        ={4(0),4(90),4(180),4(270)};
   
     obs_phs_acq2 =  {0,0,180,180,90,90,270,270};

	module_config		= "solid_sample ";

begin
    initial_wait;
	relaxation_delay;


	irr_width_90,	(irr.gate,	irr.phs.irr_phs_prep,	irr.amp.irr_amp_pulse,	irr.atn.irr_atn);
tau1;

align center
	obs_width_180,	(obs.gate,	obs.phs.obs_phs_180_1,	obs.amp.obs_amp_pulse,	obs.atn.obs_atn);
	irr_width_180,	(irr.gate,	irr.phs.irr_phs_180_1,	irr.amp.irr_amp_pulse,	irr.atn.irr_atn);
end align;

tau1;

align center
	obs_width_90,	(obs.gate,	obs.phs.obs_phs_90,	obs.amp.obs_amp_pulse,	obs.atn.obs_atn);
	irr_width_90,	(irr.gate,	irr.phs.irr_phs_90,	irr.amp.irr_amp_pulse,	irr.atn.irr_atn);
end align;

tau2;

align center
	obs_width_180,	(obs.gate,	obs.phs.obs_phs_180_2,	obs.amp.obs_amp_pulse,	obs.atn.obs_atn);
	irr_width_180,	(irr.gate,	irr.phs.irr_phs_180_2,	irr.amp.irr_amp_pulse,	irr.atn.irr_atn);
end align;

	tau2;

	on(irr.GATE, irr.PHS.irr_phs_dec, irr.AMP.irr_amp_dec, irr.ATN.irr_atn, irr.NOISE.irr_noise);
	acq( dead_time, delay, obs_phs_acq2 );
	off(irr.GATE, irr.PHS.irr_phs_dec, irr.AMP.irr_amp_dec, irr.ATN.irr_atn, irr.NOISE.irr_noise);


end pulse;