/*
au_make_shim.icon

Usage:                      
Use a 90:10 H2O:D2O sample
Equilibrates the sample then runs 3d shim and save a file to shim.icon and shim.todays_date

*/

#include <stdio.h>
#include <time.h>

   time_t rawtime;
   struct tm *info;
   char buffer[80];
   time( &rawtime );
   info = localtime( &rawtime );
   strftime(buffer,80,"wsh shim.%Y%m%d", info);


/* equilibration time (seconds)        */
#define EQUILIBTIME 300

/* Set your desired shimming and acquisition options here      */
/* (a COMMAND can be left blank if not needed), e.g.     */
#define COMMAND1 ATMA      
#define COMMAND2 XCMD("topshim tuneb tunea")
#define COMMAND3 XCMD("topshim 3d") 
#define COMMAND4 XCMD(buffer)  
#define COMMAND5 XCMD("wsh shim.icon") 
#define COMMAND6 RGA
#define COMMAND7 ZG

/* Start of AU program */
GETCURDATA

/*Wait 5 minutes for sample to equilibrate in instrument*/

i1 = ssleep (EQUILIBTIME);

COMMAND1
COMMAND2
COMMAND3
COMMAND4
COMMAND5
COMMAND6
COMMAND7

QUIT