Commit 335125a6 authored by Vesa Oikonen's avatar Vesa Oikonen
Browse files

tries to set result units

parent 2299a7f1
......@@ -122,6 +122,26 @@ int main(int argc, char **argv)
printf("tacNr := %d\n", par.tacNr);
}
/* Try to get data units */
int cunit=UNIT_UNKNOWN, tunit=UNIT_UNKNOWN;
{
int i;
i=iftFindKey(&par.h, "unit", 0);
if(i<0) i=iftFindKey(&par.h, "calibration_unit", 0);
if(i>=0) cunit=unitIdentify(par.h.item[i].value);
i=iftFindKey(&par.h, "timeunit", 0);
if(i<0) i=iftFindKey(&par.h, "time_unit", 0);
if(i>=0) tunit=unitIdentify(par.h.item[i].value);
//if(!unitIsTime(tunit)) tunit=UNIT_UNKNOWN;
}
if(verbose>2) {
printf("time_unit := %s\n", unitName(tunit));
printf("calibration_unit := %s\n", unitName(cunit));
}
/*
* Allocate place for AUCs
......@@ -136,8 +156,22 @@ int main(int argc, char **argv)
auc.format=PAR_FORMAT_UNKNOWN;
if(aucfile[0]) auc.format=parFormatFromExtension(aucfile);
if(auc.format==PAR_FORMAT_UNKNOWN) auc.format=PAR_FORMAT_TSV_UK;
/* Set parameter name */
/* Set header contents */
iftPut(&auc.h, "datafile", parfile, 0, NULL);
{
char buf[256];
time_t t=time(NULL);
iftPut(&auc.h, "analysis_time", ctime_r_int(&t, buf), 0, NULL);
tpcProgramName(argv[0], 1, 1, buf, 256);
iftPut(&auc.h, "program", buf, 0, NULL);
}
/* Set parameter name and unit */
strcpy(auc.n[0].name, "AUC");
if(unitIsTime(tunit)) {
int aucunit=unitMultiply(cunit, tunit);
if(verbose>2) printf("auc_unit := %s\n", unitName(aucunit));
auc.n[0].unit=aucunit;
}
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment