Changeset 871 for sans/Dev/trunk
- Timestamp:
- Oct 17, 2012 5:01:03 PM (10 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/InstalledVersion.txt
r870 r871 1 PACKAGE_VERSION=7.1 2;SANS_RED_VERSION=5.20;SANS_ANA_VERSION=4.10;USANS_RED_VERSION=2.3;1 PACKAGE_VERSION=7.13;SANS_RED_VERSION=5.20;SANS_ANA_VERSION=4.10;USANS_RED_VERSION=2.3; 2 2 3 3 Only the first line of the file is read in. … … 6 6 7 7 These are the current versions as of: 8 09OCT 2012 SRK8 17 OCT 2012 SRK 9 9 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/CatVSTable.ipf
r861 r871 309 309 // Variable ,lambda,sdd,,refNum,trans,thick,xcenter,ycenter,numatten 310 310 // Variable lastPoint, beamstop,dum 311 Variable lastPoint,ctime,detcnt,cntrate 311 Variable lastPoint,ctime,detcnt,cntrate,instrumentNum 312 312 313 313 Wave/T GFilenames = $"root:myGlobals:CatVSHeaderInfo:Filenames" … … 445 445 // number of guides and sample position, only for NCNR 446 446 #if (exists("NCNR")==6) 447 instrumentNum = str2num(getAcctName(fname)[3]) // "[NGxSANSxx]" -- [3] should be then instrument number 448 Variable/G root:Packages:NIST:SAS:instrument = instrumentNum //so that Ng can be correctly calculated 449 447 450 InsertPoints lastPoint,1,GNumGuides 448 451 GNumGuides[lastPoint] = numGuides(getSourceToSampleDist(fname)) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Includes_v520.ipf
r693 r871 84 84 #include "WriteModelData_v40" 85 85 86 // SRK OCT 2012 - processing of event mode data 87 #include "EventModeProcessing" 88 86 89 87 90 // a simple list of items to add to the Beta menu -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Initialize.ipf
r801 r871 92 92 NewDataFolder/O root:Packages:NIST:SUB 93 93 NewDataFolder/O root:Packages:NIST:DRK 94 94 95 NewDataFolder/O root:Packages:NIST:SAS 96 95 97 96 98 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_DataReadWrite.ipf
r811 r871 2448 2448 // simulated VAX data file. 2449 2449 // 2450 // NCNR-Specific 2450 // NCNR-Specific. is hard wired to the SAS folder. If saving from any other folder, set all of the header 2451 // information before saving, and pass a null string to this procedure to bypass it entirely 2451 2452 // 2452 2453 Function SimulationVAXHeader(folder) 2453 2454 String folder 2454 2455 2456 if(cmpstr(folder,"SAS")!=0) //if not the SAS folder passed in, get out now, and return 1 2457 return(1) 2458 endif 2459 2455 2460 Wave rw=root:Packages:NIST:SAS:realsRead 2456 2461 Wave iw=root:Packages:NIST:SAS:integersRead -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ProDiv.ipf
r794 r871 543 543 Execute "CopyWorkContents(\"DIV\",\"DRK\")" //then data in DRK is guaranteed linear 544 544 545 WAVE sub_d = root:Packages:NIST:SUB: data546 WAVE sto_d = root:Packages:NIST:STO: data547 WAVE drk_d = root:Packages:NIST:DRK: data545 WAVE sub_d = root:Packages:NIST:SUB:linear_data 546 WAVE sto_d = root:Packages:NIST:STO:linear_data 547 WAVE drk_d = root:Packages:NIST:DRK:linear_data 548 548 549 549 sub_d = sto_d/drk_d 550 550 551 551 // WaveStats root:Packages:NIST:DIV:data 552 // Print "*" 552 // Print "*" 553 WAVE sub_data = root:Packages:NIST:SUB:data 554 sub_data = sub_d //data = linear_data 555 553 556 Execute "ChangeDisplay(\"SUB\")" 554 557 break -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/TISANE.ipf
r862 r871 48 48 NewDataFolder/O/S root:Packages:NIST:TISANE 49 49 50 Make/ O/N=(XBINS,YBINS,nslices) slicedData50 Make/D/O/N=(XBINS,YBINS,nslices) slicedData 51 51 Duplicate/O slicedData logslicedData 52 52 Duplicate/O slicedData dispsliceData … … 98 98 ModifyGraph btLen=3 99 99 ModifyGraph tlOffset=-2 100 SetAxis/A /Rleft100 SetAxis/A left 101 101 SetActiveSubwindow ## 102 102 EndMacro … … 348 348 349 349 350 ////////// SRK - junk I'm testing351 352 //353 Function PreLoadEvents()354 355 NVAR time_msw = root:Packages:NIST:gTISANE_time_msw356 NVAR time_lsw = root:Packages:NIST:gTISANE_time_lsw357 NVAR t_longest = root:Packages:NIST:gTISANE_t_longest358 359 SVAR filepathstr = root:Packages:NIST:gTISANE_logfile360 SetDataFolder root:Packages:NIST:TISANE361 362 Variable fileref363 String buffer364 Variable dataval,timeval,type,numLines,verbose365 Variable xval,yval,rollBit,nRoll,roll_time366 Variable Xmax, yMax367 xMax = 127 // number the detector from 0->127368 yMax = 127369 370 verbose = 0371 numLines = 0372 373 // this gets me the number of lines. not terribly useful374 // Open/R fileref as filepathstr375 // do376 // numLines += 1377 // FReadLine fileref, buffer378 // if (strlen(buffer) == 0)379 // numLines -= 1 //last FReadLine wasn't really a line380 // break381 // endif382 // while(1)383 // Close fileref384 385 // what I really need is the number of XY events386 Variable numXYevents,num1,num2,num3,num0387 numXYevents = 0388 num0 = 0389 num1 = 0390 num2 = 0391 num3 = 0392 393 Open/R fileref as filepathstr394 do395 do396 FReadLine fileref, buffer //skip the "blank" lines that have one character397 while(strlen(buffer) == 1)398 399 if (strlen(buffer) == 0)400 break401 endif402 403 sscanf buffer,"%x",dataval404 405 // two most sig bits (31-30)406 type = (dataval & 0xC0000000)/1073741824 //right shift by 2^30407 408 if(type == 0)409 num0 += 1410 numXYevents += 1411 endif412 if(type == 2)413 num2 += 1414 numXYevents += 1415 endif416 if(type == 1)417 num1 += 1418 endif419 if(type == 3)420 num3 += 1421 endif422 423 while(1)424 Close fileref425 // done counting the number of XY events426 427 428 //429 Printf "numXYevents = %d\r",numXYevents430 Printf "XY = num0 = %d\r",num0431 Printf "XY time = num2 = %d\r",num2432 Printf "time MSW = num1 = %d\r",num1433 Printf "Rollover = num3 = %d\r",num3434 435 Printf "num0 + num2 = %d\r",num0+num2436 437 Make/O/U/N=(numXYevents) xLoc,yLoc438 Make/O/D/N=(numXYevents) timePt439 xLoc=0440 yLoc=0441 timePt=0442 443 444 Variable ii=0445 nRoll = 0 //number of rollover events446 roll_time = 2^26 //units of 10-7 sec447 448 time_msw=0449 450 Open/R fileref as filepathstr451 do452 do453 FReadLine fileref, buffer //skip the "blank" lines that have one character454 while(strlen(buffer) == 1)455 456 if (strlen(buffer) == 0)457 break458 endif459 460 sscanf buffer,"%x",dataval461 462 //This is hideous, but that is what you get for IGOR not doing structs like C463 //464 //Constant ATXY = 0465 //Constant ATXYM = 2466 //Constant ATMIR = 1467 //Constant ATMAR = 3468 //469 // type = (dataval & ~(2^32 - 2^30 -1))/2^30470 471 // two most sig bits (31-30)472 type = (dataval & 0xC0000000)/1073741824 //right shift by 2^30473 474 // if(ii<10)475 // Print "buffer=", buffer//, type476 // Print "strlen(buffer) =",strlen(buffer)477 // printf "%b %u\r",dataval,type478 // endif479 480 481 // just to print out some of the diagnostic information482 // if(ii < 7)483 // verbose = 1484 // else485 // verbose = 0486 // endif487 488 //489 // not sure that the XY positions are correctly interpreted490 // X seems OK, but Y doesn't match teabag output (it does if the (yMax - ) is dropped, and just the 8 bits are used)491 //492 switch(type)493 case ATXY:494 if(verbose)495 printf "XY : "496 endif497 // xval = ~(dataval & ~(2^32 - 2^8)) & 127498 // yval = ((dataval & ~(2^32 - 2^16 ))/2^8) & 127499 // time_lsw = (dataval & ~(2^32 - 2^29))/2^16500 501 xval = xMax - (dataval & 255) //last 8 bits (7-0)502 yval = (dataval & 65280)/256 //bits 15-8, right shift by 2^8503 time_lsw = (dataval & 536805376)/65536 //13 bits, 28-16, right shift by 2^16504 505 timeval = trunc( nRoll*roll_time + (time_msw * (8192)) + time_lsw ) //left shift msw by 2^13, then add in lsw, as an integer506 if (timeval > t_longest)507 t_longest = timeval508 endif509 xLoc[ii] = xval510 yLoc[ii] = yval511 timePt[ii] = timeval512 513 if(verbose)514 // printf "%u : %u : %u : %u\r",dataval,time_lsw,time_msw,timeval515 printf "%u : %u : %u : %u\r",dataval,timeval,xval,yval516 endif517 518 // b = FindBin(timeval,nslices)519 // slicedData[xval][yval][b] += 1520 521 ii+=1522 523 break524 case ATXYM:525 if(verbose)526 printf "XYM : "527 endif528 // xval = ~(dataval & ~(2^32 - 2^8)) & 127529 // yval = ((dataval & ~(2^32 - 2^16 ))/2^8) & 127530 // time_lsw = (dataval & ~(2^32 - 2^29 ))/2^16531 532 xval = xMax - (dataval & 255) //last 8 bits (7-0)533 yval = (dataval & 65280)/256 //bits 15-8, right shift by 2^8534 535 time_lsw = (dataval & 536805376)/65536 //13 bits, 28-16, right shift by 2^16536 537 if(verbose)538 // printf "%u : %u : %u : %u\r",dataval,time_lsw,time_msw,timeval539 printf "%u : %u : %u : %u\r",dataval,timeval,xval,yval540 endif541 542 xLoc[ii] = xval543 yLoc[ii] = yval544 545 // don't fill in the time yet, or increment the index ii546 // the next event MUST be ATMIR with the MSW time bits547 //548 break549 case ATMIR:550 if(verbose)551 printf "MIR : "552 endif553 // time_msw = (dataval & ~(2^32 - 2^29 ))/2^16554 time_msw = (dataval & 536805376)/65536 //13 bits, 28-16, right shift by 2^16555 timeval = trunc( nRoll*roll_time + (time_msw * (8192)) + time_lsw )556 if (timeval > t_longest)557 t_longest = timeval558 endif559 if(verbose)560 // printf "%u : %u : %u : %u\r",dataval,time_lsw,time_msw,timeval561 printf "%u : %u : %u : %u : %u\r",dataval,time_lsw,time_msw,timeval,t_longest562 endif563 564 // the XY position was in the previous event ATXYM565 timePt[ii] = timeval566 567 ii+=1568 569 // b = FindBin(timeval,nslices)570 // slicedData[xval][yval][b] += 1571 572 break573 case ATMAR:574 if(verbose)575 printf "MAR : "576 endif577 578 // do something with the rollover event?579 580 // check bit 29581 rollBit = (dataval & 0x20000000)/536870912 //bit 29 only , shift by 2^29582 nRoll += 1583 584 if(verbose)585 printf "%u : %u \r",rollBit,nRoll586 endif587 588 break589 endswitch590 591 while(1)592 593 594 Close fileref595 596 SetDataFolder root:597 End598 599 ///
Note: See TracChangeset
for help on using the changeset viewer.