- Timestamp:
- Feb 19, 2016 4:37:30 PM (7 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/Nexus_SANS_Write.ipf
r960 r981 2 2 3 3 4 // 5 // 6 // 7 // 4 8 // AUG 2015 ************** 5 9 //////////// -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/Nexus_VSANS_Write.ipf
r980 r981 201 201 202 202 203 ////////////// fake DIV file tests204 //205 //206 // Make/O/T/N=1 file_name = "VSANS_DIV_test.h5"207 //208 // simple generation of a fake div file. for sans, nothing other than the creation date was written to the209 // file header. nothing more is needed (possibly)210 //211 // TODO -- I want to re-visit the propagation of errors in the DIV file. No errors are ever calculated/saved212 // during the generation of the file, but there's no reason it couldn't. the idea is that the plex213 // is counted so long that the errors are insignificant compared to the data errors, but that may not214 // always be the case. A bit of math may prove this. or not. Plus, the situation for VSANS may be different.215 //216 //217 // TODO -- make the number of pixels GLOBAL218 // TODO -- there will be lots of work to do to develop the procedures necessary to actually generate the219 // 9 data sets to become the DIV file contents. More complexity here than for the simple SANS case.220 //221 Proc H_Setup_VSANS_DIV_Structure()222 223 NewDataFolder/O/S root:VSANS_DIV_file224 225 NewDataFolder/O/S root:VSANS_DIV_file:entry226 Make/O/T/N=1 title = "This is a fake DIV file for VSANS"227 Make/O/T/N=1 start_date = "2015-02-28T08:15:30-5:00"228 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument229 Make/O/T/N=1 name = "NG3_VSANS"230 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_B231 Make/O/D/N=(320,320) data = abs(gnoise(p+q))232 Make/O/D/N=(320,320) linear_data_error = 0.01*abs(gnoise(p+q))233 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_MR234 Make/O/D/N=(48,128) data = abs(gnoise(p+q))235 Make/O/D/N=(48,128) linear_data_error = 0.01*abs(gnoise(p+q))236 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_ML237 Make/O/D/N=(48,128) data = abs(gnoise(p+q))238 Make/O/D/N=(48,128) linear_data_error = 0.01*abs(gnoise(p+q))239 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_MT240 Make/O/D/N=(128,48) data = abs(gnoise(p+q))241 Make/O/D/N=(128,48) linear_data_error = 0.01*abs(gnoise(p+q))242 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_MB243 Make/O/D/N=(128,48) data = abs(gnoise(p+q))244 Make/O/D/N=(128,48) linear_data_error = 0.01*abs(gnoise(p+q))245 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_FR246 Make/O/D/N=(48,128) data = abs(gnoise(p+q))247 Make/O/D/N=(48,128) linear_data_error = 0.01*abs(gnoise(p+q))248 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_FL249 Make/O/D/N=(48,128) data = abs(gnoise(p+q))250 Make/O/D/N=(48,128) linear_data_error = 0.01*abs(gnoise(p+q))251 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_FT252 Make/O/D/N=(128,48) data = abs(gnoise(p+q))253 Make/O/D/N=(128,48) linear_data_error = 0.01*abs(gnoise(p+q))254 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_FB255 Make/O/D/N=(128,48) data = abs(gnoise(p+q))256 Make/O/D/N=(128,48) linear_data_error = 0.01*abs(gnoise(p+q))257 258 SetDataFolder root:259 260 End -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_BeamCenter.ipf
r963 r981 7 7 // x- when selecting the detector, set the x/y pixel sizes 8 8 // -- figure out how to re-plot the images when swapping between LR and TB panels 9 // 9 // -- Modify to accept mm (real space dimensions) rather than pixels 10 // -- or be able to swap the answer to mm for a more natural definition of the beam center 11 // -- add method to be able to write the values to the local folder / or better, to file on disk 12 // -- graphically show the beam center / radius of where it is in relation to the panel 10 13 11 14 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_HDF5_VSANS_Utils.ipf
r969 r981 55 55 // 56 56 57 58 Macro Load_Nexus_V_Template() 57 Menu "VSANS" 58 SubMenu "Nexus File Testing" 59 "Fill_Nexus_V_Template" 60 "Save_Nexus_V_Template" 61 "Load_Nexus_V_Template" 62 "-" 63 "IgorOnly_Setup_VSANS_Struct" 64 "IgorOnly_Save_VSANS_Nexus" 65 "IgorOnly_Setup_SANS_Struct" 66 "IgorOnly_Save_SANS_Struct" 67 "Setup_VSANS_DIV_Struct" 68 "Save_VSANS_DIV_Nexus" 69 End 70 End 71 72 73 Proc Load_Nexus_V_Template() 59 74 H_HDF5Gate_Read_Raw("") 60 75 String tmpStr=root:file_name //SRK - so I can get the file name that was loaded … … 66 81 67 82 68 MacroFill_Nexus_V_Template()83 Proc Fill_Nexus_V_Template() 69 84 H_Fill_VSANS_Template_wSim() 70 85 End 71 86 72 87 73 MacroSave_Nexus_V_Template()88 Proc Save_Nexus_V_Template() 74 89 H_HDF5Gate_Write_Raw("root:V_Nexus_Template:","") 75 90 End … … 94 109 95 110 96 MacroIgorOnly_Setup_VSANS_Struct()111 Proc IgorOnly_Setup_VSANS_Struct() 97 112 98 113 // lays out the tree and fills with dummy values … … 107 122 End 108 123 109 MacroIgorOnly_Save_VSANS_Nexus(fileName)124 Proc IgorOnly_Save_VSANS_Nexus(fileName) 110 125 String fileName="Test_VSANS_file" 111 126 … … 135 150 136 151 137 MacroIgorOnly_Setup_SANS_Struct()152 Proc IgorOnly_Setup_SANS_Struct() 138 153 139 154 // lays out the tree and fills with dummy values … … 148 163 End 149 164 150 MacroIgorOnly_Save_SANS_Nexus(fileName)165 Proc IgorOnly_Save_SANS_Nexus(fileName) 151 166 String fileName="Test_SANS_file" 152 167 … … 176 191 177 192 193 178 194 // TODO 179 195 // currently, there are no dummy fill values or attributes for the fake DIV file 180 196 // 181 MacroSetup_VSANS_DIV_Struct()197 Proc Setup_VSANS_DIV_Struct() 182 198 183 199 // lays out the tree and fills with dummy values … … 192 208 End 193 209 194 MacroSave_VSANS_DIV_Nexus(fileName)210 Proc Save_VSANS_DIV_Nexus(fileName) 195 211 String fileName="Test_VSANS_DIV_file" 196 212 … … 216 232 H_HDF5Gate_Read_Raw(fileName+".h5") 217 233 234 End 235 236 ////////////// fake DIV file tests 237 // 238 // 239 // Make/O/T/N=1 file_name = "VSANS_DIV_test.h5" 240 // 241 // simple generation of a fake div file. for sans, nothing other than the creation date was written to the 242 // file header. nothing more is needed (possibly) 243 // 244 // TODO -- I want to re-visit the propagation of errors in the DIV file. No errors are ever calculated/saved 245 // during the generation of the file, but there's no reason it couldn't. the idea is that the plex 246 // is counted so long that the errors are insignificant compared to the data errors, but that may not 247 // always be the case. A bit of math may prove this. or not. Plus, the situation for VSANS may be different. 248 // 249 // 250 // TODO -- make the number of pixels GLOBAL 251 // TODO -- there will be lots of work to do to develop the procedures necessary to actually generate the 252 // 9 data sets to become the DIV file contents. More complexity here than for the simple SANS case. 253 // 254 Proc H_Setup_VSANS_DIV_Structure() 255 256 NewDataFolder/O/S root:VSANS_DIV_file 257 258 NewDataFolder/O/S root:VSANS_DIV_file:entry 259 Make/O/T/N=1 title = "This is a fake DIV file for VSANS" 260 Make/O/T/N=1 start_date = "2015-02-28T08:15:30-5:00" 261 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument 262 Make/O/T/N=1 name = "NG3_VSANS" 263 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_B 264 Make/O/D/N=(320,320) data = abs(gnoise(10)) 265 Make/O/D/N=(320,320) linear_data_error = 0.01*abs(gnoise(10)) 266 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_MR 267 Make/O/D/N=(48,128) data = abs(gnoise(10)) 268 Make/O/D/N=(48,128) linear_data_error = 0.01*abs(gnoise(10)) 269 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_ML 270 Make/O/D/N=(48,128) data = abs(gnoise(10)) 271 Make/O/D/N=(48,128) linear_data_error = 0.01*abs(gnoise(10)) 272 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_MT 273 Make/O/D/N=(128,48) data = abs(gnoise(10)) 274 Make/O/D/N=(128,48) linear_data_error = 0.01*abs(gnoise(10)) 275 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_MB 276 Make/O/D/N=(128,48) data = abs(gnoise(10)) 277 Make/O/D/N=(128,48) linear_data_error = 0.01*abs(gnoise(10)) 278 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_FR 279 Make/O/D/N=(48,128) data = abs(gnoise(10)) 280 Make/O/D/N=(48,128) linear_data_error = 0.01*abs(gnoise(10)) 281 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_FL 282 Make/O/D/N=(48,128) data = abs(gnoise(10)) 283 Make/O/D/N=(48,128) linear_data_error = 0.01*abs(gnoise(10)) 284 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_FT 285 Make/O/D/N=(128,48) data = abs(gnoise(10)) 286 Make/O/D/N=(128,48) linear_data_error = 0.01*abs(gnoise(10)) 287 NewDataFolder/O/S root:VSANS_DIV_file:entry:instrument:detector_FB 288 Make/O/D/N=(128,48) data = abs(gnoise(10)) 289 Make/O/D/N=(128,48) linear_data_error = 0.01*abs(gnoise(10)) 290 291 SetDataFolder root: 292 218 293 End 219 294 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DetectorCorrections.ipf
r979 r981 76 76 end 77 77 78 // 79 // Non-linear data correction 80 // 81 // input is the data array (N tubes x M pixels) 82 // input of N x M array of quadratic coefficients 83 // 84 // output is wave of corrected real space distance corresponding to each pixel of the data 85 // 86 // 87 // TODO 88 // -- verify the direction of the tubes and indexing 89 // -- be sure I'm working in the right data folder 90 // -- clean up when done 91 // -- calculate + return the error contribution? 92 // -- do I want this to return a wave? 93 // -- do I need to write a separate function that returns the distance wave for later calculations? 94 // -- do I want to make the distance array 2D to keep the x and y dims together? Calculate them all right now? 95 // -- what else do I need to pass to the function? (fname=folder? detStr?) 96 // 97 // 98 // 99 Function NonLinearCorrection(dataW,data_errW,coefW) 100 Wave dataW,data_errW,coefW 101 102 // do I count on the orientation as an input, or do I just figure it out on my own? 103 String orientation 104 Variable dimX,dimY 105 dimX = DimSize(dataW,0) 106 dimY = DimSize(dataw,1) 107 if(dimX > dimY) 108 orientation = "horizontal" 109 else 110 orientation = "vertical" 111 endif 112 113 // make a wave of the same dimensions, in the same data folder for the distance 114 // ?? or a 2D wave? 115 116 // then per tube, do the quadratic calculation to get the real space distance along the tube 117 // the distance perpendicular to the tube is n*(8.4mm) per tube index 118 119 if(cmpstr(orientation,"vertical")==0) 120 // this is data dimensioned as (Ntubes,Npix) 121 122 123 elseif(cmpstr(orientation,"horizontal")==0) 124 // this is data (horizontal) dimensioned as (Npix,Ntubes) 125 126 127 else 128 DoAlert 0,"Orientation not correctly passed in NonLinearCorrection(). No correction done." 129 endif 130 131 return(0) 132 end 78 133 79 134 … … 101 156 //// 102 157 103 104 158 // TODO 159 // get rid of this in the real data 160 // 161 // TESTING ONLY 162 Macro MakeFakeCalibrationWaves() 163 // make these in the RAW data folder, before converting to a work folder 164 // - then they will be "found" by get() 165 // -- only for the tube, not the Back det 166 167 DoAlert 0, "re-do this and do a better job of filling the fake data" 168 169 fMakeFakeCalibrationWaves() 170 End 171 172 173 174 // TODO 175 // get rid of this in the real data 176 // 177 // TESTING ONLY 178 // 179 // orientation does not matter, there are 48 tubes in each bank 180 // so dimension (3,48) for everything. 181 // 182 // -- but the orientation does indicate TB vs LR, which has implications for 183 // the (fictional) dimension of the pixel along the tube axis, at least as far 184 // as for making the fake coefficients. 185 // 186 Function fMakeFakeCalibrationWaves() 187 188 Variable ii,pixSize 189 String detStr,fname="RAW",orientation 190 191 for(ii=0;ii<ItemsInList(ksDetectorListNoB);ii+=1) 192 detStr = StringFromList(ii, ksDetectorListNoB, ";") 193 // Wave w = V_getDetectorDataW(fname,detStr) 194 Make/O/D/N=(3,48) $("root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_"+detStr+":spatial_calibration") 195 Wave calib = $("root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_"+detStr+":spatial_calibration") 196 // !!!! this overwrites what is there 197 198 orientation = V_getDet_tubeOrientation(fname,detStr) 199 if(cmpstr(orientation,"vertical")==0) 200 // this is vertical tube data dimensioned as (Ntubes,Npix) 201 pixSize = 8 //V_getDet_y_pixel_size(fname,detStr) 202 elseif(cmpstr(orientation,"horizontal")==0) 203 // this is data (horizontal) dimensioned as (Npix,Ntubes) 204 pixSize = 4 //V_getDet_x_pixel_size(fname,detStr) 205 else 206 DoAlert 0,"Orientation not correctly passed in NonLinearCorrection(). No correction done." 207 endif 208 209 calib[0][] = -64 210 calib[1][] = pixSize 211 calib[2][] = 2e-4 212 213 endfor 214 215 return(0) 216 End 105 217 106 218 … … 543 655 //check before re-implementing 544 656 // 545 ProcDIV_a_Workfile(type)657 Macro DIV_a_Workfile(type) 546 658 String type 547 Prompt type,"WORK data type",popup," COR;SAM;EMP;BGD"659 Prompt type,"WORK data type",popup,"SAM;EMP;BGD;ADJ;" 548 660 549 661 //macro will take whatever is in SELECTED folder and DIVide it by the current 550 662 //contents of the DIV folder - the function will check for existence 551 663 //before proceeding 664 665 //DoAlert 0,"This has not yet been updated for VSANS" 552 666 553 667 Variable err 554 err = D ivide_work(type) //returns err = 1 if data doesn't exist in specified folders668 err = DIVCorrection(type) //returns err = 1 if data doesn't exist in specified folders 555 669 556 670 if(err) 557 Abort "error in Divide_work" 558 endif 559 560 //contents are always dumped to CAL 561 type = "CAL" 671 Abort "error in DIVCorrection()" 672 endif 673 674 //contents are NOT always dumped to CAL, but are in the new type folder 562 675 563 676 String newTitle = "WORK_"+type 564 DoWindow/F SANS_Data565 DoWindow/T SANS_Data, newTitle677 DoWindow/F VSANS_Data 678 DoWindow/T VSANS_Data, newTitle 566 679 KillStrings/Z newTitle 567 680 568 681 //need to update the display with "data" from the correct dataFolder 569 682 //reset the current displaytype to "type" 570 String/G root:myGlobals:gDataDisplayType=Type 571 572 fRawWindowHook() 573 574 End 683 String/G root:Packages:NIST:VSANS:Globals:gCurDispType=Type 684 685 UpdateDisplayInformation(type) 686 687 End 688 575 689 576 690 // … … 578 692 // -- DoAlert 0,"This has not yet been updated for VSANS" 579 693 // 580 //function will divide the contents of "type" folder with the contents of 581 //the DIV folder 582 // all data is converted to linear scale for the calculation 583 // 584 Function Divide_work(type) 585 String type 586 587 DoAlert 0,"This has not yet been updated for VSANS" 694 //function will divide the contents of "workType" folder with the contents of 695 //the DIV folder + detStr 696 // all data is linear scale for the calculation 697 // 698 Function DIVCorrection(data,data_err,detStr,workType) 699 Wave data,data_err 700 String detStr,workType 588 701 589 702 //check for existence of data in type and DIV 590 // if the desired workfiledoesn't exist, let the user know, and abort703 // if the desired data doesn't exist, let the user know, and abort 591 704 String destPath="" 592 705 593 if(WaveExists( $("root:Packages:NIST:"+Type + ":data")) == 0)594 Print "The re is no work file in "+type+"--Aborting"706 if(WaveExists(data) == 0) 707 Print "The data wave does not exist in DIVCorrection()" 595 708 Return(1) //error condition 596 709 Endif 710 597 711 //check for DIV 598 712 // if the DIV workfile doesn't exist, let the user know,and abort 599 713 600 if(WaveExists($"root:Packages:NIST:DIV:data") == 0) 601 Print "There is no work file in DIV --Aborting" 714 WAVE/Z div_data = $("root:Packages:NIST:VSANS:DIV:entry:entry:instrument:detector_"+detStr+":data") 715 if(WaveExists(div_data) == 0) 716 Print "The DIV wave does not exist in DIVCorrection()" 602 717 Return(1) //error condition 603 718 Endif 604 719 //files exist, proceed 605 606 //check for log-scaling of the "DIV" data and adjust if necessary 607 // should not be needed now - using display flag instead 608 // ConvertFolderToLinearScale("DIV") 609 610 //copy type information to CAL, wiping out the old contents of the CAL folder first 611 612 //destPath = "root:Packages:NIST:CAL" 613 //SetDataFolder destPath 614 //KillWaves/A/Z //get rid of the old data in CAL folder 615 616 //check for log-scaling of the "type" data and adjust if necessary 617 // should not be needed now - using display flag instead 618 // ConvertFolderToLinearScale(type) 619 //then continue 620 621 //copy from current dir (type)=destPath to CAL, overwriting CAL contents 622 destPath = "root:Packages:NIST:" + type 623 Duplicate/O $(destPath + ":data"),$"root:Packages:NIST:CAL:data" 624 Duplicate/O $(destPath + ":linear_data"),$"root:Packages:NIST:CAL:linear_data" 625 Duplicate/O $(destPath + ":linear_data_error"),$"root:Packages:NIST:CAL:linear_data_error" 626 // Duplicate/O $(destPath + ":vlegend"),$"root:Packages:NIST:CAL:vlegend" 627 Duplicate/O $(destPath + ":textread"),$"root:Packages:NIST:CAL:textread" 628 Duplicate/O $(destPath + ":integersread"),$"root:Packages:NIST:CAL:integersread" 629 Duplicate/O $(destPath + ":realsread"),$"root:Packages:NIST:CAL:realsread" 630 //need to save a copy of filelist string too (from the current type folder) 631 SVAR oldFileList = $(destPath + ":fileList") 632 633 //now switch to reference waves in CAL folder 634 destPath = "root:Packages:NIST:CAL" 635 //make appropriate wave references 636 Wave data=$(destPath + ":linear_data") // these wave references point to the data in CAL 637 // Wave data_err=$(destPath + ":linear_data_err") // these wave references point to the data in CAL 638 Wave data_copy=$(destPath + ":data") // these wave references point to the data in CAL 639 Wave/t textread=$(destPath + ":textread") //that are to be directly operated on 640 Wave integersread=$(destPath + ":integersread") 641 Wave realsread=$(destPath + ":realsread") 642 Variable/G $(destPath + ":gIsLogScale")=0 //make new flag in CAL folder, data is linear scale 643 //need to copy filelist string too 644 String/G $(destPath + ":fileList") = oldFileList 645 646 Wave div_data = $"root:Packages:NIST:DIV:data" //hard-wired in.... 647 //do the division, changing data in CAL 720 648 721 data /= div_data 649 722 650 723 // data_err /= div_data 651 724 652 // keep "data" in sync with linear_data653 data_copy = data654 655 //update CAL header656 textread[1] = date() + " " + time() //date + time stamp657 658 725 Return(0) 659 726 End -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_RW_Utils.ipf
r980 r981 23 23 24 24 // passing null file string presents a dialog 25 ProcLoadFakeDIVData()25 Macro LoadFakeDIVData() 26 26 V_LoadHDF5Data("","DIV") 27 27 End … … 71 71 // TODO -- once I get "real" data, get rid of this call to force the data to be proper dimensions. 72 72 V_RedimFakeData() 73 73 // 74 // TODO -- for the "real" data, may need a step in here to convert integer detector data to DP, or I'll 75 // get really odd results from the calculations, and may not even notice. 76 77 // TODO 78 // -- get rid of these fake calibration waves as "real" ones are filled in 79 Execute "MakeFakeCalibrationWaves()" 80 // fMakeFakeCalibrationWaves() //skips the alert 81 82 74 83 /// END FAKE DATA CORRECTIONS 75 84 … … 91 100 Wave det_B=data 92 101 Redimension/N=(320,320)/E=1 det_B 102 det_B = p+q+2 93 103 94 104 Variable ctr=20,npix=128 … … 151 161 SetScale/I y -npix/2,npix/2,"",det_FR 152 162 163 // get rid of zeros 164 det_FL += 2 165 det_FR += 2 166 det_FT += 2 167 det_FB += 2 153 168 154 169 return(0) … … 161 176 // Attributes are NOT loaded at all. 162 177 // 163 // TODO: remove the P=home restriction top make this more generic 178 // TODO: 179 // -x remove the P=home restriction top make this more generic (replaced with catPathName from PickPath) 164 180 // -- get rid of bits leftover here that I don't need 165 181 // -- be sure I'm using all of the correct flags in the HDF5LoadGroup operation … … 179 195 180 196 Variable fileID = 0 181 HDF5OpenFile/R/P=home/Z fileID as fileName //read file from home directory?182 //HDF5OpenFile/R/P=catPathName/Z fileID as fileName197 // HDF5OpenFile/R/P=home/Z fileID as fileName //read file from home directory? 198 HDF5OpenFile/R/P=catPathName/Z fileID as fileName 183 199 if (V_Flag != 0) 184 200 return 0 … … 432 448 // -- do I need to write separate functions for real, integer, etc.? 433 449 // 434 // - - change the /P=home to the user-defined data path (which may be home)450 // -x change the /P=home to the user-defined data path (catPathName) 435 451 // 436 452 Function V_WriteWaveToHDF(fname, groupName, varName, wav) … … 443 459 444 460 try 445 HDF5OpenFile/P= home /Z fileID as fname //open file read-write461 HDF5OpenFile/P=catPathName /Z fileID as fname //open file read-write 446 462 if(!fileID) 447 463 err = 1 … … 518 534 // TODO 519 535 // 520 // - - change the /P=home to the user-defined data path (which may be home)536 // -x change the /P=home to the user-defined data path (catPathName) 521 537 // 522 538 Function V_WriteTextWaveToHDF(fname, groupName, varName, wav) … … 529 545 530 546 try 531 HDF5OpenFile/P= home /Z fileID as fname //open file read-write547 HDF5OpenFile/P=catPathName /Z fileID as fname //open file read-write 532 548 if(!fileID) 533 549 err = 1 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Read.ipf
r979 r981 465 465 end 466 466 467 // transmission value (error) for the attenuator in the beam 468 // use this, but if something wrong, the tables are present 469 Function V_getAttenuator_trans_err(fname) 470 String fname 471 472 String path = "entry:instrument:attenuator:attenuator_transmission_error" 473 return(V_getRealValueFromHDF5(fname,path)) 474 end 467 475 468 476 // distance from the attenuator to the sample (units??) … … 1251 1259 End 1252 1260 1261 Function V_getDet_VerticalOffset(fname,detStr) 1262 String fname,detStr 1263 1264 String path = "entry:instrument:detector_"+detStr+":vertical_offset" 1265 return(V_getRealValueFromHDF5(fname,path)) 1266 End 1267 1268 1253 1269 // only defined for the "B" detector, and only to satisfy NXsas 1254 1270 Function V_getDet_polar_angle(fname,detStr) … … 1340 1356 // TODO -- write this function to return a WAVE with the data 1341 1357 // either as a wave reference, or as an input parameter 1342 Function V_getDetTube_spatialCalib(fname,detStr,outW) 1343 String fname,detStr 1344 Wave outW 1358 Function/WAVE V_getDetTube_spatialCalib(fname,detStr) 1359 String fname,detStr 1345 1360 1346 1361 String path = "entry:instrument:detector_"+detStr+":spatial_calibration" 1347 1362 if(cmpstr(detStr,"B") == 0) 1348 return (0)1363 return $("") // return should be null 1349 1364 else 1350 1365 WAVE w = V_getRealWaveFromHDF5(fname,path) 1351 1352 outW = w 1353 return(0) 1366 return w 1354 1367 endif 1355 1368 End -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Write.ipf
r979 r981 997 997 end 998 998 999 // transmission value (error) for the attenuator in the beam 1000 // use this, but if something wrong, the tables are present 1001 Function V_writeAttenuator_trans_err(fname,val) 1002 String fname 1003 Variable val 1004 1005 // String path = "entry:instrument:attenuator:attenuator_transmission_error" 1006 1007 Make/O/D/N=1 wTmpWrite 1008 // Make/O/R/N=1 wTmpWrite 1009 String groupName = "/entry/instrument/attenuator" 1010 String varName = "attenuator_transmission_error" 1011 wTmpWrite[0] = val 1012 1013 variable err 1014 err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 1015 if(err) 1016 Print "HDF write err = ",err 1017 endif 1018 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 1019 err = V_KillNamedDataFolder(fname) 1020 if(err) 1021 Print "DataFolder kill err = ",err 1022 endif 1023 return(err) 1024 end 1025 999 1026 1000 1027 // distance from the attenuator to the sample (units??) … … 3391 3418 End 3392 3419 3420 Function V_writeDet_VerticalOffset(fname,detStr,val) 3421 String fname,detStr 3422 Variable val 3423 3424 // String path = "entry:instrument:detector_"+detStr+":vertical_offset" 3425 3426 Make/O/D/N=1 wTmpWrite 3427 // Make/O/R/N=1 wTmpWrite 3428 String groupName = "/entry/instrument/detector_"+detStr 3429 String varName = "vertical_offset" 3430 wTmpWrite[0] = val 3431 3432 variable err 3433 err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 3434 if(err) 3435 Print "HDF write err = ",err 3436 endif 3437 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 3438 err = V_KillNamedDataFolder(fname) 3439 if(err) 3440 Print "DataFolder kill err = ",err 3441 endif 3442 return(err) 3443 End 3444 3393 3445 // only defined for the "B" detector, and only to satisfy NXsas 3394 3446 Function V_writeDet_polar_angle(fname,detStr,val) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MainPanel.ipf
r979 r981 143 143 String ctrlName 144 144 145 ChangeDisplay()145 V_ChangeDisplay() 146 146 End 147 147 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Test_RAW_Panel.ipf
r979 r981 6 6 // this will become the equivalent of "RawWindowHook" 7 7 // 8 // Procedures to display the detector data along with whatever visualization tools 9 // necessary to understand the data 10 // 8 // Procedures to: 9 // display the detector data 10 // visualization tools 11 // mouse interaction 12 // status information necessary to understand the data 13 // buttons to more functionality to process data 11 14 12 15 … … 34 37 35 38 DoWindow/F VSANS_Data 36 Print V_flag39 // Print V_flag 37 40 if(V_flag==0) 38 41 … … 40 43 41 44 VSANS_DataPanel() //draws the panel 42 // fake a click on all three tabs - to populate the data 43 FakeTabClick(2) 44 FakeTabClick(1) 45 FakeTabClick(0) 45 46 46 endif 47 47 … … 49 49 // what isn't automatically picked up? What is "stale" on the display? 50 50 String/G root:Packages:NIST:VSANS:Globals:gCurDispType = type 51 52 // fake a click on all three tabs - to populate the data 53 FakeTabClick(2) 54 FakeTabClick(1) 55 FakeTabClick(0) 51 56 // DoWindow/T VSANS_Data,type + " VSANS_Data" 57 58 String newTitle = "WORK_"+type 59 DoWindow/F VSANS_Data 60 DoWindow/T VSANS_Data, newTitle 61 KillStrings/Z newTitle 62 52 63 end 53 64 … … 354 365 // x- remove the dependency on VCALC being initialized first, and using dummy waves from there... 355 366 // 367 // -- can I use "ReplaceWave" to do this? 356 368 Function VDataTabProc(tca) : TabControl 357 369 STRUCT WMTabControlAction &tca … … 368 380 SetDataFolder root: 369 381 382 SVAR dataType = root:Packages:NIST:VSANS:Globals:gCurDispType 383 384 //************ 385 // -- can I use "ReplaceWave/W=VSANS_Data#det_panelsB allinCDF" to do this? 386 // -- only works for "B", since for M and F panels, all 4 data sets are named "data" 387 // in their respective folders... 388 389 String tmpStr 390 Variable ii 370 391 if(tab==2) 371 //SetDataFolder root:Packages:NIST:VSANS:VCALC:Back 372 //Wave det_B 373 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_B 392 tmpStr = ImageNameList("VSANS_Data#det_panelsB",";") 393 // for some odd reason, it appears that I need to work from the back of the list 394 // since the traces get "renumbered" as I take them off !! A do loop may be a better choice 395 if(ItemsInList(tmpStr) > 0) 396 do 397 RemoveImage /W=VSANS_Data#det_panelsB $(StringFromList(0,tmpStr,";")) //get 1st item 398 tmpStr = ImageNameList("VSANS_Data#det_panelsB",";") //refresh list 399 while(ItemsInList(tmpStr) > 0) 400 endif 401 402 SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:entry:instrument:detector_B") 374 403 Wave det_B=data 375 CheckDisplayed /W=VSANS_Data#det_panelsB det_B 376 if(V_flag == 0) 404 405 CheckDisplayed /W=VSANS_Data#det_panelsB det_B 406 if(V_flag == 0) // 0 == data is not displayed, so append it 377 407 AppendImage/W=VSANS_Data#det_panelsB det_B 378 // ModifyImage/W=VSANS_Data#det_panelsB det_B ctab= {*,*,ColdWarm,0}379 408 ModifyImage/W=VSANS_Data#det_panelsB ''#0 ctab= {*,*,ColdWarm,0} 380 409 endif … … 388 417 389 418 if(tab==1) 390 //SetDataFolder root:Packages:NIST:VSANS:VCALC:Middle 391 //Wave det_MR,det_ML,det_MB,det_MT 392 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_ML 393 Wave det_ML=data 394 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_MR 419 tmpStr = ImageNameList("VSANS_Data#det_panelsM",";") 420 // for some odd reason, it appears that I need to work from the back of the list 421 // since the traces get "renumbered" as I take them off !! A do loop may be a better choice 422 if(ItemsInList(tmpStr) > 0) 423 do 424 RemoveImage /W=VSANS_Data#det_panelsM $(StringFromList(0,tmpStr,";")) //get 1st item 425 tmpStr = ImageNameList("VSANS_Data#det_panelsM",";") //refresh list 426 while(ItemsInList(tmpStr) > 0) 427 endif 428 429 SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:entry:instrument:detector_ML") 430 Wave det_ML=data 431 SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:entry:instrument:detector_MR") 395 432 Wave det_MR=data 396 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_MT433 SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:entry:instrument:detector_MT") 397 434 Wave det_MT=data 398 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_MB435 SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:entry:instrument:detector_MB") 399 436 Wave det_MB=data 437 400 438 CheckDisplayed /W=VSANS_Data#det_panelsM det_MR 401 439 if(V_flag == 0) … … 404 442 AppendImage/W=VSANS_Data#det_panelsM det_ML 405 443 AppendImage/W=VSANS_Data#det_panelsM det_MR 406 // ModifyImage/W=VSANS_Data#det_panelsM det_MT ctab= {*,*,ColdWarm,0}407 // ModifyImage/W=VSANS_Data#det_panelsM det_MB ctab= {*,*,ColdWarm,0}408 // ModifyImage/W=VSANS_Data#det_panelsM det_ML ctab= {*,*,ColdWarm,0}409 // ModifyImage/W=VSANS_Data#det_panelsM det_MR ctab= {*,*,ColdWarm,0}410 444 ModifyImage/W=VSANS_Data#det_panelsM ''#0 ctab= {*,*,ColdWarm,0} // ''#n means act on the nth image (there are 4) 411 445 ModifyImage/W=VSANS_Data#det_panelsM ''#1 ctab= {*,*,ColdWarm,0} … … 422 456 423 457 if(tab==0) 424 //SetDataFolder root:Packages:NIST:VSANS:VCALC:Front 425 //Wave det_FL,det_FR,det_FT,det_FB 426 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FL 458 tmpStr = ImageNameList("VSANS_Data#det_panelsF",";") 459 // for some odd reason, it appears that I need to work from the back of the list 460 // since the traces get "renumbered" as I take them off !! A do loop may be a better choice 461 if(ItemsInList(tmpStr) > 0) 462 do 463 RemoveImage /W=VSANS_Data#det_panelsF $(StringFromList(0,tmpStr,";")) //get 1st item 464 tmpStr = ImageNameList("VSANS_Data#det_panelsF",";") //refresh list 465 while(ItemsInList(tmpStr) > 0) 466 endif 467 468 SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:entry:instrument:detector_FL") 427 469 Wave det_FL=data 428 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FR470 SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:entry:instrument:detector_FR") 429 471 Wave det_FR=data 430 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FT431 Wave det_FT=data 432 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FB472 SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:entry:instrument:detector_FT") 473 Wave det_FT=data 474 SetDataFolder $("root:Packages:NIST:VSANS:"+dataType+":entry:entry:instrument:detector_FB") 433 475 Wave det_FB=data 476 434 477 CheckDisplayed /W=VSANS_Data#det_panelsF det_FL 435 478 if(V_flag == 0) … … 438 481 AppendImage/W=VSANS_Data#det_panelsF det_FL 439 482 AppendImage/W=VSANS_Data#det_panelsF det_FR 440 // ModifyImage/W=VSANS_Data#det_panelsF det_FT ctab= {*,*,ColdWarm,0}441 // ModifyImage/W=VSANS_Data#det_panelsF det_FB ctab= {*,*,ColdWarm,0}442 // ModifyImage/W=VSANS_Data#det_panelsF det_FL ctab= {*,*,ColdWarm,0}443 // ModifyImage/W=VSANS_Data#det_panelsF det_FR ctab= {*,*,ColdWarm,0}444 483 ModifyImage/W=VSANS_Data#det_panelsF ''#0 ctab= {*,*,ColdWarm,0} 445 484 ModifyImage/W=VSANS_Data#det_panelsF ''#1 ctab= {*,*,ColdWarm,0} … … 454 493 SetDataFolder root: 455 494 endif 456 495 496 // make sure log scaling is correct 497 NVAR state = root:Packages:NIST:VSANS:Globals:gIsLogScale 498 499 // on the front: 500 ModifyImage/W=VSANS_Data#det_panelsF ''#0 log=State 501 ModifyImage/W=VSANS_Data#det_panelsF ''#1 log=State 502 ModifyImage/W=VSANS_Data#det_panelsF ''#2 log=State 503 ModifyImage/W=VSANS_Data#det_panelsF ''#3 log=State 504 //on the middle: 505 ModifyImage/W=VSANS_Data#det_panelsM ''#0 log=State 506 ModifyImage/W=VSANS_Data#det_panelsM ''#1 log=State 507 ModifyImage/W=VSANS_Data#det_panelsM ''#2 log=State 508 ModifyImage/W=VSANS_Data#det_panelsM ''#3 log=State 509 // on the back: 510 ModifyImage/W=VSANS_Data#det_panelsB ''#0 log=State 511 //// 512 457 513 458 514 break … … 602 658 603 659 604 // TODO 660 // TODO -- this appears to be complete... 605 661 // toggle the (z) value of the display log/lin 606 662 // … … 658 714 // TODO 659 715 // possibly function to "tag" files right here in the disaply with things 660 // like their intent, or other values that reduction will need, 716 // like their intent, or other values that reduction will need, kind of like a "quick patch" 717 // with limited functionality (since full function would be a nightmare!) 661 718 Function TagFileButtonProc(ba) : ButtonControl 662 719 STRUCT WMButtonAction &ba -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Utilities_General.ipf
r979 r981 42 42 End 43 43 44 // 45 // entry from the Main Panel 46 // 47 Proc V_ChangeDisplay(type) 48 String type 49 Prompt type,"WORK data type to display",popup,"RAW;SAM;EMP;BGD;ADJ;" 50 51 UpdateDisplayInformation(type) 52 End 44 53 45 54 // -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_WorkFolderUtils.ipf
r980 r981 10 10 // 11 11 // - adding RAW data to a workfile 12 // -- this conversion applies the detector corrections12 // -- **this conversion applies the detector corrections** 13 13 // 14 14 // - copying workfiles to another folder … … 55 55 // data is actually in use - so it will fail every time. need an alternate solution. in SANS, 56 56 // there are a limited number of waves to carry over, so Dupliate/O is used for rw, tw, data, etc. 57 //58 //59 57 // 60 58 // TODO : I also need a list of what is generated during processing that may be hanging around - that I need to … … 103 101 104 102 // everything on the top level 105 V_DuplicateDataFolder($( toDF+":entry:entry"),fromStr,toStr,0,"",0) //no recursion here103 V_DuplicateDataFolder($(fromDF+":entry:entry"),fromStr,toStr,0,"",0) //no recursion here 106 104 // control 107 V_DuplicateDataFolder($( toDF+":entry:entry:control"),fromStr,toStr,0,"",1) //yes recursion here105 V_DuplicateDataFolder($(fromDF+":entry:entry:control"),fromStr,toStr,0,"",1) //yes recursion here 108 106 // instrument 109 V_DuplicateDataFolder($( toDF+":entry:entry:instrument"),fromStr,toStr,0,"",1) //yes recursion here107 V_DuplicateDataFolder($(fromDF+":entry:entry:instrument"),fromStr,toStr,0,"",1) //yes recursion here 110 108 // reduction 111 V_DuplicateDataFolder($( toDF+":entry:entry:reduction"),fromStr,toStr,0,"",1) //yes recursion here109 V_DuplicateDataFolder($(fromDF+":entry:entry:reduction"),fromStr,toStr,0,"",1) //yes recursion here 112 110 // sample 113 V_DuplicateDataFolder($( toDF+":entry:entry:sample"),fromStr,toStr,0,"",1) //yes recursion here111 V_DuplicateDataFolder($(fromDF+":entry:entry:sample"),fromStr,toStr,0,"",1) //yes recursion here 114 112 115 113 endif … … 266 264 267 265 266 // 268 267 // given the folder, duplicate the data -> linear_data and generate the error 268 // TODO 269 // -- do I want to use different names here? If it turns out that I don't need to drag a copy of 270 // the data around as "linear_data", then I can eliminate that, and rename the error wave 271 // -- be sure the data is either properly written as 2D in the file, or converted to 2D before 272 // duplicating here 273 // -- ? do I recast to DP here. Probably necessary since I'm doing a DP calculation, but Redimension 274 // is done in the Raw_to_Work step too. very confusing. 269 275 Function V_MakeDataError(folderStr) 270 276 String folderStr … … 287 293 288 294 289 290 291 292 295 ///////////////////// 293 296 … … 299 302 // line fails (but reports no error), then DuplicateDataFolder fails, and reports an error. Trying 300 303 // to simplify this condition, I can't duplicate the error for WM... 301 Proc Add_to_Workfile(newtype, doadd)304 Macro Convert_to_Workfile(newtype, doadd) 302 305 String newtype,doadd 303 306 Prompt newtype,"WORK data type",popup,"SAM;EMP;BGD;ADJ;" … … 315 318 else 316 319 //yes, add RAW to the current work folder contents 320 Abort "Adding RAW data files is currently unsupported" 317 321 err = Add_raw_to_work(newtype) 318 322 endif … … 330 334 331 335 // 336 // THIS IS THE MAJOR ROUTINE TO APPLY DATA CORRECTIONS 337 // 332 338 //will copy the current contents of the RAW folder to the newType work folder 333 339 //and do the geometric corrections and normalization to monitor counts 334 //(the function Add_Raw_to_work(type) adds multiple runs together )340 //(the function Add_Raw_to_work(type) adds multiple runs together - and is LOW priority) 335 341 // 336 342 //the current display type is updated to newType (global) … … 363 369 364 370 // now work with the waves from the destination folder. 365 Variable/G $(destPath + ":gIsLogscale")=0 //overwite flag in newType folder, data converted (above) to linear scale366 // String/G $(destPath + ":fileList") = textread[0] //a list of names of the files in the work file (1) //02JUL13367 371 368 372 // apply corrections --- … … 373 377 374 378 // each correction must loop over each detector. tedious. 379 380 // (0) Redimension the data waves in the destination folder 381 // so that they are DP, not integer 382 // TODO 383 // -- currently only redimensioning the data and linear_data_error - What else??? 384 // 385 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 386 detStr = StringFromList(ii, ksDetectorListAll, ";") 387 Wave w = V_getDetectorDataW(fname,detStr) 388 Wave w_err = V_getDetectorDataErrW(fname,detStr) 389 Redimension/D w,w_err 390 endfor 391 375 392 376 393 // (1) DIV correction … … 382 399 // need extra check here for file existence 383 400 // if not in DIV folder, load. 384 // if unable to load, skip correction and report error (Alert?) 385 for(ii=0;ii<8;ii+=1) 386 detStr = StringFromList(ii, ksDetectorListNoB, ";") 401 // if unable to load, skip correction and report error (Alert?) (Ask to Load?) 402 403 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 404 detStr = StringFromList(ii, ksDetectorListAll, ";") 387 405 Wave w = V_getDetectorDataW(fname,detStr) 388 406 Wave w_err = V_getDetectorDataErrW(fname,detStr) 389 Wave w_dt = V_getDetector_deadtime(fname,detStr)390 407 Print "Doing DIV correction for "+ detStr 391 // DIVCorrection(fill this in) 392 408 DIVCorrection(w,w_err,detStr,newType) 393 409 endfor 394 410 else … … 400 416 // generate a distance matrix for each of the detectors 401 417 if (gDoNonLinearCor == 1) 402 for(ii=0;ii< 8;ii+=1)403 detStr = StringFromList(ii, ksDetectorList NoB, ";")418 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 419 detStr = StringFromList(ii, ksDetectorListAll, ";") 404 420 Wave w = V_getDetectorDataW(fname,detStr) 405 421 Wave w_err = V_getDetectorDataErrW(fname,detStr) 406 Wave w_ dt = V_getDetector_deadtime(fname,detStr)422 Wave w_calib = V_getDetTube_spatialCalib(fname,detStr) 407 423 Print "Doing Non-linear correction for "+ detStr 408 424 // NonLinearCorrection(fill this in) … … 416 432 NVAR gDoSolidAngleCor = root:Packages:NIST:VSANS:Globals:gDoSolidAngleCor 417 433 if (gDoSolidAngleCor == 1) 418 for(ii=0;ii< 8;ii+=1)419 detStr = StringFromList(ii, ksDetectorList NoB, ";")434 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 435 detStr = StringFromList(ii, ksDetectorListAll, ";") 420 436 Wave w = V_getDetectorDataW(fname,detStr) 421 437 Wave w_err = V_getDetectorDataErrW(fname,detStr) … … 433 449 // -- test for correct operation 434 450 // -- loop over all of the detectors 435 // -- B detector is a special case 451 // -- B detector is a special case (do separately, then loop over NoB) 436 452 NVAR gDoDeadTimeCor = root:Packages:NIST:VSANS:Globals:gDoDeadTimeCor 437 453 ctTime = V_getCount_time(fname) 438 454 if (gDoDeadTimeCor == 1) 439 for(ii=0;ii< 8;ii+=1)440 detStr = StringFromList(ii, ksDetectorList NoB, ";")455 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 456 detStr = StringFromList(ii, ksDetectorListAll, ";") 441 457 Wave w = V_getDetectorDataW(fname,detStr) 442 458 Wave w_err = V_getDetectorDataErrW(fname,detStr) … … 472 488 NVAR gDoTrans = root:Packages:NIST:VSANS:Globals:gDoTransmissionCor 473 489 if (gDoTrans == 1) 474 for(ii=0;ii< 8;ii+=1)475 detStr = StringFromList(ii, ksDetectorList NoB, ";")490 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 491 detStr = StringFromList(ii, ksDetectorListAll, ";") 476 492 Wave w = V_getDetectorDataW(fname,detStr) 477 493 Wave w_err = V_getDetectorDataErrW(fname,detStr) … … 490 506 // TODO -- what do I really need to save? 491 507 defmon=1e8 //default monitor counts 492 for(ii=0;ii< 8;ii+=1)493 detStr = StringFromList(ii, ksDetectorList NoB, ";")508 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 509 detStr = StringFromList(ii, ksDetectorListAll, ";") 494 510 Wave w = V_getDetectorDataW(fname,detStr) 495 511 Wave w_err = V_getDetectorDataErrW(fname,detStr) … … 498 514 // MonitorNormalization(fill this in) 499 515 //scale the data to the default montor counts 500 scale = defmon/monCt 501 w *= scale 502 w_err *= scale //assumes total monitor count is so large there is essentially no error 503 516 517 // TODO -- un-comment these three lines once monitor counts are reasonable - currently monCt = 9!!! 518 // scale = defmon/monCt 519 // w *= scale 520 // w_err *= scale //assumes total monitor count is so large there is essentially no error 521 522 // TODO 523 // -- to write back to the local value, get the wave reference rather than the value, then I can 524 // re-assign the value directly, rather than this method (which is not terrible) 504 525 // V_getBeamMonNormSaved_count() 505 526 // save the true monitor counts? save the scaling factor? … … 537 558 // 538 559 //reset the current displaytype to "newtype" 539 String/G root: myGlobals:gDataDisplayType=newType560 String/G root:Packages:NIST:VSANS:Globals:gCurDispType=newType 540 561 541 562 //return to root folder (redundant)
Note: See TracChangeset
for help on using the changeset viewer.