Changeset 79 for sans/SANSReduction/branches
- Timestamp:
- Apr 10, 2007 9:52:03 AM (16 years ago)
- Location:
- sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/NCNR_Utils.ipf
r76 r79 6 6 // particular facility or data file format 7 7 // branched out 29MAR07 - SRK 8 8 // 9 // functions are either labeled with the procedure file that calls them, 10 // or noted that they are local to this file 9 11 10 12 … … 13 15 // - pixexl resolution [cm] 14 16 // - detector deadtime constant [s] 17 // 18 // called by Initialize.ipf 19 // 15 20 Function InitFacilityGlobals() 16 21 … … 46 51 // 47 52 // - 21 MAR 07 uses projected BS diameter on the detector 53 // - APR 07 still need to add resolution with lenses. currently there is no flag in the 54 // raw data header to indicate the presence of lenses. 55 // 56 // 57 // - called by CircSectAvg.ipf and RectAnnulAvg.ipf 48 58 // 49 59 Function/S getResolution(inQ,lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,del_r,SigmaQ,QBar,fSubS) … … 135 145 //from the file header 136 146 //Global values are set in the Initialize procedure 147 // 148 // 149 // - called by CircSectAvg.ipf, RectAnnulAvg.ipf, and ProtocolAsPanel.ipf 150 // 137 151 Function DetectorPixelResolution(fileStr,detStr) 138 152 String fileStr,detStr … … 182 196 //from the file header 183 197 //Global values are set in the Initialize procedure 198 // 199 // - called by WorkFileUtils.ipf 200 // 201 // 184 202 Function DetectorDeadtime(fileStr,detStr) 185 203 String fileStr,detStr … … 228 246 229 247 /////VAX filename/Run number parsing utilities 230 //************************** 231 // Vers. 1.2 092101 232 // 233 //this file is a collection of uilities for processing vax filenames 248 // 249 // a collection of uilities for processing vax filenames 234 250 //and processing lists (especially for display in popup menus) 235 251 // … … 241 257 // 242 258 //************************** 243 244 259 // 245 260 //given a filename of a SANS data filename of the form 246 261 //TTTTTnnn.SAn_TTT_Txxx 247 262 //returns the run number "nnn" as a number 248 263 //returns -1 as an invalid file number 264 // 265 // called by several ipfs 266 // 267 // 249 268 Function GetRunNumFromFile(item) 250 269 String item … … 283 302 //returns the run number "nnn" as a STRING of THREE characters 284 303 //returns "ABC" as an invalid file number 304 // 305 // local function to aid in locating files by run number 306 // 285 307 Function/S GetRunNumStrFromFile(item) 286 308 String item … … 306 328 End 307 329 308 //returns a string containing the full path and fileto the file containing the330 //returns a string containing the full path to the file containing the 309 331 //run number "num". The null string is returned if no valid file can be found 310 332 //the path "catPathName" used and is hard-wired, will abort if this path does not exist 311 333 //the file returned will be a RAW SANS data file, other types of files are 312 334 //filtered out. 335 // 336 // called by Buttons.ipf and Transmission.ipf, and locally by parsing routines 337 // 313 338 Function/S FindFileFromRunNumber(num) 314 339 Variable num … … 382 407 //Function then checks the file fname (full path:file) for "RAW" run.type field 383 408 //if not found, the data is not raw data and zero is returned 409 // 410 // called by many procedures (both external and local) 411 // 384 412 Function CheckIfRawData(fname) 385 413 String fname … … 389 417 390 418 Open/R/T="????TEXT" refNum as fname 391 //get the total number of bytes in the file , to avoid moving past EOF419 //get the total number of bytes in the file 392 420 FStatus refNum 393 421 totalBytes = V_logEOF … … 414 442 //xtol typically set at -5 (cm) - trans runs have bs(x) at -10 to -15 cm 415 443 // function returns 1 if beamstop is out, 0 if beamstop is in 444 // 445 // 446 // called by Transmission.ipf, CatVSTable.ipf, NSORT.ipf 416 447 // 417 448 Function isTransFile(fName,xTol) … … 449 480 // 450 481 //returns a string identical to the original string, except with the interior spaces removed 482 // 483 // local function for file name manipulation 451 484 // 452 485 Function/S RemoveAllSpaces(str) … … 477 510 478 511 479 //Function attempts to find valid filename from partial name that has been stripped of480 // the VAX version number. The partial name is tried first481 // *** the PATH is hard-wired to catPathName (which is assumed to exist)482 // version numers up to ;10 are tried483 // only the "name;vers" is returned. the path is not prepended, hence the return string484 // is not a complete specification of the file512 //Function attempts to find valid filename from partial name by checking for 513 // the existence of the file on disk. 514 // - checks as is 515 // - adds ";vers" for possible VAX files 516 // - strips spaces 517 // - permutations of upper/lowercase 485 518 // 486 519 // added 11/99 - uppercase and lowercase versions of the file are tried, if necessary … … 488 521 // upper/lowercase letters, while the filename on the server (should) be all caps 489 522 // now makes repeated calls to ValidFileString() 523 // 524 // returns a valid filename (No path prepended) or a null string 525 // 526 // called by any functions, both external and local 490 527 // 491 528 Function/S FindValidFilename(partialName) … … 533 570 End 534 571 535 //Function attempts to find valid filename from partial name that has been stripped of 536 //the VAX version number. The partial name is tried first 537 //*** the PATH is hard-wired to catPathName (which is assumed to exist) 538 //version numers up to ;10 are tried 539 //only the "name;vers" is returned. the path is not prepended, hence the return string 540 //is not a complete specification of the file 572 // Function checks for the existence of a file 573 // partialName;vers (to account for VAX filenaming conventions) 574 // The partial name is tried first with no version number 575 // 576 // *** the PATH is hard-wired to catPathName (which is assumed to exist) 577 // version numers up to ;10 are tried 578 // only the "name;vers" is returned if successful. The path is not prepended 579 // 580 // local function 541 581 // 542 582 Function/S ValidFileString(partialName) … … 581 621 End 582 622 583 584 585 586 623 //returns a string containing filename (WITHOUT the ;vers) 587 624 //the input string is a full path to the file (Mac-style, still works on Win in IGOR) 588 625 //with the folders separated by colons 626 // 627 // called by MaskUtils.ipf, ProtocolAsPanel.ipf, WriteQIS.ipf 628 // 589 629 Function/S GetFileNameFromPathNoSemi(fullPath) 590 630 String fullPath … … 613 653 //the input string is a full path to the file (Mac-style, still works on Win in IGOR) 614 654 //with the folders separated by colons 655 // 656 // local, currently unused 657 // 615 658 Function/S GetFileNameFromPathKeepSemi(fullPath) 616 659 String fullPath … … 638 681 //(Mac-style, separated by colons) and returns this path 639 682 //this partial path is the same string that would be returned from PathInfo, for example 683 // 684 // - allows the user to save to a different path than catPathName 685 // 686 // called by WriteQIS.ipf 687 // 640 688 Function/S GetPathStrFromfullName(fullPath) 641 689 String fullPath … … 660 708 //given the VAX filename, pull off the first 8 characters to make a valid 661 709 //file string that can be used for naming averaged 1-d files 710 // 711 // called by ProtocolAsPanel.ipf and Tile_2D.ipf 712 // 662 713 Function/S GetNameFromHeader(fullName) 663 714 String fullName … … 688 739 689 740 //list (input) is a list, typically returned from IndexedFile() 690 //which is semicolon-delimited, and may contain file snames from the VAX741 //which is semicolon-delimited, and may contain filenames from the VAX 691 742 //that contain version numbers, where the version number appears as a separate list item 692 743 //(and also as a non-existent file) … … 695 746 //the function returns the list, cleaned of version numbers (up to 11) 696 747 //raw data files will typically never have a version number other than 1. 748 // 749 // if there are no version numbers in the list, the input list is returned 750 // 751 // called by CatVSTable.ipf, NSORT.ipf, Transmission.ipf, WorkFileUtils.ipf 752 // 697 753 Function/S RemoveVersNumsFromList(list) 698 754 String list … … 716 772 //output is equivalent to selecting from the CAT table 717 773 //if some or all of the list items are valid filenames, keep them... 718 //if an error is encountered, notify of the offending element and return thenull list774 //if an error is encountered, notify of the offending element and return a null list 719 775 // 720 776 //output is COMMA delimited … … 722 778 // this routine is expecting that the "ask", "none" special cases are handled elsewhere 723 779 //and not passed here 780 // 781 // called by Marquee.ipf, MultipleReduce.ipf, ProtocolAsPanel.ipf 782 // 724 783 Function/S ParseRunNumberList(list) 725 784 String list … … 771 830 //expands any range of run numbers into a comma-delimited list... 772 831 //and returns the new list - if not a range, return unchanged 832 // 833 // local function 834 // 773 835 Function/S ExpandNumRanges(list) 774 836 String list … … 797 859 798 860 //be sure to add a trailing comma to the return string... 861 // 862 // local function 863 // 799 864 Function/S ListFromDash(item) 800 865 String item … … 824 889 //NG3 and NG7 attenuators are physically different, so the transmissions are slightly different 825 890 //NG1 - (8m SANS) is not supported 826 891 // 892 // local function 893 // 827 894 Proc MakeNG3AttenTable() 828 895 … … 895 962 //the wavelength may be any value between 5 and 20 (A), and is interpolated 896 963 //between calibrated wavelengths for a given attenuator 964 // 965 // local function 966 // 897 967 Function LookupAttenNG3(lambda,attenNo) 898 968 Variable lambda, attenNo … … 935 1005 // 936 1006 // this set of tables is also used for NG5 (NG1) SANS instrument - as the attenuator has yet to be calibrated 1007 // 1008 // local function 1009 // 937 1010 Function LookupAttenNG7(lambda,attenNo) 938 1011 Variable lambda, attenNo … … 974 1047 //values, and NG5 attenuators have not been calibrated (as of 8/01) 975 1048 //filestr as passed is textread[3], the default directory 1049 // 1050 // Attenuation factor as defined here is <= 1 1051 // 1052 // called by Correct.ipf, ProtocolAsPanel.ipf, Transmission.ipf 1053 // 976 1054 Function AttenuationFactor(fileStr,lam,attenNo) 977 1055 String fileStr … … 1000 1078 End 1001 1079 1002 //function called by tthe popups to get a file list of data that can be sorted1080 //function called by the popups to get a file list of data that can be sorted 1003 1081 // this procedure simply removes the raw data files from the string - there 1004 1082 //can be lots of other junk present, but this is very fast... … … 1008 1086 // another possibility is to get a listing of the text files, but is unreliable on 1009 1087 // Windows, where the data file must be .txt (and possibly OSX) 1088 // 1089 // called by FIT_Ops.ipf, NSORT.ipf, PlotUtils.ipf 1010 1090 // 1011 1091 Function/S ReducedDataFileList(ctrlName) … … 1047 1127 // does it the "cheap" way, simply finding the ".SAn" in the file name 1048 1128 // = does not check for proper byte length. 1129 // 1130 // called by PatchFiles.ipf, Tile_2D.ipf 1131 // 1049 1132 Function/S GetRawDataFileList() 1050 1133 -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/WorkFileUtils.ipf
r72 r79 804 804 // footing (zero atten) before doing the subtraction. 805 805 // 806 //correct for attenuation of the sample (at NG5, NG7 attenuator table is used)807 // Variable attenNo,attenFactor,lambda808 // String fileStr=textRead[3]809 // attenNo = realsRead[3]810 // lambda = realsRead[26]811 // attenFactor = AttenuationFactor(fileStr,lambda,attenNo)812 // data /= attenFactor //atten factor is less than one813 806 //Print "ABS data multiplied by ",s1*s2*s3*s4/attenFactor 814 807
Note: See TracChangeset
for help on using the changeset viewer.