/****************************************************************/
/*  au_prof1d_copyo1p1           13.06.2012                    */
/****************************************************************/
/*  Short Description :                                         */
/*  AU program for 1D data acquisition.                         */
/****************************************************************/
/*  Keywords :                                                  */
/*  zg,profiling,water suppression                              */
/****************************************************************/
/*  Description/Usage :                                         */
/*  Modification of Bruker AU au_prof1d to allow copy of        */
/*  optimized o1 and p1 from previous experiment using          */
/*  au_prof1d_calibo1p1 aquisition au													  */
/*  AU program for data acquisition with baselinefilter.        */
/*  The lockphase is optimized, water suppression offset and    */
/*  90-deg pulse are copied from exp 9888                   		*/
/****************************************************************/
/*  Author(s) :                                                 */
/*  Name            : Todd Rappe                                */
/*  Organisation    : University of Minnesota                   */
/*  Email           : rapp0006@umn.edu					                */
/****************************************************************/
/*  Name        Date    Modification:	                          */
/*  tmr         121226  renamed and calibo1p1 removed          	*/
/*  tmr			    120612	renamed and calibo1p1 and par copy added*/
/*  eub         070110  created                                 */
/*  rke         070716  save parameters                         */
/****************************************************************/
/*
$Id: au_prof1d_copyo1p1,v 1.0 2012/12/26 09:11:18 tmr Exp $
*/

// variables
int orig_expno, orig_procno;
double o1opt;
float p1opt, pldb1opt, rgopt;
orig_expno=expno;
orig_procno=procno;
char cmdtext[256];

GETCURDATA

// optimize lockphase
AUTOPHASE;

// change to experiment 9888 for calibrations
DATASET (name,9888,procno,disk,user)

// transfer optimized parameters to original experiment and
// execute getprosol with new values
FETCHPAR("O1", &o1opt);
FETCHPAR("P 1", &p1opt);
FETCHPAR("PLdB 1", &pldb1opt);
FETCHPAR("RG", &rgopt);

DATASET (name,orig_expno,orig_procno,disk,user);
STOREPAR("O1", o1opt);
STOREPAR("RG", rgopt);
sprintf(cmdtext, "getprosol 1H %f %f", p1opt, pldb1opt);
JAVACALL(cmdtext);

// run experiment
// RGA;
ZG;

QUIT
