Changeset 398 for sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis
- Timestamp:
- Aug 11, 2008 3:54:42 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis/Models/PlotUtilsMacro_v40.ipf
r392 r398 76 76 String fileName = S_fileName 77 77 Variable numCols = V_flag 78 79 //changes JIL80 if(numCols==2) //no errors81 n1 = StringFromList(1, S_waveNames ,";" )82 Duplicate/O $("root:"+n1), errorTmp83 errorTmp = 0.01*(errorTmp)+ 0.03*sqrt(errorTmp)84 S_waveNames+="errorTmp;"85 numCols=386 endif87 78 88 79 if(numCols==3) //simple 3-column data with no resolution information … … 200 191 201 192 endif //6-col data 193 194 // Load ORNL data from Heller program 195 if(numCols == 4) //4-column SANS or USANS data that has resolution information 196 197 // put the names of the (default named) loaded waves into local names 198 n0 = StringFromList(0, S_waveNames ,";" ) 199 n1 = StringFromList(1, S_waveNames ,";" ) 200 n2 = StringFromList(2, S_waveNames ,";" ) 201 n3 = StringFromList(3, S_waveNames ,";" ) 202 203 //remove the semicolon AND period from files from the VAX 204 w0 = CleanupName((S_fileName + "_q"),0) 205 w1 = CleanupName((S_fileName + "_i"),0) 206 w2 = CleanupName((S_fileName + "_s"),0) 207 w3 = CleanupName((S_fileName + "sq"),0) 208 w4 = CleanupName((S_fileName + "qb"),0) 209 w5 = CleanupName((S_fileName + "fs"),0) 210 211 212 String baseStr=w1[0,strlen(w1)-3] 213 if(DataFolderExists("root:"+baseStr)) 214 DoAlert 1,"The file "+S_filename+" has already been loaded. Do you want to load the new data file, overwriting the data in memory?" 215 if(V_flag==2) //user selected No, don't load the data 216 SetDataFolder root: 217 KillWaves $n0,$n1,$n2,$n3 // kill the default waveX that were loaded 218 if(DataFolderExists("root:Packages:NIST")) 219 String/G root:Packages:NIST:gLastFileName = filename 220 endif //set the last file loaded to the one NOT loaded 221 return //quits the macro 222 endif 223 SetDataFolder $("root:"+baseStr) 224 else 225 NewDataFolder/S $("root:"+baseStr) 226 endif 227 228 ////overwrite the existing data, if it exists 229 Duplicate/O $("root:"+n0), $w0 230 Duplicate/O $("root:"+n1), $w1 231 Duplicate/O $("root:"+n2), $w2 232 Duplicate/O $("root:"+n3), $w3 233 Duplicate/O $("root:"+n0), $w4 // Set qb wave to nominal measured Q values 234 Duplicate/O $("root:"+n0), $w5 // Make wave of appropriate length 235 $w5 = 1 // Set all shadowfactor to 1 236 237 // need to switch based on SANS/USANS 238 if (isSANSResolution($w3[0])) //checks to see if the first point of the wave is <0] 239 // make a resolution matrix for SANS data 240 Variable np=numpnts($w0) 241 Make/D/O/N=(np,4) $(baseStr+"_res") 242 243 $(baseStr+"_res")[][0] = $w3[p] //sigQ 244 $(baseStr+"_res")[][1] = $w4[p] //qBar 245 $(baseStr+"_res")[][2] = $w5[p] //fShad 246 $(baseStr+"_res")[][3] = $w0[p] //Qvalues 247 else 248 //the data is USANS data 249 // marix calculation here, but for now, just copy the waves 250 //$(baseStr+"_res")[][0] = $w3[p] //sigQ 251 //$(baseStr+"_res")[][1] = $w4[p] //qBar 252 //$(baseStr+"_res")[][2] = $w5[p] //fShad 253 //$(baseStr+"_res")[][3] = $w0[p] //Qvalues 254 dQv = -$w3[0] 255 256 USANS_CalcWeights(baseStr,dQv) 257 258 endif 259 Killwaves/Z $w3,$w4,$w5 //get rid of the resolution waves that are in the matrix 260 261 SetScale d,0,0,"1/A",$w0 262 SetScale d,0,0,"1/cm",$w1 263 264 endif //4-col data 265 202 266 203 267 if(numCols==5) //this is the "old-style" VAX desmeared data format
Note: See TracChangeset
for help on using the changeset viewer.