Changeset 1044
- Timestamp:
- Jun 8, 2017 1:27:07 PM (6 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Utils.ipf
r1035 r1044 691 691 // but this is a lousy choice. 692 692 // x- binning is now Mask-aware. If mask is not present, all data is used. If data is from VCALC, all data is used 693 // -- Where do I put the solid angle correction? In here as a weight for each point, or later on as 694 // a blanket correction (matrix multiply) for an entire panel? 693 // x- Where do I put the solid angle correction? In here as a weight for each point, or later on as 694 // a blanket correction (matrix multiply) for an entire panel? (Solid Angle correction is done in the 695 // step where data is added to a WORK file (see Raw_to_Work()) 695 696 // 696 697 // … … 1214 1215 // just like in CircSectAve.ipf 1215 1216 // TODO: 1216 // -- 2D Errors were NOT properly acculumated above, so this loop of calculations is NOT MEANINGFUL (yet)1217 // -- 2D Errors were NOT properly acculumated through reduction, so this loop of calculations is NOT MEANINGFUL (yet) 1217 1218 // x- the error on the 1D intensity, is correctly calculated as the standard error of the mean. 1218 1219 for(ii=0;ii<nq;ii+=1) … … 1281 1282 while(val>0) 1282 1283 1284 // TODO: 1285 // -- is this where I do the resolution calculation? 1286 // -- or do I do it as a separate call? 1287 // -- use the isVCALC flag to exclude VCALC from the resolution calculation if necessary 1288 // 1289 1290 1291 1283 1292 SetDataFolder root: 1284 1293 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DataPlotting.ipf
r1042 r1044 110 110 111 111 // TODO 112 // -- winStr is currently hard-wired, but this may not be an issue112 // x- winStr is currently hard-wired, but this may not be an issue 113 113 Function V_Update1D_Graph(workType,binType) 114 114 String workType … … 408 408 SVAR type = root:Packages:NIST:VSANS:Globals:gCurDispType 409 409 410 V_QBinAllPanels (type,popNum)410 V_QBinAllPanels_Circular(type,popNum) 411 411 412 412 String str,winStr="V_1D_Data",workTypeStr -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DetectorCorrections.ipf
r1041 r1044 28 28 // 29 29 // TODO 30 // -- verify the direction of the tubes and indexing30 // x- verify the direction of the tubes and indexing 31 31 // x- decide on the appropriate functional form for the tubes 32 32 // x- need count time as input 33 // -- be sure I'm working in the right data folder34 // -- clean up when done35 // -- calculate + return the error contribution?36 // -- verify the error propagation33 // x- be sure I'm working in the right data folder (all waves are passed in) 34 // x- clean up when done 35 // x- calculate + return the error contribution? 36 // x- verify the error propagation 37 37 Function V_DeadTimeCorrectionTubes(dataW,data_errW,dtW,ctTime) 38 38 Wave dataW,data_errW,dtW … … 111 111 // TODO 112 112 // -- UNITS!!!! currently this is mm, which certainly doesn't match anything else!!! 113 // -- verify the direction of the tubes and indexing114 // -- be sure I'm working in the right data folder115 // -- clean up when done116 // -- calculate + return the error contribution?117 // -- do I want this to return a wave?118 // -- do I need to write a separate function that returns the distance wave for later calculations?119 // -- do I want to make the distance array 3D to keep the x and y dims together? Calculate them all right now?120 // -- what else do I need to pass to the function? (fname=folder? detStr?)121 // --need a separate block or function to handle "B" detector which will be ? different113 // x- verify the direction of the tubes and indexing 114 // x- be sure I'm working in the right data folder (it is passed in, and the full path is used) 115 // x- clean up when done 116 // x- calculate + return the error contribution? (there is none for this operation) 117 // x- do I want this to return a wave? (no, default names are generated) 118 // x- do I need to write a separate function that returns the distance wave for later calculations? 119 // x- do I want to make the distance array 3D to keep the x and y dims together? Calculate them all right now? 120 // x- what else do I need to pass to the function? (fname=folder? detStr?) 121 // y- (yes,see below) need a separate block or function to handle "B" detector which will be ? different 122 122 // 123 123 // … … 269 269 // -- verify where this needs to be done (if the beam center is changed) 270 270 // -- then the q-calculation needs to be re-done 271 // -- the position along the tube length is referenced to tube[0], for no particular reason 272 // It may be better to take an average? but [0] is an ASSUMPTION 273 // -- distance along tube is simple interpolation 274 // 275 // -- distance in the lateral direction is based on tube width, which is well known 271 // 272 // -- not much is known about the "B" detector, so this 273 // all hinges on the non-linear corrections being done correctly for that detector 276 274 // 277 275 // -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_FileCatalog.ipf
r1037 r1044 12 12 // 13 13 // TODO 14 // -- clean up and remove all of the references to other facilities, since they will not have VSANS modules14 // x- clean up and remove all of the references to other facilities, since they will not have VSANS modules 15 15 // -- add in more appropriate and some missing fields more useful to VSANS (intent, multiple beam centers, etc.) 16 16 // -- can I make the choice of columns customizable? There are "sets" of columns that are not used for … … 32 32 // will not be read in, the "bad" local copy will be read in. 33 33 // TODO: 34 // -- this *may* be a very slow operation. Warn users. Give them a choice to keep local copies. If34 // x- this *may* be a very slow operation. Warn users. Give them a choice to keep local copies. If 35 35 // the "patched" values are written locally too, then maybe the update from disk is not needed. 36 36 // But typically, I'd like to see that the disk version really did get updated... … … 159 159 160 160 // TODO: 161 // -- experimental hook with contextual menu161 // x- experimental hook with contextual menu 162 162 // 163 163 SetWindow kwTopWin hook=V_CatTableHook, hookevents=1 // mouse down events … … 170 170 // will not be read in, the "bad" local copy will be read in for any subsequent operations. 171 171 // TODO: 172 // -- this *may* be a very slow operation. Warn users. Give them a choice to keep local copies? If172 // x- this *may* be a very slow operation. Warn users. Give them a choice to keep local copies? If 173 173 // the "patched" values are written locally too, then maybe the update from disk is not needed. 174 174 // But typically, I'd like to see that the disk version really did get updated... … … 242 242 // 243 243 // clean out again, so that the file SAVE is not slow due to the large experiment size 244 // TODO -- decide if this is really necessary244 // TODO x- decide if this is really necessary (not necessary at this point) 245 245 // 246 246 // V_CleanOutRawVSANS() … … 255 255 // -- what else to add to the menu? (MSK and DIV now work) 256 256 // -- add directly to WORK files? 257 // -- "set" as some special file type, intent, use? 257 // -- "set" as some special file type, intent, use? (quick "patch" operations) 258 258 // -- "check" the reduction protocol for completeness? 259 259 // … … 453 453 454 454 // //read the file alphanumeric suffix 455 // // TODO -- this does not exist for VSANS - so is there an equivalent, or delete?455 // // TODO x- this does not exist for VSANS - so is there an equivalent, or delete? ((delete)) 456 456 // InsertPoints lastPoint,1,GSuffix 457 457 // GSuffix[lastPoint]="unknown" … … 482 482 483 483 //Attenuators 484 // TODO -- this is not really the number -- 484 // TODO -- this is not really the number -- but rather the thickness 485 485 InsertPoints lastPoint,1,GNumAttens 486 486 GNumAttens[lastPoint]=V_getAttenThickness(fname) … … 519 519 GRot[lastPoint]=V_getSampleRotationAngle(fname) 520 520 521 // TODO -- this is not yet implemented522 521 //Sample Temperature 523 522 InsertPoints lastPoint,1,GTemp 524 GTemp[lastPoint]= -273523 GTemp[lastPoint]=V_getSampleTemperature(fname) 525 524 526 525 // TODO -- this is not yet implemented 527 526 //Sample Field 528 527 InsertPoints lastPoint,1,GField 529 GField[lastPoint]= 1000528 GField[lastPoint]=-999 530 529 531 530 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_RW_Utils.ipf
r1042 r1044 22 22 23 23 // the list of WORK Folders 24 Strconstant ksWorkFolderList = "RAW;SAM;EMP;BGD;COR;DIV;ABS;MSK;CAL;STO;SUB;DRK;ADJ;VCALC;RawVSANS;" 24 // RawVSANS does not behave as a WORK folder, but it is local. so add it in explicitly to the list if needed 25 // VCALC behaves *almost* as a WORK folder, but it is local. so add it in explicitly to the list if needed 26 //Strconstant ksWorkFolderList = "RAW;SAM;EMP;BGD;COR;DIV;ABS;MSK;CAL;STO;SUB;DRK;ADJ;VCALC;RawVSANS;" 25 27 Strconstant ksWorkFolderListShort = "RAW;SAM;EMP;BGD;COR;DIV;ABS;MSK;CAL;STO;SUB;DRK;ADJ;" 26 28 … … 416 418 // endif 417 419 418 // if base_name is from my list of WORK folders , then base_name = ""420 // if base_name is from my list of WORK folders + RawVSANS;, then base_name = "" 419 421 // use a stringSwitch? WhichListItem? 420 Variable isFolder = WhichListItem(base_name,ksWorkFolderList )422 Variable isFolder = WhichListItem(base_name,ksWorkFolderListShort+"RawVSANS;") 421 423 if(isFolder != -1) 422 424 base_name = "" … … 516 518 517 519 // read a single real value 518 // - fname passed in is the full path to the file on disk 520 // - fname passed in is the full path to the file on disk --OR-- a WORK folder 519 521 // - path is the path to the value in the HDF tree 520 522 // 523 /// -- if data requested from a WORK or VCALC folder: 521 524 // check to see if the value exists (It will be a wave) 525 // -- if it does, return the value from the local WORK folder 526 // if it does not exist, return DUMMY value 527 // 528 //// -- if data requested from a file: 529 // check to see if the value exists locally in RawVSANS (It will be a wave) 522 530 // -- if it does, return the value from the local folder 523 531 // -- if not, read the file in, then return the value 524 532 // 525 // TODO: 526 // currently, the work folders have the following path - so passing in "RAW" as fname 527 // will take some re-configuring. 528 // root:Packages:NIST:VSANS:RAW:entry:instrument:detector_FL:distance 529 // -- be sure this read from work folders is not broken in the future, and is passed to ALL of the 530 // top-level R/W routines. (Write is necessary ONLY for SIM data files. Patch is direct to disk.) 533 // 531 534 Function V_getRealValueFromHDF5(fname,path) 532 535 String fname,path … … 534 537 String folderStr="" 535 538 Variable valExists=0 539 Variable errorValue = -999999 536 540 537 541 folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 538 542 539 // check for a work folder first (note that "entry" is now NOT doubled) 540 if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 541 Wave/Z w = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 542 return(w[0]) 543 endif 544 543 // (1) if requesting data from a WORK folder, get it, or report error 544 Variable isWORKFolder = WhichListItem(fname,ksWorkFolderListShort+"VCALC;") 545 if(isWORKFolder != -1) //requesting value from a WORK folder (not RawVSANS) 546 // check for a work folder first (note that "entry" is now NOT doubled) 547 if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 548 Wave/Z w = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 549 return(w[0]) 550 else 551 return(errorValue) 552 endif 553 endif 554 555 556 // (2) requesting from a file. 557 // look locally in RawVSANS if possible, or if not, load in the data from disk 558 // - if thee both fail, report an error 545 559 if(Exists(ksBaseDFPath+folderStr+":"+path)) 546 560 valExists=1 … … 560 574 return(w[0]) 561 575 else 562 return( -999999)576 return(errorValue) 563 577 endif 564 578 End … … 574 588 // -- if not, read the file in, then return the value 575 589 // 590 // if the wave is null, then that is returned, and the calling function is responsible 591 // 576 592 Function/WAVE V_getRealWaveFromHDF5(fname,path) 577 593 String fname,path … … 582 598 folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 583 599 584 // check for a work folder first (note that "entry" is NOT doubled) 585 if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 586 Wave wOut = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 587 return wOut 588 endif 589 600 // (1) if requesting data from a WORK folder, get it 601 // no need to check for any existence, null return is OK 602 Variable isWORKFolder = WhichListItem(fname,ksWorkFolderListShort+"VCALC;") 603 if(isWORKFolder != -1) //requesting value from a WORK folder (not RawVSANS) 604 // // check for a work folder first (note that "entry" is now NOT doubled) 605 // if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 606 Wave/Z wOut = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 607 return wOut 608 endif 609 610 //// check for a work folder first (note that "entry" is NOT doubled) 611 // if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 612 // Wave wOut = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 613 // return wOut 614 // endif 615 616 // (2) requesting from a file 590 617 if(Exists(ksBaseDFPath+folderStr+":"+path)) 591 618 valExists=1 … … 616 643 // -- if not, read the file in, then return the value 617 644 // 645 // if the wave is null, then that is returned, and the calling function is responsible 646 // 618 647 Function/WAVE V_getTextWaveFromHDF5(fname,path) 619 648 String fname,path … … 624 653 folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 625 654 626 // check for a work folder first (note that "entry" is NOT doubled) 627 if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 628 Wave/T wOut = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 629 return wOut 630 endif 631 655 // (1) if requesting data from a WORK folder, get it 656 // no need to check for any existence, null return is OK 657 Variable isWORKFolder = WhichListItem(fname,ksWorkFolderListShort+"VCALC;") 658 if(isWORKFolder != -1) //requesting value from a WORK folder (not RawVSANS) 659 // // check for a work folder first (note that "entry" is now NOT doubled) 660 // if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 661 Wave/Z/T wOut = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 662 return wOut 663 endif 664 665 //// check for a work folder first (note that "entry" is NOT doubled) 666 // if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 667 // Wave/T wOut = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 668 // return wOut 669 // endif 670 671 // (2) requesting from a file 632 672 if(Exists(ksBaseDFPath+folderStr+":"+path)) 633 673 valExists=1 … … 674 714 675 715 // read a single string 676 // - fname passed in is the full path to the file on disk 716 // - fname passed in is the full path to the file on disk --OR-- a WORK folder 677 717 // - path is the path to the value in the HDF tree 678 718 // - num is the number of characters in the VAX string 719 // 720 /// -- if data requested from a WORK or VCALC folder: 679 721 // check to see if the value exists (It will be a wave) 722 // -- if it does, return the value from the local WORK folder 723 // if it does not exist, return DUMMY value 724 // 725 //// -- if data requested from a file: 726 // check to see if the value exists locally in RawVSANS (It will be a wave) 680 727 // -- if it does, return the value from the local folder 681 728 // -- if not, read the file in, then return the value … … 691 738 String folderStr="" 692 739 Variable valExists=0 740 String errorString = "The specified wave does not exist: " + path 693 741 694 742 folderStr = V_RemoveDotExtension(V_GetFileNameFromPathNoSemi(fname)) 695 743 696 // check for a work folder first (note that "entry" is NOT doubled) 697 if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 698 Wave/Z/T tw = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 699 return(tw[0]) 700 endif 701 744 // (1) if requesting data from a WORK folder, get it, or report error 745 Variable isWORKFolder = WhichListItem(fname,ksWorkFolderListShort+"VCALC;") 746 if(isWORKFolder != -1) //requesting value from a WORK folder (not RawVSANS) 747 // check for a work folder first (note that "entry" is now NOT doubled) 748 if(Exists("root:Packages:NIST:VSANS:"+folderStr+":"+path)) 749 Wave/Z/T tw = $("root:Packages:NIST:VSANS:"+folderStr+":"+path) 750 return(tw[0]) 751 else 752 return(errorSTring) 753 endif 754 endif 755 756 // (2) requesting from a file. 757 // look locally in RawVSANS if possible, or if not, load in the data from disk 758 // - if thee both fail, report an error 702 759 if(Exists(ksBaseDFPath+folderStr+":"+path)) 703 760 valExists=1 … … 722 779 return(tw[0]) 723 780 else 724 return( "The specified wave does not exist: " + path)781 return(errorString) 725 782 endif 726 783 End -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Read.ipf
r1042 r1044 259 259 End 260 260 261 // TODO - should be the file name as saved on disk, currently it's not 262 Function/S V_getFile_name(fname) 263 String fname 264 265 String path = "entry:file_name" 266 Variable num=60 267 return(V_getStringFromHDF5(fname,path,num)) 268 End 269 270 // 271 Function/S V_getHDF_version(fname) 272 String fname 273 274 String path = "entry:hdf_version" 275 Variable num=60 276 return(V_getStringFromHDF5(fname,path,num)) 277 End 261 // cut in JUNE 2017 262 //// TODO - should be the file name as saved on disk, currently it's not 263 //Function/S V_getFile_name(fname) 264 // String fname 265 // 266 // String path = "entry:file_name" 267 // Variable num=60 268 // return(V_getStringFromHDF5(fname,path,num)) 269 //End 270 271 // cut in JUNE 2017 272 //// 273 //Function/S V_getHDF_version(fname) 274 // String fname 275 // 276 // String path = "entry:hdf_version" 277 // Variable num=60 278 // return(V_getStringFromHDF5(fname,path,num)) 279 //End 278 280 279 281 // TODO -- not mine, added somewhere by Nexus writer? … … 328 330 // TODO -- for the control section, document each of the fields 329 331 330 Function/S V_getCount_end(fname) 331 String fname 332 333 Variable num 334 String path = "entry:control:count_end" 335 return(V_getStringFromHDF5(fname,path,num)) 336 end 337 338 339 Function/S V_getCount_start(fname) 340 String fname 341 342 Variable num 343 String path = "entry:control:count_start" 344 return(V_getStringFromHDF5(fname,path,num)) 345 end 332 // cut in JUNE 2017 333 //Function/S V_getCount_end(fname) 334 // String fname 335 // 336 // Variable num 337 // String path = "entry:control:count_end" 338 // return(V_getStringFromHDF5(fname,path,num)) 339 //end 340 341 // cut in JUNE 2017 342 // 343 //Function/S V_getCount_start(fname) 344 // String fname 345 // 346 // Variable num 347 // String path = "entry:control:count_start" 348 // return(V_getStringFromHDF5(fname,path,num)) 349 //end 346 350 347 351 … … 377 381 end 378 382 379 380 Function V_getIntegral(fname) 381 String fname 382 383 String path = "entry:control:integral" 384 return(V_getRealValueFromHDF5(fname,path)) 385 end 383 // cut in JUNE 2017 384 // 385 //Function V_getIntegral(fname) 386 // String fname 387 // 388 // String path = "entry:control:integral" 389 // return(V_getRealValueFromHDF5(fname,path)) 390 //end 386 391 387 392 // control mode for data acquisition, "timer" … … 411 416 end 412 417 418 // cut in JUNE 2017 413 419 // TODO - what are the enumerated types for this? 414 Function/S V_getPreset(fname)415 String fname416 417 Variable num418 String path = "entry:control:preset"419 return(V_getStringFromHDF5(fname,path,num))420 end420 //Function/S V_getPreset(fname) 421 // String fname 422 // 423 // Variable num 424 // String path = "entry:control:preset" 425 // return(V_getStringFromHDF5(fname,path,num)) 426 //end 421 427 422 428 … … 2043 2049 End 2044 2050 2051 Function V_getSampleTemperature(fname) 2052 String fname 2053 2054 String path = "entry:sample:temperature" 2055 return(V_getRealValueFromHDF5(fname,path)) 2056 end 2057 2058 Function V_getSampleTempSetPoint(fname) 2059 String fname 2060 2061 String path = "entry:sample:temperature_setpoint" 2062 return(V_getRealValueFromHDF5(fname,path)) 2063 end 2064 2065 2045 2066 //Sample Thickness 2046 2067 // TODO -- somehow, this is not set correctly in the acquisition, so NaN results … … 2077 2098 2078 2099 2079 2100 // 2101 // TODO -- this is all a big mess with the changes in the data file structure 2102 // in JUNE 2017, which completely wrecks what was decided in 2016. 2103 // Now, I'm not sure at all what I'll get...or what the field will be called... or what they mean... 2104 // 2105 // 2080 2106 //// SAMPLE / DATA LOGS 2081 2107 // write this generic , call with the name of the environment log desired 2082 2108 // 2083 // temperature_1 2084 // temperature_2 2085 // temperature_3 2086 // temperature_4 2109 // 2087 2110 // shear_field 2088 2111 // pressure … … 2118 2141 End 2119 2142 2120 // TODO -- this may not exist if it is not a "controlling" sensor, but there still may be logged data present 2121 // TODO -- it may also have different names for each sensor (setpoint_1, setpoint_2, etc. which will be a big hassle) 2122 Function V_getLog_setPoint(fname,logStr) 2143 2144 2145 // for temperature only, logStr = "temperature_env" 2146 Function/S V_getTemp_ControlSensor(fname,logStr) 2123 2147 String fname,logStr 2124 2125 String path = "entry:sample:"+logstr+":setpoint_1" 2126 return(V_getRealValueFromHDF5(fname,path)) 2127 end 2128 2129 Function/S V_getLog_startTime(fname,logStr) 2148 2149 String path = "entry:sample:"+logstr+":control_sensor" 2150 Variable num=60 2151 return(V_getStringFromHDF5(fname,path,num)) 2152 End 2153 2154 // for temperature only, logStr = "temperature_env" 2155 Function/S V_getTemp_MonitorSensor(fname,logStr) 2130 2156 String fname,logStr 2131 2157 2132 String path = "entry:sample:"+logstr+":start" 2133 Variable num=60 2134 return(V_getStringFromHDF5(fname,path,num)) 2135 End 2136 2137 2138 // TODO -- this may only exist for electric field and magnetic field... 2139 // or may be elimnated altogether 2140 Function V_getLog_nomValue(fname,logStr) 2158 String path = "entry:sample:"+logstr+":monitor_sensor" 2159 Variable num=60 2160 return(V_getStringFromHDF5(fname,path,num)) 2161 End 2162 2163 2164 2165 //// TODO -- this may not exist if it is not a "controlling" sensor, but there still may be logged data present 2166 //// TODO -- it may also have different names for each sensor (setpoint_1, setpoint_2, etc. which will be a big hassle) 2167 //Function V_getLog_setPoint(fname,logStr) 2168 // String fname,logStr 2169 // 2170 // String path = "entry:sample:"+logstr+":setpoint_1" 2171 // return(V_getRealValueFromHDF5(fname,path)) 2172 //end 2173 // 2174 //Function/S V_getLog_startTime(fname,logStr) 2175 // String fname,logStr 2176 // 2177 // String path = "entry:sample:"+logstr+":start" 2178 // Variable num=60 2179 // return(V_getStringFromHDF5(fname,path,num)) 2180 //End 2181 // 2182 // 2183 //// TODO -- this may only exist for electric field and magnetic field... 2184 //// or may be eliminated altogether 2185 //Function V_getLog_nomValue(fname,logStr) 2186 // String fname,logStr 2187 // 2188 // String path = "entry:sample:"+logstr+":value" 2189 // return(V_getRealValueFromHDF5(fname,path)) 2190 //end 2191 2192 2193 2194 /////////// 2195 // for temperature, the "attached_to", "measurement", and "name" fields 2196 // are one level down farther than before, and down deeper than for other sensors 2197 // 2198 // 2199 // read the value of V_getTemp_MonitorSensor/ControlSensor to get the name of the sensor level . 2200 // 2201 2202 Function/S V_getTempLog_attachedTo(fname,logStr) 2141 2203 String fname,logStr 2142 2143 String path = "entry:sample:"+logstr+":value" 2144 return(V_getRealValueFromHDF5(fname,path)) 2145 end 2146 2204 2205 String path = "entry:sample:temperature_env:"+logstr+":attached_to" 2206 Variable num=60 2207 return(V_getStringFromHDF5(fname,path,num)) 2208 End 2209 2210 Function V_getTempLog_highTrip(fname,logStr) 2211 String fname,logStr 2212 2213 String path = "entry:sample:temperature_env:"+logstr+":high_trip_value" 2214 return(V_getRealValueFromHDF5(fname,path)) 2215 end 2216 2217 Function V_getTempLog_holdTime(fname,logStr) 2218 String fname,logStr 2219 2220 String path = "entry:sample:temperature_env:"+logstr+":hold_time" 2221 return(V_getRealValueFromHDF5(fname,path)) 2222 end 2223 2224 Function V_getTempLog_lowTrip(fname,logStr) 2225 String fname,logStr 2226 2227 String path = "entry:sample:temperature_env:"+logstr+":low_trip_value" 2228 return(V_getRealValueFromHDF5(fname,path)) 2229 end 2230 2231 Function/S V_getTempLog_measurement(fname,logStr) 2232 String fname,logStr 2233 2234 String path = "entry:sample:temperature_env:"+logstr+":measurement" 2235 Variable num=60 2236 return(V_getStringFromHDF5(fname,path,num)) 2237 End 2238 2239 2240 Function/S V_getTempLog_Model(fname,logStr) 2241 String fname,logStr 2242 2243 String path = "entry:sample:temperature_env:"+logstr+":model" 2244 Variable num=60 2245 return(V_getStringFromHDF5(fname,path,num)) 2246 End 2247 2248 Function/S V_getTempLog_Name(fname,logStr) 2249 String fname,logStr 2250 2251 String path = "entry:sample:temperature_env:"+logstr+":name" 2252 Variable num=60 2253 return(V_getStringFromHDF5(fname,path,num)) 2254 End 2255 2256 Function V_getTempLog_runControl(fname,logStr) 2257 String fname,logStr 2258 2259 String path = "entry:sample:temperature_env:"+logstr+":run_control" 2260 return(V_getRealValueFromHDF5(fname,path)) 2261 end 2262 2263 Function V_getTempLog_Setpoint(fname,logStr) 2264 String fname,logStr 2265 2266 String path = "entry:sample:temperature_env:"+logstr+":setpoint" 2267 return(V_getRealValueFromHDF5(fname,path)) 2268 end 2269 2270 Function/S V_getTempLog_ShortName(fname,logStr) 2271 String fname,logStr 2272 2273 String path = "entry:sample:temperature_env:"+logstr+":short_name" 2274 Variable num=60 2275 return(V_getStringFromHDF5(fname,path,num)) 2276 End 2277 2278 Function V_getTempLog_Timeout(fname,logStr) 2279 String fname,logStr 2280 2281 String path = "entry:sample:temperature_env:"+logstr+":timeout" 2282 return(V_getRealValueFromHDF5(fname,path)) 2283 end 2284 2285 Function V_getTempLog_Tolerance(fname,logStr) 2286 String fname,logStr 2287 2288 String path = "entry:sample:temperature_env:"+logstr+":tolerance" 2289 return(V_getRealValueFromHDF5(fname,path)) 2290 end 2291 2292 Function V_getTempLog_ToleranceBand(fname,logStr) 2293 String fname,logStr 2294 2295 String path = "entry:sample:temperature_env:"+logstr+":tolerance_band_time" 2296 return(V_getRealValueFromHDF5(fname,path)) 2297 end 2298 2299 Function V_getTempLog_Value(fname,logStr) 2300 String fname,logStr 2301 2302 String path = "entry:sample:temperature_env:"+logstr+":value" 2303 return(V_getRealValueFromHDF5(fname,path)) 2304 end 2305 2306 2307 2308 2309 2310 2311 // 2312 // temperature_env:temp_Internal_1:value_log 2313 // 2147 2314 //// value_log (data folder) 2148 2315 // 2316 // TODO: 2317 // -- be sure that the calling function properly calls for temperture 2318 // logs which are down an extra layer: 2319 // for example, logStr = "temperature_env:temp_Internal_1" 2320 // 2321 // read the value of V_getTemp_MonitorSensor to get the name of the sensor the next level down. 2322 // 2149 2323 Function V_getLog_avgValue(fname,logStr) 2150 2324 String fname,logStr … … 2184 2358 // DONE -- this needs to be a WAVE reference 2185 2359 // DONE -- verify that the field is really read in as "time0" 2186 Function V_getLog_time (fname,logStr,outW)2360 Function V_getLog_timeWave(fname,logStr,outW) 2187 2361 String fname,logStr 2188 2362 Wave outW … … 2196 2370 2197 2371 // DONE -- this needs to be a WAVE reference 2198 Function V_getLog_Value (fname,logStr,outW)2372 Function V_getLog_ValueWave(fname,logStr,outW) 2199 2373 String fname,logStr 2200 2374 Wave outW -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Write.ipf
r1041 r1044 5808 5808 5809 5809 // 5810 // TODO -- I need to make sure that this is an integer in the JSON definition5811 // -- currently a text value in the data file - see trac ticket5810 // TODO x- I need to make sure that this is an integer in the JSON definition 5811 // x- currently a text value in the data file - see trac ticket 5812 5812 // x- this is also a duplicated field in the reduction block (reduction/group_id is no longer used) 5813 5813 // … … 5894 5894 End 5895 5895 5896 5897 5898 //Sample Temperature 5899 Function V_writeSampleTemperature(fname,val) 5900 String fname 5901 Variable val 5902 5903 // String path = "entry:sample:temperature" 5904 5905 Make/O/D/N=1 wTmpWrite 5906 // Make/O/R/N=1 wTmpWrite 5907 String groupName = "/entry/sample" 5908 String varName = "temperature" 5909 wTmpWrite[0] = val 5910 5911 variable err 5912 err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 5913 if(err) 5914 Print "HDF write err = ",err 5915 endif 5916 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 5917 // err = V_KillNamedDataFolder(fname) 5918 // if(err) 5919 // Print "DataFolder kill err = ",err 5920 // endif 5921 return(err) 5922 end 5923 5924 5925 //Sample Temperature set point 5926 Function V_writeSampleTempSetPoint(fname,val) 5927 String fname 5928 Variable val 5929 5930 // String path = "entry:sample:temperature_setpoint" 5931 5932 Make/O/D/N=1 wTmpWrite 5933 // Make/O/R/N=1 wTmpWrite 5934 String groupName = "/entry/sample" 5935 String varName = "temperature_setpoint" 5936 wTmpWrite[0] = val 5937 5938 variable err 5939 err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 5940 if(err) 5941 Print "HDF write err = ",err 5942 endif 5943 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 5944 // err = V_KillNamedDataFolder(fname) 5945 // if(err) 5946 // Print "DataFolder kill err = ",err 5947 // endif 5948 return(err) 5949 end 5950 5951 5896 5952 //Sample Thickness 5897 5953 // TODO -- somehow, this is not set correctly in the acquisition, so NaN results … … 5921 5977 end 5922 5978 5979 5923 5980 //Sample Translation 5924 5981 Function V_writeSampleTranslation(fname,val) … … 6004 6061 // write this generic , call with the name of the environment log desired 6005 6062 // 6006 // temperature_1 6007 // temperature_2 6008 // temperature_3 6009 // temperature_4 6063 // 6010 6064 // shear_field 6011 6065 // pressure … … 6093 6147 6094 6148 6095 // TODO -- this may require multiple entries, for each sensor _1, _2, etc. 6096 Function V_writeLog_setPoint(fname,logStr,val) 6149 //// TODO -- this may require multiple entries, for each sensor _1, _2, etc. 6150 //Function V_writeLog_setPoint(fname,logStr,val) 6151 // String fname,logStr 6152 // Variable val 6153 // 6154 //// String path = "entry:sample:"+logstr+":setpoint_1" 6155 // 6156 // Make/O/D/N=1 wTmpWrite 6157 //// Make/O/R/N=1 wTmpWrite 6158 // String groupName = "/entry/sample/"+logStr 6159 // String varName = "setpoint_1" 6160 // wTmpWrite[0] = val 6161 // 6162 // variable err 6163 // err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 6164 // if(err) 6165 // Print "HDF write err = ",err 6166 // endif 6167 // // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6168 //// err = V_KillNamedDataFolder(fname) 6169 //// if(err) 6170 //// Print "DataFolder kill err = ",err 6171 //// endif 6172 // return(err) 6173 //end 6174 // 6175 //Function V_writeLog_startTime(fname,logStr,str) 6176 // String fname,logStr,str 6177 // 6178 //// String path = "entry:sample:"+logstr+":start" 6179 // 6180 // Make/O/T/N=1 tmpTW 6181 // String groupName = "/entry/sample/"+logStr 6182 // String varName = "start" 6183 // tmpTW[0] = str // 6184 // 6185 // variable err 6186 // err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 6187 // if(err) 6188 // Print "HDF write err = ",err 6189 // endif 6190 // 6191 // // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6192 //// err = V_KillNamedDataFolder(fname) 6193 //// if(err) 6194 //// Print "DataFolder kill err = ",err 6195 //// endif 6196 // 6197 // return(err) 6198 //End 6199 // 6200 // 6201 //// TODO -- this may only exist for electric and magnetic field, or be removed 6202 //Function V_writeLog_nomValue(fname,logStr,val) 6203 // String fname,logStr 6204 // Variable val 6205 // 6206 //// String path = "entry:sample:"+logstr+":value" 6207 // 6208 // Make/O/D/N=1 wTmpWrite 6209 //// Make/O/R/N=1 wTmpWrite 6210 // String groupName = "/entry/sample/"+logStr 6211 // String varName = "value" 6212 // wTmpWrite[0] = val 6213 // 6214 // variable err 6215 // err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 6216 // if(err) 6217 // Print "HDF write err = ",err 6218 // endif 6219 // // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6220 //// err = V_KillNamedDataFolder(fname) 6221 //// if(err) 6222 //// Print "DataFolder kill err = ",err 6223 //// endif 6224 // return(err) 6225 //end 6226 6227 6228 // for temperature only, logStr must be "temperature_env" 6229 Function V_writeTempLog_ControlSensor(fname,logStr,str) 6230 String fname,logStr,str 6231 6232 // String path = "entry:sample:"+logstr+":control_sensor" 6233 6234 Make/O/T/N=1 tmpTW 6235 String groupName = "/entry/sample/"+logStr 6236 String varName = "control_sensor" 6237 tmpTW[0] = str // 6238 6239 variable err 6240 err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 6241 if(err) 6242 Print "HDF write err = ",err 6243 endif 6244 6245 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6246 // err = V_KillNamedDataFolder(fname) 6247 // if(err) 6248 // Print "DataFolder kill err = ",err 6249 // endif 6250 6251 return(err) 6252 End 6253 6254 // for temperature only, logStr must be "temperature_env" 6255 Function V_writeTempLog_MonitorSensor(fname,logStr,str) 6256 String fname,logStr,str 6257 6258 // String path = "entry:sample:"+logstr+":monitor_sensor" 6259 6260 Make/O/T/N=1 tmpTW 6261 String groupName = "/entry/sample/"+logStr 6262 String varName = "monitor_sensor" 6263 tmpTW[0] = str // 6264 6265 variable err 6266 err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 6267 if(err) 6268 Print "HDF write err = ",err 6269 endif 6270 6271 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6272 // err = V_KillNamedDataFolder(fname) 6273 // if(err) 6274 // Print "DataFolder kill err = ",err 6275 // endif 6276 6277 return(err) 6278 End 6279 6280 6281 6282 //////////////////// 6283 // 6284 /////////// 6285 // NOTE 6286 // 6287 // for temperature, the "attached_to", "measurement", and "name" fields 6288 // are one level down farther than before, and down deeper than for other sensors 6289 // 6290 // 6291 // read the value of V_getTemp_MonitorSensor/ControlSensor to get the name of the sensor level . 6292 // 6293 6294 Function V_writeTempLog_attachedTo(fname,logStr,str) 6295 String fname,logStr,str 6296 6297 // String path = "entry:sample:temperature_env:"+logstr+":attached_to" 6298 6299 Make/O/T/N=1 tmpTW 6300 String groupName = "/entry/sample/temperature_env/"+logStr 6301 String varName = "attached_to" 6302 tmpTW[0] = str // 6303 6304 variable err 6305 err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 6306 if(err) 6307 Print "HDF write err = ",err 6308 endif 6309 6310 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6311 // err = V_KillNamedDataFolder(fname) 6312 // if(err) 6313 // Print "DataFolder kill err = ",err 6314 // endif 6315 6316 return(err) 6317 End 6318 6319 6320 Function V_writeTempLog_highTrip(fname,logStr,val) 6097 6321 String fname,logStr 6098 6322 Variable val 6099 6323 6100 // String path = "entry:sample:"+logstr+":setpoint_1" 6101 6102 Make/O/D/N=1 wTmpWrite 6103 // Make/O/R/N=1 wTmpWrite 6104 String groupName = "/entry/sample/"+logStr 6105 String varName = "setpoint_1" 6106 wTmpWrite[0] = val 6107 6108 variable err 6109 err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 6110 if(err) 6111 Print "HDF write err = ",err 6112 endif 6113 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6114 // err = V_KillNamedDataFolder(fname) 6115 // if(err) 6116 // Print "DataFolder kill err = ",err 6117 // endif 6118 return(err) 6119 end 6120 6121 Function V_writeLog_startTime(fname,logStr,str) 6324 // String path = "entry:sample:temperature_env:"+logstr+":high_trip_value" 6325 6326 Make/O/D/N=1 wTmpWrite 6327 // Make/O/R/N=1 wTmpWrite 6328 String groupName = "/entry/sample/temperature_env/"+logStr 6329 String varName = "high_trip_value" 6330 wTmpWrite[0] = val 6331 6332 variable err 6333 err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 6334 if(err) 6335 Print "HDF write err = ",err 6336 endif 6337 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6338 // err = V_KillNamedDataFolder(fname) 6339 // if(err) 6340 // Print "DataFolder kill err = ",err 6341 // endif 6342 return(err) 6343 end 6344 6345 Function V_writeTempLog_holdTime(fname,logStr,val) 6346 String fname,logStr 6347 Variable val 6348 6349 // String path = "entry:sample:temperature_env:"+logstr+":hold_time" 6350 6351 Make/O/D/N=1 wTmpWrite 6352 // Make/O/R/N=1 wTmpWrite 6353 String groupName = "/entry/sample/temperature_env/"+logStr 6354 String varName = "hold_time" 6355 wTmpWrite[0] = val 6356 6357 variable err 6358 err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 6359 if(err) 6360 Print "HDF write err = ",err 6361 endif 6362 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6363 // err = V_KillNamedDataFolder(fname) 6364 // if(err) 6365 // Print "DataFolder kill err = ",err 6366 // endif 6367 return(err) 6368 end 6369 6370 Function V_writeTempLog_lowTrip(fname,logStr,val) 6371 String fname,logStr 6372 Variable val 6373 6374 // String path = "entry:sample:temperature_env:"+logstr+":low_trip_value" 6375 6376 Make/O/D/N=1 wTmpWrite 6377 // Make/O/R/N=1 wTmpWrite 6378 String groupName = "/entry/sample/temperature_env/"+logStr 6379 String varName = "low_trip_value" 6380 wTmpWrite[0] = val 6381 6382 variable err 6383 err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 6384 if(err) 6385 Print "HDF write err = ",err 6386 endif 6387 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6388 // err = V_KillNamedDataFolder(fname) 6389 // if(err) 6390 // Print "DataFolder kill err = ",err 6391 // endif 6392 return(err) 6393 end 6394 6395 Function V_writeTempLog_measurement(fname,logStr,str) 6122 6396 String fname,logStr,str 6123 6397 6124 // String path = "entry:sample:"+logstr+":start" 6125 6126 Make/O/T/N=1 tmpTW 6127 String groupName = "/entry/sample/"+logStr 6128 String varName = "start" 6129 tmpTW[0] = str // 6130 6131 variable err 6132 err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 6133 if(err) 6134 Print "HDF write err = ",err 6135 endif 6136 6137 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6138 // err = V_KillNamedDataFolder(fname) 6139 // if(err) 6140 // Print "DataFolder kill err = ",err 6141 // endif 6142 6143 return(err) 6144 End 6145 6146 6147 // TODO -- this may only exist for electric and magnetic field, or be removed 6148 Function V_writeLog_nomValue(fname,logStr,val) 6398 // String path = "entry:sample:temperature_env:"+logstr+":measurement" 6399 6400 Make/O/T/N=1 tmpTW 6401 String groupName = "/entry/sample/temperature_env/"+logStr 6402 String varName = "measurement" 6403 tmpTW[0] = str // 6404 6405 variable err 6406 err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 6407 if(err) 6408 Print "HDF write err = ",err 6409 endif 6410 6411 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6412 // err = V_KillNamedDataFolder(fname) 6413 // if(err) 6414 // Print "DataFolder kill err = ",err 6415 // endif 6416 6417 return(err) 6418 End 6419 6420 Function V_writeTempLog_model(fname,logStr,str) 6421 String fname,logStr,str 6422 6423 // String path = "entry:sample:temperature_env:"+logstr+":model" 6424 6425 Make/O/T/N=1 tmpTW 6426 String groupName = "/entry/sample/temperature_env/"+logStr 6427 String varName = "model" 6428 tmpTW[0] = str // 6429 6430 variable err 6431 err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 6432 if(err) 6433 Print "HDF write err = ",err 6434 endif 6435 6436 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6437 // err = V_KillNamedDataFolder(fname) 6438 // if(err) 6439 // Print "DataFolder kill err = ",err 6440 // endif 6441 6442 return(err) 6443 End 6444 6445 Function V_writeTempLog_name(fname,logStr,str) 6446 String fname,logStr,str 6447 6448 // String path = "entry:sample:temperature_env:"+logstr+":name" 6449 6450 Make/O/T/N=1 tmpTW 6451 String groupName = "/entry/sample/temperature_env/"+logStr 6452 String varName = "name" 6453 tmpTW[0] = str // 6454 6455 variable err 6456 err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 6457 if(err) 6458 Print "HDF write err = ",err 6459 endif 6460 6461 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6462 // err = V_KillNamedDataFolder(fname) 6463 // if(err) 6464 // Print "DataFolder kill err = ",err 6465 // endif 6466 6467 return(err) 6468 End 6469 6470 Function V_writeTempLog_runControl(fname,logStr,val) 6149 6471 String fname,logStr 6150 6472 Variable val 6151 6473 6152 // String path = "entry:sample:"+logstr+":value" 6153 6154 Make/O/D/N=1 wTmpWrite 6155 // Make/O/R/N=1 wTmpWrite 6156 String groupName = "/entry/sample/"+logStr 6474 // String path = "entry:sample:temperature_env:"+logstr+":run_control" 6475 6476 Make/O/D/N=1 wTmpWrite 6477 // Make/O/R/N=1 wTmpWrite 6478 String groupName = "/entry/sample/temperature_env/"+logStr 6479 String varName = "run_control" 6480 wTmpWrite[0] = val 6481 6482 variable err 6483 err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 6484 if(err) 6485 Print "HDF write err = ",err 6486 endif 6487 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6488 // err = V_KillNamedDataFolder(fname) 6489 // if(err) 6490 // Print "DataFolder kill err = ",err 6491 // endif 6492 return(err) 6493 end 6494 6495 Function V_writeTempLog_setPoint(fname,logStr,val) 6496 String fname,logStr 6497 Variable val 6498 6499 // String path = "entry:sample:temperature_env:"+logstr+":setpoint" 6500 6501 Make/O/D/N=1 wTmpWrite 6502 // Make/O/R/N=1 wTmpWrite 6503 String groupName = "/entry/sample/temperature_env/"+logStr 6504 String varName = "setpoint" 6505 wTmpWrite[0] = val 6506 6507 variable err 6508 err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 6509 if(err) 6510 Print "HDF write err = ",err 6511 endif 6512 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6513 // err = V_KillNamedDataFolder(fname) 6514 // if(err) 6515 // Print "DataFolder kill err = ",err 6516 // endif 6517 return(err) 6518 end 6519 6520 Function V_writeTempLog_shortName(fname,logStr,str) 6521 String fname,logStr,str 6522 6523 // String path = "entry:sample:temperature_env:"+logstr+":short_name" 6524 6525 Make/O/T/N=1 tmpTW 6526 String groupName = "/entry/sample/temperature_env/"+logStr 6527 String varName = "short_name" 6528 tmpTW[0] = str // 6529 6530 variable err 6531 err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 6532 if(err) 6533 Print "HDF write err = ",err 6534 endif 6535 6536 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6537 // err = V_KillNamedDataFolder(fname) 6538 // if(err) 6539 // Print "DataFolder kill err = ",err 6540 // endif 6541 6542 return(err) 6543 End 6544 6545 Function V_writeTempLog_timeout(fname,logStr,val) 6546 String fname,logStr 6547 Variable val 6548 6549 // String path = "entry:sample:temperature_env:"+logstr+":timeout" 6550 6551 Make/O/D/N=1 wTmpWrite 6552 // Make/O/R/N=1 wTmpWrite 6553 String groupName = "/entry/sample/temperature_env/"+logStr 6554 String varName = "timeout" 6555 wTmpWrite[0] = val 6556 6557 variable err 6558 err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 6559 if(err) 6560 Print "HDF write err = ",err 6561 endif 6562 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6563 // err = V_KillNamedDataFolder(fname) 6564 // if(err) 6565 // Print "DataFolder kill err = ",err 6566 // endif 6567 return(err) 6568 end 6569 6570 Function V_writeTempLog_tolerance(fname,logStr,val) 6571 String fname,logStr 6572 Variable val 6573 6574 // String path = "entry:sample:temperature_env:"+logstr+":tolerance" 6575 6576 Make/O/D/N=1 wTmpWrite 6577 // Make/O/R/N=1 wTmpWrite 6578 String groupName = "/entry/sample/temperature_env/"+logStr 6579 String varName = "tolerance" 6580 wTmpWrite[0] = val 6581 6582 variable err 6583 err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 6584 if(err) 6585 Print "HDF write err = ",err 6586 endif 6587 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6588 // err = V_KillNamedDataFolder(fname) 6589 // if(err) 6590 // Print "DataFolder kill err = ",err 6591 // endif 6592 return(err) 6593 end 6594 6595 Function V_writeTempLog_toleranceBand(fname,logStr,val) 6596 String fname,logStr 6597 Variable val 6598 6599 // String path = "entry:sample:temperature_env:"+logstr+":tolerance_band_time" 6600 6601 Make/O/D/N=1 wTmpWrite 6602 // Make/O/R/N=1 wTmpWrite 6603 String groupName = "/entry/sample/temperature_env/"+logStr 6604 String varName = "tolerance_band_time" 6605 wTmpWrite[0] = val 6606 6607 variable err 6608 err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 6609 if(err) 6610 Print "HDF write err = ",err 6611 endif 6612 // now be sure to kill the data folder to force a re-read of the data next time this file is read in 6613 // err = V_KillNamedDataFolder(fname) 6614 // if(err) 6615 // Print "DataFolder kill err = ",err 6616 // endif 6617 return(err) 6618 end 6619 6620 Function V_writeTempLog_Value(fname,logStr,val) 6621 String fname,logStr 6622 Variable val 6623 6624 // String path = "entry:sample:temperature_env:"+logstr+":value" 6625 6626 Make/O/D/N=1 wTmpWrite 6627 // Make/O/R/N=1 wTmpWrite 6628 String groupName = "/entry/sample/temperature_env/"+logStr 6157 6629 String varName = "value" 6158 6630 wTmpWrite[0] = val … … 6171 6643 end 6172 6644 6645 6646 6647 6648 6649 // 6650 // temperature_env:temp_Internal_1:value_log 6651 // 6652 //// value_log (data folder) 6653 // 6654 // TODO: 6655 // -- be sure that the calling function properly calls for temperture 6656 // logs which are down an extra layer: 6657 // for example, logStr = "temperature_env:temp_Internal_1" 6658 // 6659 // read the value of V_getTemp_MonitorSensor to get the name of the sensor the next level down. 6660 // 6661 // 6662 ///////////////////////////////////// 6173 6663 //// value_log (data folder) 6174 6664 // … … 6303 6793 // TODO -- this needs to be a WAVE reference 6304 6794 // be sure this gets written as "time", even though it is read in as "time0" 6305 Function V_writeLog_time (fname,logStr,inW)6795 Function V_writeLog_timeWave(fname,logStr,inW) 6306 6796 String fname,logStr 6307 6797 Wave inW … … 6332 6822 6333 6823 // TODO -- this needs to be a WAVE reference 6334 Function V_writeLog_Value (fname,logStr,inW)6824 Function V_writeLog_ValueWave(fname,logStr,inW) 6335 6825 String fname,logStr 6336 6826 Wave inW … … 6358 6848 return(err) 6359 6849 end 6850 6851 6852 6853 6854 6360 6855 6361 6856 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_IQ_Utilities.ipf
r1042 r1044 81 81 end 82 82 83 Function V_QBinAllPanels(folderStr,binType) 83 // 84 // TODO -- binType == 4 (slit mode) should never end up here 85 // -- new logic in calling routines to dispatch to proper routine 86 // -- AND need to write the routine for binning_SlitMode 87 // 88 Function V_QBinAllPanels_Circular(folderStr,binType) 84 89 String folderStr 85 90 Variable binType -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Initialize.ipf
r1040 r1044 138 138 //check platform, so Angstrom can be drawn correctly 139 139 140 //TODO - this is different on Igor 7. Macintosh # has been updated, but Windows has not140 //TODO -- this is different on Igor 7. Macintosh # has been updated, but Windows has not 141 141 // use Print char2num("Ã 142 142 ") to find the magic number … … 154 154 endif 155 155 156 // TODO -- find the SANS preferences, copy over and update for VSANS157 // -- these are all in PlotUtilsMacro_v40.ipf as the preferences are set up as common156 // TODO x- find the SANS preferences, copy over and update for VSANS 157 // x- these are all in PlotUtilsMacro_v40.ipf as the preferences are set up as common 158 158 // to all packages. I'm not sure that I want to do this with VSANS, but make the packages 159 159 // separate entities. I'm seeing little benefit of the crossover, especially now that … … 279 279 280 280 // TODO 281 // do I need to make the protocols any longer for VSANS? 281 // do I need to make the protocols any longer for VSANS? (yes -- now 12 points) 282 282 // What other options for processing / averaging / saving are needed?? 283 283 // - TODO 284 // -- likely that I'll want to have #pts to cut from I(q) as input to NSORT within the protocol so that the284 // x- likely that I'll want to have #pts to cut from I(q) as input to NSORT within the protocol so that the 285 285 // entire reduction can be automatic 286 286 // … … 289 289 // -- all protocols are kept in the root:Packages:NIST:VSANS:Globals:Protocols folder, created here 290 290 // 291 // 292 //*****as of 05_2017, protocols are 12 points long, [6] is used for work.drk, [7,8] are for trimmig points, and [9,11] are currently unused 293 // 291 294 Function V_InitFakeProtocols() 292 295 293 //*****as of 05_2017, protocols are 12 points long, [6] is used for work.drk, [7,8] are for trimmig points, and [9,11] are currently unused294 296 NewDataFolder/O root:Packages:NIST:VSANS:Globals:Protocols 295 297 Make/O/T $"root:Packages:NIST:VSANS:Globals:Protocols:Base"={"none","none","ask","ask","none","AVTYPE=Circular;SAVE=Yes;NAME=Manual;PLOT=Yes","DRK=none,DRKMODE=0,","","","","",""} -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Marquee_Operations.ipf
r1041 r1044 12 12 // 13 13 // -- writing the box coordinates and the counts (and error) to the data file 14 // -- determining the beam center (centroid) of the selection + writing this to the file 14 // x- determining the beam center (centroid) of the selection 15 // -- writing beam center (centroid) to the file? 15 16 // -- a box sum over a range of files (with a plot) 16 17 // -- box sum over annular regions -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf
r1043 r1044 2388 2388 2389 2389 2390 // 2391 // TODO: 2392 // -- do I calculate the proper resolution here? I've already decoded the binning type 2393 // and the averaging type has been specified by the protocol 2394 // -- if I calculate the resolution here, then the Trimming routines must be updated 2395 // to trim the resolution waves also. This positioning may work for 2396 // pinhole resolution, but anything using the matrix method - it won't work - and I'll need 2397 // a different solution 2398 // 2390 2399 strswitch(av_type) //dispatch to the proper routine to average to 1D data 2391 2400 case "none": … … 2408 2417 break 2409 2418 case "Circular": 2410 // CircularAverageTo1D(activeType) 2411 V_QBinAllPanels (activeType,binType) // this does a default circular average2419 2420 V_QBinAllPanels_Circular(activeType,binType) // this does a default circular average 2412 2421 break 2413 2422 case "Sector": -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Test_RAW_Panel.ipf
r1043 r1044 819 819 // 820 820 // -- currently just the graph, no controls 821 // -- this re-bins the data every time by calling V_QBinAllPanels(folderStr,binType) 821 // -- this re-bins the data every time by calling V_QBinAllPanels(folderStr,binType) from inside V_BinningModePopup() 822 822 Function V_IvsQPanelButtonProc(ba) : ButtonControl 823 823 STRUCT WMButtonAction &ba -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Testing_Data_Procs.ipf
r1028 r1044 120 120 121 121 // reduction group_id 122 // TODO -skip for now. group_id is incorrectly written to the data file as a text value. trac ticket122 // TODO x- (file has been corected)skip for now. group_id is incorrectly written to the data file as a text value. trac ticket 123 123 // has been written to fix in the future. 124 // V_writeReduction_group_ID(fileName,group_id)124 V_writeSample_GroupID(fileName,group_id) 125 125 126 126 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Utilities_General.ipf
r1035 r1044 124 124 // NOTE -- use V_CleanupData_w_Progress(0,1) to get a progress bar - since this will take more than 125 125 // a few seconds to complete, especially if a file catalog was done, or a "batch" patching, etc. 126 // 127 // *** this appears to be unused, in favor of V_CleanupData_w_Progress(0,1) ********** 126 128 // 127 129 Function V_CleanOutRawVSANS() … … 493 495 494 496 // TODO 495 // -- update the 1D plotting as needed. these are SANS calls (OK for now, but will need to be better)497 // x- update the 1D plotting as needed. these are SANS calls (OK for now, but will need to be better) 496 498 //do the average and plot (either the default, or what is on the panel currently) 497 499 SVAR type = root:Packages:NIST:VSANS:Globals:gCurDispType … … 642 644 End 643 645 644 // TODO -- need to fill in correctly by determining this from the INTENT field646 // TODO x- need to fill in correctly by determining this from the INTENT field 645 647 // 646 648 Function V_isTransFile(fname) … … 650 652 String testStr="" 651 653 652 // testStr = V_getInstrumentName(fname)653 654 if(cmpstr(testStr," NG3-VSANS") == 0) //wrong test655 // testStr exists, ASSUMING it's a raw VSANS datafile654 testStr = V_getReduction_intent(fname) 655 656 if(cmpstr(testStr,"TRANSMISSION") == 0) // 657 //yes, a transmission file 656 658 Return(1) 657 659 else 658 //some other file 660 //some other file intent 659 661 Return(0) 660 662 Endif
Note: See TracChangeset
for help on using the changeset viewer.