#pragma rtGlobals=1 // Use modern global access method. // this is version 3.0? of the code for the DLL from K. Krycka // 18 MAY 2011 // // ocnverted to Igor, SRK // // // this is one monolithic program to gather the inputs and then do the corrections // // -- some changes here -- // // (1) data here is assumed to be RAW data, not partially corrected ASCII // // look for HARD WIRED VALUES, and eventually get rid of these // Function PolCorr_main() Variable Monitor_Normalization = 1.0e+08 Variable Max_Data_Multiplicity = 5 Variable Cells = 3 Variable Number_Cells = Cells Variable Orientation = 4 Variable Q_PixelsX = 128 Variable Q_PixelsY = 128 // Variable lenFile = 100 // String File_PP1,File_PP2,File_PP3,File_PP4,File_PP5 // String File_MP1,File_MP2,File_MP3,File_MP4,File_MP5 // String File_MM1,File_MM2,File_MM3,File_MM4,File_MM5 // String File_PM1,File_PM2,File_PM3,File_PM4,File_PM5 // String File_PPout,File_MPout,File_MMout,File_PMout // these differed only in the capitialzation of out -> Out, which is not recognized in Igor // but were apparently never used //String File_PP_Out,File_MP_Out,File_MM_Out,File_PM_Out Variable input String holder Variable counter, counter2 Variable start_day, start_month, start_year Variable helium_day, helium_month, helium_year Variable data_day, data_month, data_year Make/O/D/N=(Cells) He_Pol_Measure_Time, gamm, Te, onl, Initial_He_Pol Make/O/D/N=(Orientation) Number_Files //PP, MP, MM, PM Make/O/T/N=(Orientation, Max_Data_Multiplicity) Data_Files Make/O/T/N=(Orientation) Out_Files Make/O/D/N=(Orientation,Max_Data_Multiplicity) Helium_Cell Variable Polarization_SuperMirror, P_M //polarization of supermirror Variable Polarization_Flipper, P_F //polarization of flipper = 2*efficiency - 1 Variable YesNo String ch Make/O/T/N=(4) sub_holder Variable ori Variable mult Variable Row, Column String line1,line2,line3,line4,line5,line6,line7,line8,line9,line10 String line11,line12,line13,line14,line15,line16,line17,line18,line19 Variable date_v, month, year, hour, minute, second Variable time_v Variable moncounts Variable sum_of_counts Variable Scaled_Counts // char *JANUARY={"JAN"};char *FEBRUARY={"FEB"};char *MARCH={"MAR"};char *APRIL={"APR"} // char *MAY={"MAY"};char *JUNE={"JUN"};char *JULY={"JUL"};char *AUGUST={"AUG"} // char *SEPTEMBER={"SEP"};char *OCTOBER={"OCT"};char *NOVEMBER={"NOV"};char *DECEMBER={"DEC"} Variable Multiplicity Variable a, b Variable X, Y Make/O/D/N=(Orientation, Max_Data_Multiplicity) Time_Data_Collected Make/O/D/N=(Orientation, Max_Data_Multiplicity) Monitor_Counts //[PP,MP,MM,PM][Data_Multiplicity] Make/O/D/N=(Orientation, Max_Data_Multiplicity) Total_Counts //[PP,MP,MM,PM][Data_Multiplicity] Make/O/D/N=(Orientation, Max_Data_Multiplicity, 2) He_Transmission //[PP,MP,MM,PM][Data_Multiplicity][majority, minority] in percent transmitted. Make/O/D/N=(Orientation, Q_PixelsX, Q_PixelsY) Scattering_Intensity //[PP,MP,MM,PM][Max_Data_Multiplicity][X][Y] Make/O/D/N=(Orientation, Orientation) Prefactors Make/O/D/N=(Orientation, Orientation) Inverted_Matrix Make/O/D/N=(Orientation) Norm_Data //*********************************************************************************************************** //Read in Record.txt parameters //*********************************************************************************************************** ////// this looks like all of the necessary inputs to make it work // // fscanf(user_input, "%f", &input); start_day = input; //printf("start day is %u\n", start_day) // fscanf(user_input, "%f", &input); start_month = input; //printf("start month is %u\n", start_month) // fscanf(user_input, "%f", &input); start_year = input; //printf("start year is %u\n", start_year) //// HARD WIRED VALUES start_day = 26 start_month = 4 start_year = 2010 helium_day = start_day helium_year = start_year - 2000 if(start_month == 1) helium_month = 0 endif if(start_month == 2) helium_month = 31 endif if(start_month == 3) helium_month = 59 endif if(start_month == 4) helium_month = 90 endif if(start_month == 5) helium_month = 120 endif if(start_month == 6) helium_month = 151 endif if(start_month == 7) helium_month = 181 endif if(start_month == 8) helium_month = 212 endif if(start_month == 9) helium_month = 243 endif if(start_month == 10) helium_month = 273 endif if(start_month == 11) helium_month = 304 endif if(start_month == 12) helium_month = 334 endif //// HARD WIRED VALUES // right now, Cells = 1, only one cell in use // Cells = 1 for(counter=0; counter