- Timestamp:
- Jun 14, 2018 12:18:24 PM (5 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Correct.ipf
r1055 r1106 291 291 //get relative monitor counts (should all be 10^8, since normalized in add step) 292 292 // get transmission and trans error for SAM, EMP 293 // TODO -- verify that the call to V_get MonitorCount() is really rescaled to 10^8, and saved is the "true" count294 295 tmonsam = V_get MonitorCount("SAM") //monitor count in SAM293 // TODO -- verify that the call to V_getBeamMonNormData() is really rescaled to 10^8, and saved is the "true" count 294 295 tmonsam = V_getBeamMonNormData("SAM") //monitor count in SAM 296 296 tsam = V_getSampleTransmission("SAM") //SAM transmission 297 297 sam_trans_err = V_getSampleTransError("SAM") 298 298 299 tmonemp = V_get MonitorCount("EMP") //monitor count in EMP299 tmonemp = V_getBeamMonNormData("EMP") //monitor count in EMP 300 300 temp = V_getSampleTransmission("EMP") //trans emp 301 301 emp_trans_err = V_getSampleTransError("EMP") 302 302 303 tmonbgd = V_get MonitorCount("BGD") //monitor count in BGD303 tmonbgd = V_getBeamMonNormData("BGD") //monitor count in BGD 304 304 305 305 … … 437 437 //get relative monitor counts (should all be 10^8, since normalized in add step) 438 438 // get transmission and trans error for SAM, EMP 439 // TODO -- verify that the call to V_get MonitorCount() is really rescaled to 10^8, and saved is the "true" count440 441 tmonsam = V_get MonitorCount("SAM") //monitor count in SAM439 // TODO -- verify that the call to V_getBeamMonNormData() is really rescaled to 10^8, and saved is the "true" count 440 441 tmonsam = V_getBeamMonNormData("SAM") //monitor count in SAM 442 442 tsam = V_getSampleTransmission("SAM") //SAM transmission 443 443 sam_trans_err = V_getSampleTransError("SAM") 444 444 445 tmonbgd = V_get MonitorCount("BGD") //monitor count in BGD445 tmonbgd = V_getBeamMonNormData("BGD") //monitor count in BGD 446 446 447 447 … … 548 548 //get relative monitor counts (should all be 10^8, since normalized in add step) 549 549 // get transmission and trans error for SAM, EMP 550 // TODO -- verify that the call to V_get MonitorCount() is really rescaled to 10^8, and saved is the "true" count551 552 tmonsam = V_get MonitorCount("SAM") //monitor count in SAM550 // TODO -- verify that the call to V_getBeamMonNormData() is really rescaled to 10^8, and saved is the "true" count 551 552 tmonsam = V_getBeamMonNormData("SAM") //monitor count in SAM 553 553 tsam = V_getSampleTransmission("SAM") //SAM transmission 554 554 sam_trans_err = V_getSampleTransError("SAM") 555 555 556 tmonemp = V_get MonitorCount("EMP") //monitor count in EMP556 tmonemp = V_getBeamMonNormData("EMP") //monitor count in EMP 557 557 temp = V_getSampleTransmission("EMP") //trans emp 558 558 emp_trans_err = V_getSampleTransError("EMP") … … 707 707 //get relative monitor counts (should all be 10^8, since normalized in add step) 708 708 // get transmission and trans error for SAM, EMP 709 // TODO -- verify that the call to V_get MonitorCount() is really rescaled to 10^8, and saved is the "true" count710 711 tmonsam = V_get MonitorCount("SAM") //monitor count in SAM709 // TODO -- verify that the call to V_getBeamMonNormData() is really rescaled to 10^8, and saved is the "true" count 710 711 tmonsam = V_getBeamMonNormData("SAM") //monitor count in SAM 712 712 tsam = V_getSampleTransmission("SAM") //SAM transmission 713 713 sam_trans_err = V_getSampleTransError("SAM") 714 714 715 tmonemp = V_get MonitorCount("EMP") //monitor count in EMP715 tmonemp = V_getBeamMonNormData("EMP") //monitor count in EMP 716 716 temp = V_getSampleTransmission("EMP") //trans emp 717 717 emp_trans_err = V_getSampleTransError("EMP") 718 718 719 tmonbgd = V_get MonitorCount("BGD") //monitor count in BGD719 tmonbgd = V_getBeamMonNormData("BGD") //monitor count in BGD 720 720 721 721 // for proper scaling, get the time and actual monitor counts … … 870 870 //get relative monitor counts (should all be 10^8, since normalized in add step) 871 871 // get transmission and trans error for SAM, EMP 872 // TODO -- verify that the call to V_get MonitorCount() is really rescaled to 10^8, and saved is the "true" count873 874 tmonsam = V_get MonitorCount("SAM") //monitor count in SAM872 // TODO -- verify that the call to V_getBeamMonNormData() is really rescaled to 10^8, and saved is the "true" count 873 874 tmonsam = V_getBeamMonNormData("SAM") //monitor count in SAM 875 875 tsam = V_getSampleTransmission("SAM") //SAM transmission 876 876 sam_trans_err = V_getSampleTransError("SAM") 877 877 878 tmonbgd = V_get MonitorCount("BGD") //monitor count in BGD878 tmonbgd = V_getBeamMonNormData("BGD") //monitor count in BGD 879 879 880 880 // for proper scaling, get the time and actual monitor counts … … 1001 1001 //get relative monitor counts (should all be 10^8, since normalized in add step) 1002 1002 // get transmission and trans error for SAM, EMP 1003 // TODO -- verify that the call to V_get MonitorCount() is really rescaled to 10^8, and saved is the "true" count1004 1005 tmonsam = V_get MonitorCount("SAM") //monitor count in SAM1003 // TODO -- verify that the call to V_getBeamMonNormData() is really rescaled to 10^8, and saved is the "true" count 1004 1005 tmonsam = V_getBeamMonNormData("SAM") //monitor count in SAM 1006 1006 tsam = V_getSampleTransmission("SAM") //SAM transmission 1007 1007 sam_trans_err = V_getSampleTransError("SAM") 1008 1008 1009 tmonemp = V_get MonitorCount("EMP") //monitor count in EMP1009 tmonemp = V_getBeamMonNormData("EMP") //monitor count in EMP 1010 1010 temp = V_getSampleTransmission("EMP") //trans emp 1011 1011 emp_trans_err = V_getSampleTransError("EMP") … … 1132 1132 //get relative monitor counts (should all be 10^8, since normalized in add step) 1133 1133 // get transmission and trans error for SAM, EMP 1134 // TODO -- verify that the call to V_get MonitorCount() is really rescaled to 10^8, and saved is the "true" count1135 1136 tmonsam = V_get MonitorCount("SAM") //monitor count in SAM1134 // TODO -- verify that the call to V_getBeamMonNormData() is really rescaled to 10^8, and saved is the "true" count 1135 1136 tmonsam = V_getBeamMonNormData("SAM") //monitor count in SAM 1137 1137 tsam = V_getSampleTransmission("SAM") //SAM transmission 1138 1138 sam_trans_err = V_getSampleTransError("SAM") -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_FileCatalog.ipf
r1105 r1106 651 651 // Monitor Count Rate 652 652 InsertPoints lastPoint,1,GMCR 653 GMCR[lastPoint] = V_get MonitorCount(fname)/ctime //total monitor count / total count time653 GMCR[lastPoint] = V_getBeamMonNormData(fname)/ctime //total monitor count / total count time 654 654 655 655 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Read.ipf
r1101 r1106 402 402 //monitor count 403 403 // TODO - verify that this is the correct monitor 404 Function V_get MonitorCount(fname)404 Function V_getControlMonitorCount(fname) 405 405 String fname 406 406 … … 409 409 end 410 410 411 Function V_get Monitor_preset(fname)411 Function V_getControlMonitor_preset(fname) 412 412 String fname 413 413 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Write.ipf
r1100 r1106 828 828 //monitor count 829 829 // integer value 830 Function V_write MonitorCount(fname,val)830 Function V_writeControlMonitorCount(fname,val) 831 831 String fname 832 832 Variable val … … 854 854 855 855 //integer value 856 Function V_write Monitor_preset(fname,val)856 Function V_writeControlMonitor_preset(fname,val) 857 857 String fname 858 858 Variable val … … 879 879 end 880 880 881 Function V_write Preset(fname,str)881 Function V_writeControlPreset(fname,str) 882 882 String fname,str 883 883 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_PatchFiles.ipf
r1102 r1106 296 296 297 297 listWave[2][1] = "monitor_counts" 298 listWave[2][2] = num2str(V_getMonitorCount(fname)) 298 // listWave[2][2] = num2str(V_getControlMonitorCount(fname)) 299 listWave[2][2] = num2str(V_getBeamMonNormData(fname)) 299 300 300 301 return(0) … … 1075 1076 if ((selWave[2][0] & 2^4) != 0) //"monitor_counts" 1076 1077 val = str2num(listWave[2][2]) 1077 err = V_writeMonitorCount(fname,val) 1078 // err = V_writeControlMonitorCount(fname,val) 1079 err = V_writeBeamMonNormData(fname,val) 1078 1080 endif 1079 1081 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf
r1101 r1106 355 355 Endif 356 356 357 V_MakeProtocolFromPanel( $("root:Packages:NIST:VSANS:Globals:Protocols:" + newProtocol) ) 358 String/G root:Packages:NIST:VSANS:Globals:Protocols:gProtoStr = newProtocol 359 357 Variable err 358 err = V_MakeProtocolFromPanel( $("root:Packages:NIST:VSANS:Globals:Protocols:" + newProtocol) ) 359 if(err) 360 DoAlert 0,"BGD and EMP files do not have the same configuration. No protocol saved." 361 KillWaves/Z $("root:Packages:NIST:VSANS:Globals:Protocols:" + newProtocol) 362 else 363 String/G root:Packages:NIST:VSANS:Globals:Protocols:gProtoStr = newProtocol 364 endif 360 365 //the data folder WAS changed above, this must be reset to root: 361 366 SetDatafolder root: … … 369 374 // TODO 370 375 // -- update for 12 points 376 // 377 // returns error==1 if files (emp, bgd) are not of the same configuration 371 378 // 372 379 Function V_MakeProtocolFromPanel(w) … … 526 533 //currently unused 527 534 w[11] = "" 528 529 return(0) 535 536 537 // check that w[0](BGD) and w[1](EMP) are from matching configurations 538 if(cmpstr(w[0],"none")==0 || cmpstr(w[0],"ask")==0) 539 // no file specified for BGD, so no issues 540 return(0) 541 endif 542 if(cmpstr(w[1],"none")==0 || cmpstr(w[1],"ask")==0) 543 // no file specified for EMP, so no issues 544 return(0) 545 endif 546 Variable matchOK 547 // returns 1 for match , 0 if no match 548 matchOK = V_RawFilesMatchConfig(StringFromList(0, w[0], ","),StringFromList(0, w[1], ",")) 549 550 return(!matchOK) 530 551 End 531 552 … … 930 951 String temp="root:Packages:NIST:VSANS:Globals:Protocols:tempProtocol" 931 952 Wave/T w=$temp 932 Variable ii=0,num=12 953 Variable ii=0,num=12,err 933 954 do 934 955 w[ii] = "" … … 936 957 while(ii<num) 937 958 938 V_MakeProtocolFromPanel(w) 939 959 960 err = V_MakeProtocolFromPanel(w) 961 if(err) 962 DoAlert 0,"BGD and EMP files do not have the same configuration." 963 return(0) 964 endif 965 940 966 //the "current" protocol is the "tempProtocol" that was parsed from the panel input 941 967 //set the global, so that the data writing routine can find the protocol wave (fatal otherwise) … … 1907 1933 //7 = beginning trim points 1908 1934 //8 = end trim points 1909 //9 = unused1935 //9 = collimation type for reduced data 1910 1936 //10 = unused 1911 1937 //11 = unused … … 1957 1983 // -- this may not be the most reliable way to pass the file name (for naming of the saved file later) 1958 1984 SVAR file_name = root:file_Name 1959 String samFileLoaded = file_name //keep a copy of the sample file loaded 1985 String samFileLoaded = file_name //keep a copy of the sample file loaded 1960 1986 1961 1987 //always update 1962 1988 V_UpdateDisplayInformation(ActiveType) 1989 1990 1991 // TODO -- the logic here is flawed 1992 // check that the SAM file is of the same configuration as BGD or EMP, if they are used 1993 // need to be able to handle all of the permutations AND catch the "ask" cases 1994 1995 Variable filesMatch=1 //assume OK 1996 1997 if(cmpstr("none",prot[0])==0 || cmpstr("ask",prot[0])==0) 1998 // BGD not identified, try EMP. 1999 if(cmpstr("none",prot[1])==0 || cmpstr("ask",prot[1])==0) 2000 // EMP not identified either, no mismatch possible 2001 else 2002 // compare to EMP 2003 filesMatch = V_RawFilesMatchConfig(samFileLoaded,StringFromList(0,prot[1],",")) 2004 endif 2005 else 2006 // BGD is identified, compare 2007 filesMatch = V_RawFilesMatchConfig(samFileLoaded,StringFromList(0,prot[0],",")) 2008 endif 2009 2010 if(filesMatch == 0) 2011 Abort "SAM data is not the same configuration as the protocol." 2012 SetDataFolder root: 2013 endif 2014 1963 2015 1964 2016 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Testing_Data_Procs.ipf
r1095 r1106 136 136 // 137 137 // divide the monitor count by 1e8 to get a number small enough to write in the field. 138 V_write MonitorCount(fileName,VCALC_getImon()/1e8)138 V_writeBeamMonNormData(fileName,VCALC_getImon()/1e8) 139 139 140 140 // total detector count (sum of everything) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_WorkFolderUtils.ipf
r1101 r1106 736 736 Variable monCount,savedMonCount 737 737 defmon=1e8 //default monitor counts 738 monCount = V_getMonitorCount(fname) // TODO -- this is read in since VCALC fakes this on output739 //monCount = V_getBeamMonNormData(fname) // TODO -- I think this is the *real* one to read738 // monCount = V_getControlMonitorCount(fname) // TODO -- this is read in since VCALC fakes this on output 739 monCount = V_getBeamMonNormData(fname) // TODO -- I think this is the *real* one to read 740 740 savedMonCount = monCount 741 741 scale = defMon/monCount // scale factor to MULTIPLY data by to rescale to defmon
Note: See TracChangeset
for help on using the changeset viewer.