Changeset 82 for sans/SANSReduction
- Timestamp:
- Apr 11, 2007 12:21:15 PM (16 years ago)
- Location:
- sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/CatVSTable.ipf
r76 r82 314 314 // 0 if the file is a scattering file, 1 (truth) if the file is a transmission file 315 315 InsertPoints lastPoint,1,GIsTrans 316 GIsTrans[lastPoint] = isTransFile(fname , -5) //returns one if beamstop is "out"316 GIsTrans[lastPoint] = isTransFile(fname) //returns one if beamstop is "out" 317 317 318 318 return(0) -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/CircSectAve.ipf
r76 r82 326 326 //good values 327 327 328 Variable DDet, apOff=0.0 328 Variable DDet 329 NVAR apOff = root:myGlobals:apOff //in cm 329 330 DDet = DetectorPixelResolution(fileStr,detStr) //needs detector type and beamline 330 331 -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/NCNR_DataReadWrite.ipf
r80 r82 1229 1229 // str is the CORRECT length - it will all be written - pad before sending 1230 1230 // start is the start byte 1231 Function RewriteTextToHeader(fname,str,start)1231 Function WriteTextToHeader(fname,str,start) 1232 1232 String fname,str 1233 1233 Variable start … … 1246 1246 end 1247 1247 1248 // sample label, starts at byte 98 1249 // limit to 60 characters 1248 1250 Function WriteSamLabelToHeader(fname,str) 1249 1251 String fname,str 1250 1252 1251 RewriteTextToHeader(fname,str,98) 1253 if(strlen(str) > 60) 1254 str = str[0,59] 1255 endif 1256 WriteTextToHeader(fname,str,98) 1252 1257 return(0) 1253 1258 End … … 1584 1589 //associated file suffix is the first 4 characters of a text field starting 1585 1590 // at byte 404 1591 // suffix must be four characters long, if not, it's truncated 1592 // 1586 1593 Function WriteAssocFileSuffixToHeader(fname,suffix) 1587 1594 String fname,suffix 1588 1589 Variable refnum 1590 1591 Open/A/T="????TEXT" refnum as fname 1592 FSetPos refnum,404 1593 FBinWrite refnum, suffix 1594 FStatus refnum 1595 FSetPos refnum,V_logEOF 1596 Close refnum 1597 1598 return(0) 1599 end 1595 1596 suffix = suffix[0,3] //limit to 4 characters 1597 WriteTextToHeader(fname,suffix,404) 1598 1599 return(0) 1600 end -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/NCNR_Utils.ipf
r81 r82 39 39 Variable/G root:myGlobals:DeadtimeNG7_ORNL = 3.4e-6 40 40 Variable/G root:myGlobals:DeadtimeDefault = 3.4e-6 41 42 //new 11APR07 43 Variable/G root:myGlobals:BeamstopXTol = -5 // (cm) is BS Xpos is -5 cm or less, it's a trans measurement 44 // sample aperture offset is NOT stored in the VAX header, but it should be 45 // - when it is, remove the global and write an accessor AND make a place for 46 // it in the RealsRead 47 Variable/G root:myGlobals:apOff = 5.0 // (cm) distance from sample aperture to sample position 48 41 49 End 42 50 … … 54 62 // raw data header to indicate the presence of lenses. 55 63 // 56 //57 64 // - called by CircSectAvg.ipf and RectAnnulAvg.ipf 65 // 66 // passed values are read from RealsRead 67 // except DDet and apOff, which are set from globals before passing 58 68 // 59 69 Function/S getResolution(inQ,lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,del_r,SigmaQ,QBar,fSubS) … … 66 76 67 77 //Constants 68 //Variable del_r = .169 78 Variable vz_1 = 3.956e5 //velocity [cm/s] of 1 A neutron 70 79 Variable g = 981.0 //gravity acceleration [cm/s^2] … … 73 82 results ="Failure" 74 83 75 //rename for working variables, these must be gotten from global76 //variables77 78 // Variable wLam, wLW, wL1, wL2, wS1, wS279 // Variable wBS, wDDet, wApOff80 // wLam = lambda81 // wLW = lambdaWidth82 // wDDet = DDet83 // wApOff = apOff84 84 S1 *= 0.5*0.1 //convert to radius and [cm] 85 85 S2 *= 0.5*0.1 … … 142 142 143 143 144 //Utility function that returns the detector resolution (in cm) given information 145 //from the file header 144 //Utility function that returns the detector resolution (in cm) 146 145 //Global values are set in the Initialize procedure 147 146 // 148 147 // 149 148 // - called by CircSectAvg.ipf, RectAnnulAvg.ipf, and ProtocolAsPanel.ipf 149 // 150 // fileStr is passed as TextRead[3] 151 // detStr is passed as TextRead[9] 150 152 // 151 153 Function DetectorPixelResolution(fileStr,detStr) … … 187 189 default: 188 190 //return error? 189 DDet = PixelResDefault // 5mm, typical for new ORNL detectors191 DDet = PixelResDefault //0.5 cm, typical for new ORNL detectors 190 192 endswitch 191 193 … … 193 195 End 194 196 195 //Utility function that returns the detector deadtime (in seconds) given information 196 //from the file header 197 //Utility function that returns the detector deadtime (in seconds) 197 198 //Global values are set in the Initialize procedure 198 199 // 199 200 // - called by WorkFileUtils.ipf 200 201 // 202 // fileStr is passed as TextRead[3] 203 // detStr is passed as TextRead[9] 201 204 // 202 205 Function DetectorDeadtime(fileStr,detStr) … … 434 437 End 435 438 436 437 438 439 //function to check the header of a raw data file (full path specified by fname) 439 440 //checks the field of the x-position of the beamstop during data collection … … 443 444 // function returns 1 if beamstop is out, 0 if beamstop is in 444 445 // 446 // tolerance is set as a global value "root:myGlobals:BeamstopXTol" 445 447 // 446 448 // called by Transmission.ipf, CatVSTable.ipf, NSORT.ipf 447 449 // 448 Function isTransFile(fName ,xTol)450 Function isTransFile(fName) 449 451 String fname 450 Variable xTol451 452 452 453 Variable refnum,xpos 454 NVAR xTol = root:myGlobals:BeamstopXTol 455 453 456 //pos = 369, read one real value 454 457 … … 1046 1049 //NG5 values are taken from the NG7 tables (there is very little difference in the 1047 1050 //values, and NG5 attenuators have not been calibrated (as of 8/01) 1048 //filestr as passed is textread[3], the default directory 1051 // 1052 // filestr is passed from TextRead[3] = the default directory 1053 // lam is passed from RealsRead[26] 1054 // AttenNo is passed from ReaslRead[3] 1049 1055 // 1050 1056 // Attenuation factor as defined here is <= 1 1057 // 1051 1058 // ORNL can pass ("",1,attenuationFactor) and have this function simply 1052 1059 // spit back the attenuationFactor (that was read into rw[3]) -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/NSORT.ipf
r76 r82 1579 1579 // 0 if the file is a scattering file, 1 (truth) if the file is a transmission file 1580 1580 InsertPoints lastPoint,1,GIsTrans 1581 GIsTrans[lastPoint] = isTransFile(fname , -5) //returns one if beamstop is "out"1581 GIsTrans[lastPoint] = isTransFile(fname) //returns one if beamstop is "out" 1582 1582 1583 1583 KillWaves/Z w -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/RectAnnulAvg.ipf
r76 r82 326 326 //good values 327 327 328 Variable DDet, apOff=0.0 328 Variable DDet 329 NVAR apOff = root:myGlobals:apOff //in cm 329 330 DDet = DetectorPixelResolution(fileStr,detStr) //needs detector type and beamline 330 331 331 332 332 //Width of annulus used for the average is gotten from the -
sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/Transmission.ipf
r75 r82 250 250 String fname,sname 251 251 252 Variable isTrans, xTol= -5 253 254 // String textstr,temp,labelStr,date_time,suffix,assoc 255 // Variable ctime,lambda,sdd,detcnt,cntrate,refNum,trans,thick,xcenter,ycenter,numatten 256 Variable lastPoint//, beamstop, Whole 257 258 isTrans = isTransFile(fname, xTol) 252 Variable isTrans 253 254 Variable lastPoint 255 256 isTrans = isTransFile(fname) 259 257 // decalre the correct set of waves 260 258 // S_Whole is only a place holder so the waves are of equal length
Note: See TracChangeset
for help on using the changeset viewer.