/******* -*-C++-*- **********************************************/ /* fidadd 01.11.1997 */ /****************************************************************/ /* Short Description : */ /* AU program to add up FID's in incremented expno's */ /****************************************************************/ /* Keywords : */ /* add fid */ /****************************************************************/ /* Description/Usage : */ /* AU program to add up FID's in incremented expno's e.g. */ /* from "multizg"-run. The AU program can be started on */ /* any dataset, the first expno should be entered when */ /* prompted for (!) The highest expno, which is created */ /* by this program contains the result from the addition. */ /* The total number of scans is updated in the result. */ /****************************************************************/ /* Author(s) : */ /* Name : Stefan Steuernagel */ /* Organisation : Bruker BioSpin GmbH */ /* Email : stefan.steuernagel@bruker.de */ /****************************************************************/ /* Name Date Modification: */ /* ste 971101 created */ /* ge 20071206 new data path */ /****************************************************************/ /* Modified by Maria Masik (KBFI, TLÜ). */ /* Modified lines: 31, 48-53, 62, 76, 82-84, 95. */ /* Purpose: loops through consecutive expnos and summates */ /* them incrementally (1+2, 1+2+3, 1+2+3+4, etc.) by a */ /* specified number of times. The original prompt asked */ /* how many FIDs to add up; this prompt is now used for */ /* how FIDs the final summation should contain; the number */ /* of summation loops is this value-1. */ /****************************************************************/ /* $Id: fidadd,v 1.8 2008/01/21 11:22:50 wem Exp $ */ int oexpno, newexpno, scans, totscans=0, origexpno, origoexpno; #include oexpno = expno; while (access(ACQUPATH("fid"), F_OK) == 0) expno++; i1 = expno - oexpno; if (i1 < 2) STOPMSG("At least 2 FIDs required.") GETINT("Enter number of FIDs:", i1); if (i1 < 2) STOPMSG("At least 2 FIDs required.") int i; origexpno = expno; origoexpno = oexpno; for (i = 1; i < i1; i++) { while (access(ACQUPATH(0), F_OK) == 0) expno++; newexpno = expno; expno = oexpno; WRA(newexpno) ERRORABORT TIMES(i) SETCURDATA FETCHPARS("NS", &scans) totscans += scans; IEXPNO END DATASET(name, newexpno, procno, disk, user) DATASET2(name, newexpno, procno, disk, user) STOREPAR("DC", 1.0) STOREPARS("NS", totscans) STOREPAR("TI", "result of fidadd") STOREPARS("TI", "result of fidadd") TIMES(i) DATASET3(name, ++oexpno, procno, disk, user) ADDFID ERRORABORT END oexpno = origoexpno; expno = origexpno; } VIEWDATA Proc_err(DEF_ERR_OPT, "--- FIDs incrementally summated %d times ---", i-1); QUIT