Changeset 577


Ignore:
Timestamp:
Oct 22, 2009 11:04:32 AM (13 years ago)
Author:
srkline
Message:

Fixed logic error in writing the XY box count values to the empty beam header that could result in INF transmission.

Updated critera for "RAW" data files to include "SIM" as well.

Added NCNR_Utils to the includes list for Analysis.

Location:
sans/Dev/trunk/NCNR_User_Procedures
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/SA_includes_v400.ipf

    r570 r577  
    1717#include "PlotManager_v40"                              version>=4.00 
    1818#include "NCNR_GenFitUtils"                     // April 2009, compiles OK if XOP not present 
     19#include "NCNR_Utils" 
    1920 
    2021#include "USANS_SlitSmearing_v40" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/CatVSTable.ipf

    r570 r577  
    5555        Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Field" 
    5656        Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:MCR"              //added Mar 2008 
    57 //      Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Reactorpower"       //activate for ILL, June 2008 
     57//#ifdef ILL_D22 
     58//      Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Reactorpower"       //activate for ILL, June 2008, 
     59//#endif 
    5860 
    5961        If(V_Flag==0) 
     
    7274                ModifyTable width(:myGlobals:CatVSHeaderInfo:Field)=50 
    7375                ModifyTable width(:myGlobals:CatVSHeaderInfo:MCR)=50 
     76//#ifdef ILL_D22 
    7477//              ModifyTable width(:myGlobals:CatVSHeaderInfo:Reactorpower)=50           //activate for ILL, June 2008 
    75                  
     78//#endif 
     79 
    7680                ModifyTable width(Point)=0              //JUN04, remove point numbers - confuses users since point != run 
    7781        Endif 
     
    170174        Wave GField = $"root:myGlobals:CatVSHeaderInfo:Field" 
    171175        Wave GMCR = $"root:myGlobals:CatVSHeaderInfo:MCR"               //added Mar 2008 
     176//#ifdef ILL_D22 
    172177//      Wave GReactPow = $"root:myGlobals:CatVSHeaderInfo:ReactorPower"         //activate for ILL June 2008 ( and the sort line too) 
    173178//      Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR,GReactPow 
    174  
     179//#else 
    175180        Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR 
     181//#endif 
     182 
    176183        return(0) 
    177184End 
     
    198205        Wave Field= $"root:myGlobals:CatVSHeaderInfo:Field" 
    199206        Wave MCR = $"root:myGlobals:CatVSHeaderInfo:MCR"                //added Mar 2008 
     207//#ifdef ILL_D22 
     208// for ILL 
    200209//      Wave ReactorPower = $"root:myGlobals:CatVSHeaderInfo:reactorpower"       //activate for ILL, June 08 (+ edit line) 
    201  
     210//      Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR, ReactorPower as "Data File Catalog" 
     211//#else 
    202212// original order, magnetic at the end 
    203213        Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR as "Data File Catalog" 
    204 // for ILL 
    205 //      Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR, ReactorPower as "Data File Catalog" 
    206214// alternate ordering, put the magnetic information first 
    207215//      Edit Filenames, Labels, RotAngle, Temperature, Field, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens as "Data File Catalog" 
     216//#endif 
     217 
    208218        String name="CatVSTable" 
    209219        DoWindow/C $name 
     
    244254        Wave GField = $"root:myGlobals:CatVSHeaderInfo:Field" 
    245255        Wave GMCR = $"root:myGlobals:CatVSHeaderInfo:MCR" 
     256//#ifdef ILL_D22 
    246257//      Wave GReactpow = $"root:myGlobals:CatVSHeaderInfo:reactorpower"         //activate for ILL, Jne 2008, (+ last insert @ end of function)  
     258//#endif 
    247259        lastPoint = numpnts(GLambda) 
    248260                 
     
    331343        InsertPoints lastPoint,1,GMCR 
    332344        GMCR[lastPoint]  = getMonitorCount(fname)/ctime         //total monitor count / total count time 
    333          
    334         // Reactor Power (activate for ILL) 
     345 
     346//#ifdef ILL_D22         
     347//      // Reactor Power (activate for ILL) 
    335348//      InsertPoints lastPoint,1,GReactpow 
    336349//      GReactPow[lastPoint]  = getReactorPower(fname) 
    337          
     350//#endif         
     351 
    338352        return(0) 
    339353End 
     
    663677        //Notebook CatWin,text=temp 
    664678End 
    665  
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Utils.ipf

    r572 r577  
    569569        Close refNum 
    570570         
    571         if(totalBytes == 33316 && cmpstr(testStr,"RAW")==0) 
     571        if(totalBytes == 33316 && ( cmpstr(testStr,"RAW")==0 ||  cmpstr(testStr,"SIM")==0)) 
    572572                //true, is raw data file 
    573573                Return(1) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/SASCALC.ipf

    r570 r577  
    999999                                NVAR doABS = root:Packages:NIST:SAS:g_1D_DoABS 
    10001000                                NVAR addNoise = root:Packages:NIST:SAS:g_1D_AddNoise 
    1001                                                          
     1001                                 
     1002                                // this is where the number of cells comes in - the calculation of the error bars 
     1003                                // sigma[i] = SUM(sigma[ij]^2) / nCells^2 
     1004                                // and since in the simulation, SUM(sigma[ij]^2) = nCells*sigma[ij]^2 = nCells*Inten 
     1005                                // then... 
    10021006                                sigave = sqrt(aveint/nCells)            // corrected based on John's memo, from 8/9/99 
    10031007                                 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Transmission.ipf

    r570 r577  
    397397                        // 
    398398                        temp = temp+selectedFiles[0]            //take just the first file 
     399                         
    399400                        UpdateBoxCoordinates() 
     401                         
     402                        //check to make sure that if the box is set, that the count value in the box is set too... 
     403                        // if the box is set by a protocol, then the counts are not set -> and the transmission will be INF 
     404                        String tempName = FindValidFilename(temp) 
     405                        if(cmpstr(tempName,"")==0) 
     406                                //file not found, get out 
     407                                Abort "Empty beam file not found UpdateBoxCoordinates(ctrlName)" 
     408                        Endif 
     409                        //name is ok, prepend path to tempName for read routine  
     410                        PathInfo catPathName 
     411                        String filename = S_path + tempName 
     412                        Variable boxCounts = getBoxCounts(filename) 
     413                         
     414                        variable x1,x2,y1,y2 
     415                        getXYBoxFromFile(filename,x1,x2,y1,y2) 
     416                         
     417                        if( (boxCounts == 0) && (x1!=0) && (x2!=0) && (y1!=0) && (y2!=0) ) 
     418                                DoAlert 0,"Box Counts were not recorded. Please re-select the box using SetXYBox" 
     419                        endif 
     420                         
     421                         
    400422                Else 
    401423                        DoWindow/F TransFileTable 
     
    13581380        Variable refnum,x1,x2,y1,y2,err 
    13591381        GetXYBoxFromFile(filename,x1,x2,y1,y2) 
    1360                  
     1382         
    13611383        //and update the global string 
    13621384        String msgStr="" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/BT5_AddFiles.ipf

    r570 r577  
    494494                //drawing a new graph 
    495495                Legend 
    496                 Label left "(Counts/sec)/(MON*10\\S6\\M)" 
     496                Label left "(Counts/sec)/(MON)*10\\S6\\M" 
    497497                Label bottom "Angle (deg)" 
    498498        endif 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/COR_Graph.ipf

    r570 r577  
    9393        ModifyGraph log(left)=1,mirror=2,grid=1,standoff=0 
    9494        ModifyGraph tickUnit=1 
    95         Label left "(Counts/sec)/(MON*10\\S6\\M)" 
     95        Label left "(Counts/sec)/(MON)*10\\S6\\M" 
    9696        Label bottom "q (A\\S-1\\M)" 
    9797         
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/U_CALC.ipf

    r570 r577  
    15571557                        // click code here 
    15581558                         
    1559                         Variable num,ii,baseNumber=100,firstSet=0 
     1559                        Variable num,ii,baseNumber=101,firstSet=0 
    15601560                        String pathStr="root:Packages:NIST:USANS:Globals:U_Sim:gCtTime" 
    15611561                        SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 
     
    16611661        fprintf refnum,"%s"+termStr,"  6       0.00000    0.00000    0.00000" 
    16621662        fprintf refnum,"%s"+termStr," Mot:    Start       Step      End" 
    1663         fprintf refnum,"%s"+termStr,"     A2       MIN       COUNTS " 
     1663        fprintf refnum,"%s"+termStr,"     A2       MIN      MONITOR      COUNTS      EXTRA " 
    16641664 
    16651665        //loop over the waves, picking out the desired set 
    16661666        //write 2 lines each time 
    16671667        for(ii=first;ii<=last;ii+=1) 
    1668                 sprintf str,"      %6.3f    %6.2f         %d",angle[ii],ctTime/60,DetCts[ii] 
     1668                sprintf str,"      %6.3f    %6.2f    %d     %d     %d",angle[ii],ctTime/60,MonCt,DetCts[ii]*ctTime,transDet 
    16691669                fprintf refnum,"%s"+termStr,str 
    16701670 
    1671                 sprintf str,"%d,%d,0,%d,0,0,0,0",MonCt,DetCts[ii],transDet 
     1671                sprintf str,"%d,%d,0,%d,0,0,0,0",MonCt,DetCts[ii]*ctTime,transDet 
    16721672                fprintf refnum,"%s"+termStr,str 
    16731673        endfor 
Note: See TracChangeset for help on using the changeset viewer.