/* hcchcosy.c */ #include #include extern int dps_flag; static double d2_init = 0.0, d3_init = 0.0; static int phi1[2] = {0,2}, phi2[4] = {0,0,2,2}, phi3[16] = {0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3}, phi4[2] = {0,2}, phi5[1] = {0}, rec[8] = {0,2,2,0,2,0,0,2}; pulsesequence() { /* DECLARE AND LOAD VARIABLES */ char f1180[MAXSTR], /* Flag to start t1 @ halfdwell */ f2180[MAXSTR]; /* Flag to start t2 @ halfdwell */ char satmode[MAXSTR]; int t1_counter, /* used for states tppi in t1 */ t2_counter; /* used for states tppi in t2 */ double tau1, /* t1 delay */ tau2, /* t2 delay */ TC = getval("TC"), /* 3.5 ms */ taua = getval("taua"),/* time delays for CH coupling evolution */ taub = getval("taub"), tauc = getval("tauc"), pwClvl = getval("pwClvl"), /* coarse power for C13 pulse */ pwC = getval("pwC"), /* C13 90 degree pulse length at pwClvl */ /* the following pulse length for the SLP pulse is automatically calculated by the macro "hcch_cosy". The SLP pulse shape,"offC10" is called directly from your shapelib. */ pwC10 = getval("pwC10"),/* 180 degree selective sinc pulse on CO(174ppm) */ rf7, /* fine power for the pwC10 ("offC10") pulse */ compC = getval("compC"), /* adjustment for C13 amplifier compression */ pwmax, pwNlvl = getval("pwNlvl"), /* power for N15 pulses */ pwN = getval("pwN"), /* N15 90 degree pulse length at pwNlvl */ sw1 = getval("sw1"), sw2 = getval("sw2"), gt1 = getval("gt1"), gt2 = getval("gt2"), gt3 = getval("gt3"), gzlvl1 = getval("gzlvl1"), gzlvl2 = getval("gzlvl2"), gzlvl3 = getval("gzlvl3"); double pwH,tpwr1, compH = getval("compH"); double satdly= getval("satdly"), satpwr= getval("satpwr"), satfrq= getval("satfrq"); getstr("f1180",f1180); getstr("f2180",f2180); getstr("satmode",satmode); pwH = 3.0*pw; tpwr1 = tpwr - 20.0*log10(pwH/(compH*pw)); tpwr1 = (int) (tpwr1 + 0.5); /* INITIALIZE VARIABLES */ if( dpwrf < 4095 ) { printf("reset dpwrf=4095 and recalibrate C13 90 degree pulse"); abort(1); } if( pwC > (24.0e-6*600.0/sfrq) ) { printf("Increase pwClvl so that pwC < 24*600/sfrq"); abort(1); } /* offC10_sk: 180 sinc pulse on CO from 135ppm off */ rf7 = (compC*4095.0*pwC*2.0*1.65)/pwC10; rf7 = (int) (rf7 + 0.5); if((dm3[A] == 'y' || dm3[C] == 'y' )) { printf("incorrect dec1 decoupler flags! Should be 'nyn' or 'nnn' "); abort(1); } getstr("f1180",f1180); getstr("f2180",f2180); pwmax = 2.0*pwN; if (pwC10 > pwmax) pwmax = pwC10; /* check validity of parameter range */ if((dm[A] == 'y' || dm[B] == 'y' )) { printf("incorrect Dec1 decoupler flags! "); abort(1); } if((dm2[A] == 'y' || dm2[B] == 'y')) { printf("incorrect Dec2 decoupler flags! "); abort(1); } if( dpwr > 50 ) { printf("don't fry the probe, dpwr too large! "); abort(1); } if( dpwr2 > 50 ) { printf("don't fry the probe, dpwr2 too large! "); abort(1); } /* LOAD VARIABLES */ settable(t1, 2, phi1); settable(t2, 4, phi2); settable(t3, 16, phi3); settable(t4, 2, phi4); settable(t5, 1, phi5); settable(t11,8, rec); /* INITIALIZE VARIABLES */ /* Phase incrementation for hypercomplex data */ if ( phase1 == 2 ) /* Hypercomplex in t1 */ { tsadd(t1,1,4); } if ( phase2 == 2 ) {tsadd(t5,1,4);} /* calculate modification to phases based on current t1 values to achieve States-TPPI acquisition */ if(ix == 1) d2_init = d2; t1_counter = (int)((d2-d2_init)*sw1 + 0.5); if(t1_counter % 2) { tsadd(t1,2,4); tsadd(t11,2,4); } /* calculate modification to phases based on current t2 values to achieve States-TPPI acquisition */ if(ix == 1) d3_init = d3; t2_counter = (int)((d3-d3_init)*sw2 + 0.5); if(t2_counter % 2) { tsadd(t5,2,4); tsadd(t11,2,4); } /* set up so that get (-90,180) phase corrects in F1 if f1180 flag is y */ tau1 = d2; if(f1180[A] == 'y') { tau1 += (1.0/(2.0*sw1)); } if (tau1 < 1.0e-6) tau1 = 0.0; tau1 = tau1/2.0; /* set up so that get (-90,180) phase corrects in F2 if f2180 flag is y */ tau2 = d3; if(f2180[A] == 'y') { tau2 += (1.0/(2.0*sw2)); } if (tau2 < 1.0e-6) tau2 = 0.0; tau2 = tau2/2.0; initval(7.0, v1); obsstepsize (45.0); /* BEGIN ACTUAL PULSE SEQUENCE */ status(A); rcvroff(); if(satmode[A]=='y'){ obsoffset(satfrq); obspower(satpwr); delay(d1 - satdly); rgpulse(satdly,zero,0.0,0.0); }else{ delay(d1); } obsoffset(tof); obspower(tpwr); decpower(pwClvl); decpwrf(4095.0); dec2power(pwNlvl); decphase(zero); dec2phase(zero); delay(10.0e-6); status(B); rgpulse(pw, t1, 1.0e-4, 0.0); delay(taua - 2.0*pwC ); delay(tau1); decrgpulse(2.0*pwC, zero, 0.0, 0.0); delay(tau1); rgpulse(2.0*pw, zero, 0.0, 0.0); delay(taua ); rgpulse(pw, one, 0.0, 2.0e-6); zgradpulse(gzlvl1,gt1); delay(100.0e-6); decrgpulse(pwC, t2, 2.0e-6, 0.0); decpwrf(rf7); sim3shaped_pulse("","offC10_sk","",0.0, pwC10,2.0*pwN,zero,zero, zero, 0.0,0.0); delay(taub - pwmax ); obspower(tpwr1); /* POWER_DELAY */ obsprgon("waltz16", pwH, 90.0); /* PRG_START_DELAY */ xmtron(); decpwrf(4095.0); delay(TC - taub ); decrgpulse(2.0*pwC, t3, 0.0, 0.0); delay(TC ); decrgpulse(pwC, t4, 0.0, 0.0); delay(tauc -tau2); decrgpulse(2.0*pwC, zero, 0.0, 0.0); decpwrf(rf7); if(tau2 > taub){ delay(tauc - pwmax ); sim3shaped_pulse("","offC10_sk","",0.0, pwC10,2.0*pwN,zero,zero, zero, 0.0,0.0); delay(tau2 - taub - PRG_STOP_DELAY); xmtroff(); obsprgoff(); /* PRG_STOP_DELAY */ obspower(tpwr); /* POWER_DELAY */ delay(taub) ; }else if(tau2 > (taub - pwmax)){ delay(tauc + tau2 - taub - PRG_STOP_DELAY); xmtroff(); obsprgoff(); /* PRG_STOP_DELAY */ obspower(tpwr); /* POWER_DELAY */ sim3shaped_pulse("","offC10_sk","",0.0, pwC10,2.0*pwN,zero,zero, zero, 0.0,0.0); delay(taub - pwmax) ; }else{ delay(tauc + tau2 - taub - PRG_STOP_DELAY); xmtroff(); obsprgoff(); /* PRG_STOP_DELAY */ obspower(tpwr); /* POWER_DELAY */ delay(taub -tau2- pwmax) ; sim3shaped_pulse("","offC10_sk","",0.0, pwC10,2.0*pwN,zero,zero, zero, 0.0,0.0); delay(tau2) ; } decpwrf(4095.0); decrgpulse(pwC, t5, 0.0, 2.0e-6); zgradpulse(gzlvl2,gt2); delay(100.0e-6); rgpulse(pw, zero, 0.0, 2.0e-6); delay(taua - gt3 -100.0e-6); zgradpulse(gzlvl3,gt3); delay(100.0e-6); simpulse(2.0*pw, 2.0*pwC, zero, zero, 0.0, 2.0e-6); delay(taua - gt3 -100.0e-6); zgradpulse(gzlvl3,gt3); delay(100.0e-6); decpower(dpwr); rgpulse(pw, zero, 0.0, 0.0); status(C); rcvron(); setreceiver(t11); }