-------------------------------------------------------------------------------
--                                                                           --
--                          Experiment Source Code                           --
--              Delta NMR Experiment & Machine Control Interface             --
--                                                                           --
--                     Copyright (c) 2009 JEOL Ltd                           --
--                            All Rights Reserved                            --
--                                                                           --
-------------------------------------------------------------------------------
----By Rongchun Zhang, 2021/02/01;
----Modified, 2021/10/01
----Ref: Rongchun Zhang et al. J. Magn. Reson. 2016, 266, 59-66
-- HELP.eng: Cross Polarization
-- Category: solids, 1D standard, cpmas

header
    filename  		=> "cpnoe";
    sample_id 		=> "";
    comment   		=> "Cross Polarization with transient NOE";
    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_input      =>    512;
    x_points            =?    if x_points_input/x_sweep < 100 [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";
    tauNOE   => 0.5[s], help "transient NOE mixing time";
	include "cp_solid";

    obs_width_90   =>  3[us], help "90deg pulse width for X excitation pulse";
	obs_amp_prep  => 100[%], 0[%]->100[%]:0.01[%], help "amplitude of X excitation pulse";

	include "dec_solid";

    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	=	{ 90,270,90,270};
	obs_phs_prep    =    {90,270,270,90,180,0,0,180};
	irr_phs_cp		=	{ 0};
	irr_phs_dec	=	{ 0 };
	obs_phs_cp		=	{ 0,0,180,180,90,90,270,270};
						
	irr_phs_store = {90,270,90,270};
	obs_phs_store = {270,90,90,270,0,180,180,0};
	obs_phs_read  = {0,180,90,270};
	obs_phs_acq   =	{90, 270, 180,0};

	module_config		= "solid_sample";

begin
    initial_wait;
	relaxation_delay;
	
    align center
    irr_width_90, (irr.gate, irr.phs.irr_phs_prep, irr.amp.irr_amp_prep, irr.atn.irr_atn);
    obs_width_90, (obs.gate, obs.phs.obs_phs_prep, obs.amp.obs_amp_prep, obs.atn.obs_atn);
    end align;

	contact_time, (irr.gate, irr.phs.irr_phs_cp, irr.shape.{irr_shape_cp,"irr"}, irr.atn.irr_atn,
				   obs.gate, obs.phs.obs_phs_cp, obs.shape.{obs_shape_cp,"obs"}, obs.atn.obs_atn);

    align center
    irr_width_90, (irr.gate, irr.phs.irr_phs_store, irr.amp.irr_amp_prep, irr.atn.irr_atn);
    obs_width_90, (obs.gate, obs.phs.obs_phs_store, obs.amp.obs_amp_prep, obs.atn.obs_atn);
    end align;
     
	tauNOE;

	obs_width_90, (obs.gate, obs.phs.obs_phs_read, obs.amp.obs_amp_prep, obs.atn.obs_atn);

    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_acq );
	off (irr.gate);

end pulse;