-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpolarizationAnalysis.c
More file actions
45 lines (40 loc) · 1.41 KB
/
polarizationAnalysis.c
File metadata and controls
45 lines (40 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Program to record polarization.
RasPi connected to USB 1208LS.
Target energy: USB1208LS Analog out Ch1 controls HP3617A. See pg 31 my lab book
PMT Counts: data received from CTR in USB1208
*/
#include "fileTools.h"
#include "polarizationAnalysisTools.h"
#ifndef DEFINITIONS_H
#define DEFINITIONS_H
#include "mathTools.h"
#endif
int main (int argc, char **argv)
{
char analysisFileName[1024],backgroundFileName[1024],rawDataFileName[1024];
char* extensionStart;
int normalizeWithCurrent;
// Get parameters.
if (argc==3){
strcpy(rawDataFileName,argv[1]);
strcpy(analysisFileName,argv[1]);
normalizeWithCurrent=atoi(argv[2]);
strcpy(backgroundFileName,"NONE");
} else if(argc==4){
strcpy(backgroundFileName,argv[1]);
strcpy(rawDataFileName,argv[2]);
strcpy(analysisFileName,argv[2]);
normalizeWithCurrent=atoi(argv[3]);
}else {
printf("You put in %d argument(s) \n",argc);
printf("There are two options for using this program: \n\n");
printf("usage '~$ ./polarizationAnalysis <data file> <normalize with current (0=no, 1=yes)>'\n");
printf("usage '~$ ./polarizationAnalysis <background file> <data file> <normalize with current (0=no, 1=yes)>\n");
return 1;
}
extensionStart=strstr(analysisFileName,".dat");
strcpy(extensionStart,"analysis.dat");
processFileWithBackground(analysisFileName, backgroundFileName, rawDataFileName, DATAPOINTSPERREV, 1, normalizeWithCurrent);
return 0;
}