Changeset 394 for sans/Dev


Ignore:
Timestamp:
Jul 23, 2008 1:11:58 PM (15 years ago)
Author:
srkline
Message:

Several changes:

New version of ILL_DataReadWrite. Some changes added to Lionel's work to get the transmission calculation working corectly.

Changes to the wrapper to get the cursors on/off working correctly, as well as USANS matrix recalculation during normal fitting and during Global fitting. It may ask to recalculate the matrix occasionally when using the full data set - even though it really doesn't need to - but this is as a precaution.

Re-worked the header of the GRASP-export ASCII data to much more closely match the VAX output. I couldn't find any problem with the data block, so maybe GRASP was having trouble with the header.

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

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis/Models/Packages/GlobalFit/GlobalFit2_NCNR_v40.ipf

    r393 r394  
    34003400        if (V_value) 
    34013401                GFUI_AddMaskWavesToDataSets(DataSets)  //SRK - if masking, recalculate the matrix for the USANS data if necessary 
     3402        else 
     3403                // if masking is not selected, be sure to reset the USANS matrices (if any) to their original, full dimensions 
     3404                // new function 
     3405                GFUI_ResetUSANSMatrices(DataSets)  //SRK - if NOT masking, reset any USANS matrices 
    34023406        endif 
    34033407         
     
    40764080//                      return -1 
    40774081 
     4082                // this will signal the AAOFitFunction to use the full matrix without recalculation 
     4083 
    40784084                        DataSets[i][startingNCols] = "No Mask" 
    40794085                        //eSRK 
    40804086                endif 
     4087        endfor 
     4088         
     4089        return 0 
     4090end 
     4091 
     4092// if masking is not checked at all, make sure that the full matrix is used for the USANS data sets 
     4093// force a recalculate 
     4094// set all of the data sets to "no mask", even the SANS data 
     4095// SRK July 2008 
     4096static Function GFUI_ResetUSANSMatrices(DataSets) 
     4097        Wave/T DataSets 
     4098         
     4099        Wave/T/Z MaskingListWave=root:Packages:NewGlobalFit:MaskingListWave 
     4100         
     4101        Variable startingNCols = DimSize(DataSets, 1) 
     4102        Redimension/N=(-1, startingNCols+1) DataSets 
     4103        SetDimLabel 1, startingNCols, Masks, DataSets 
     4104         
     4105        Variable numSets = DimSize(DataSets, 0) 
     4106        Variable i 
     4107        Variable pt1,pt2,mPt1,mPt2 
     4108        String str,noteStr,DF 
     4109         
     4110        for (i = 0; i < NumSets; i += 1) 
     4111 
     4112                str=DataSets[i][0]              //this seems to work 
     4113                DF=ParseFilePath(1, str, ":", 1, 0) 
     4114// 
     4115                str=str[0,strlen(str)-3]                //remove the "_i" = DataFolder:name 
     4116                WAVE resW = $(str+"_res") 
     4117                if((dimsize(resW,1) > 4))       //USANS, NxN 
     4118                        // always force a recalculation, even though the weights_saved exists 
     4119                        // seems easier than shuffling. 
     4120                        Wave data = $(str+"_i") 
     4121                        Variable len=numpnts(data) 
     4122                        USANS_RE_CalcWeights(ParseFilePath(0, str, ":", 1, 0),0,len-1) 
     4123                         
     4124//                      noteStr = note(resW)             
     4125//                      mPt1 = NumberByKey("P1",noteStr,"=",";") 
     4126//                      mPt2 = NumberByKey("P2",noteStr,"=",";") 
     4127//                      Wave/Z mw = $(DataSets[i][startingNCols]) 
     4128//       
     4129//                      //find the first 1,  then find the zero 
     4130//                      pt1 = 0 
     4131//                      do 
     4132//                              if(mw[pt1]==1) 
     4133//                                      break 
     4134//                              endif 
     4135//                              pt1+=1 
     4136//                      while(pt1<numpnts(mw)) 
     4137//                       
     4138//                      pt2 = pt1 
     4139//                      do 
     4140//                              if(mw[pt2]==0) 
     4141//                                      break 
     4142//                              endif 
     4143//                              pt2+=1 
     4144//                      while(pt2<numpnts(mw)) 
     4145//                      pt2 -= 1 
     4146//                      if((mPt1 != pt1) || (mPt2 != pt2) ) 
     4147//                              // need to recalculate 
     4148//                              USANS_RE_CalcWeights(ParseFilePath(0, str, ":", 1, 0),pt1,pt2) 
     4149//                      endif 
     4150                endif 
     4151         
     4152                DataSets[i][startingNCols] = "No Mask"          //no mask for any data set 
     4153 
    40814154        endfor 
    40824155         
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis/Models/Packages/Wrapper_v40.ipf

    r393 r394  
    153153                                ControlUpdate/W=WrapperPanel popup_0 
    154154                                 
    155                                 // fake mouse up 
     155                                // fake mouse up to pop the menu 
    156156                                Struct WMPopupAction ps 
    157157                                ps.eventCode = 2                //fake mouse up 
    158         //                      ps.popStr = str 
    159158                                DataSet_PopMenuProc(ps) 
    160                                  
    161                                 // new data set has been selected, always uncheck the "use cursors", other checkboxes are benign. 
    162                                 CheckBox check_0,win=WrapperPanel,value=0 
    163159                        endif 
    164160                        break 
    165161        endswitch 
    166  
    167  
     162         
    168163        return 0 
    169164End 
    170165 
    171166 
    172 // is there a simpler way to do this? 
     167// is there a simpler way to do this? I don't think so. 
    173168Function/S W_DataSetPopupList() 
    174169 
    175         String str=GetAList(4),tmp="",onTargetStr="" 
    176         Variable ii 
    177 //      ControlInfo/W=WrapperPanel check_3 
    178 //      if(V_Value==1)          //if "from target" checked 
    179 //              //ther must be a better way to do this 
    180 //              onTargetStr = TraceNameList("",";",1) 
    181 //              onTargetStr = ReplaceString("_i",onTargetStr,"")                //get rid of the "_i" 
    182 //              for(ii=0;ii<ItemsInList(onTargetStr);ii+=1) 
    183 //                      if(WhichListItem(StringFromList(ii,onTargetStr,";"), str  , ";") != -1) 
    184 //                              tmp = Addlistitem(StringFromList(ii,onTargetStr,";"),tmp)               //only keep the matches w/data folder listing 
    185 //                      endif 
    186 //              endfor 
    187 //              return(tmp) 
    188 //      endif 
     170        String str=GetAList(4) 
    189171 
    190172        if(strlen(str)==0) 
     
    383365                        // default epsilon values, sometimes needed for the fit 
    384366                         
    385  
    386367                        WAVE/T LoLim = $("LoLim_"+suffix) 
    387368                        WAVE/T HiLim = $("HiLim_"+suffix) 
     
    451432Function DataSet_PopMenuProc(pa) : PopupMenuControl 
    452433        STRUCT WMPopupAction &pa 
    453  
     434         
    454435        switch( pa.eventCode ) 
    455436                case 2: // mouse up 
    456                 // make sure that the cursors are on/off appropriately 
    457                 // check to make sure there really is a "topmost" graph          
    458 //                      String topGraph= WinName(0,1)   //this is the topmost graph 
    459 //                      if(cmpstr(topGraph,"")==0)      //no graphs, uncheck and exit 
    460 //                              CheckBox check_0,value=0 
    461 //                      else 
    462 //                              String ciStr = CsrInfo(A , topGraph) 
    463 //                               
    464 //                              ControlInfo/W=wrapperpanel popup_0 
    465 //                              String folderStr=S_Value 
    466 //                              String traceList = TraceNameList(topGraph, ";", 1 )              
    467 //                       
    468 //                      endif 
    469                                                  
     437                        // make sure that the cursors are on/off appropriately 
     438                        // let the cursors checkbox decide what to do, sending the current state 
     439                        ControlInfo/W=WrapperPanel check_0 
     440                        STRUCT WMCheckboxAction cba 
     441                        cba.eventCode = 2 
     442                        cba.checked = V_Value 
     443                        UseCursorsWrapperProc(cba) 
     444                                         
    470445                        // then cascade the function/coefficient popups 
    471446                        Struct WMPopupAction ps 
     
    782757 
    783758        // 20JUN if useCursors is true, and there are no cursors on the specified data set, uncheck and set to false 
     759        // this is a last line of defense, and should never actually do anything... 
    784760        if(useCursors) 
    785761                useCursors = AreCursorsCorrect(folderStr) 
     
    804780                        // need to recalculate 
    805781                        USANS_RE_CalcWeights(folderStr,pt1,pt2) 
    806                 endif 
     782                        Print "Done recalculating the matrix" 
     783                endif 
     784                 
    807785                Wave trimResW=$(DF+folderStr+"_res"+"t")        //put the trimmed resW in the struct for the fit! 
    808786                Wave fs.resW=trimResW 
    809                  
    810                 Print "Done recalculating the matrix" 
    811 //////WRONG WAY 
    812 //              Make/O/D/N=(newN,newN) $(DF+"crsrResW") 
    813 //              WAVE crsrResW = $(DF+"crsrResW") 
    814 //              crsrResW = resW[p+pt1][q+pt1] 
    815 //              //assign to the struct 
    816 //              WAVE fs.resW =  crsrResW                 
    817 ///////////// 
    818         endif 
    819          
    820         if(!useCursors && (dimsize(resW,1) > 4) ) 
    821                 // avoid an odd sequence of y/n cursors that can lead to a truncated res matrix, but useCursors is not selected 
    822                 if(waveExists($("root:"+folderStr+":weights_save"))) 
    823                         Duplicate/O $("root:"+folderStr+":weights_save"), $("root:"+folderStr+":"+folderStr+"_res") 
    824                 endif 
    825         endif 
    826          
     787 
     788        endif 
     789                 
    827790// create these variables so that FuncFit will set them on exit 
    828791        Variable/G V_FitError=0                         //0=no err, 1=error,(2^1+2^0)=3=singular matrix 
     
    11921155        switch( cba.eventCode ) 
    11931156                case 2: // mouse up 
     1157                 
    11941158                        // check to make sure there really is a "topmost" graph          
    11951159                        String topGraph= WinName(0,1)   //this is the topmost graph 
     
    12151179                                        Cursor/P/W=$topGraph/A=0 B, $(folderStr+"_i"),numpnts(yw)-1                     //deactivate the one at the high Q end 
    12161180                                        DoUpdate 
    1217 //                              else            //if (strlen(ciStr)!=0 && strsearch(traceList, folderStr, 0) != -1 ) //cursors present, but on wrong data 
    1218 //                                      Wave yw=$("root:"+folderStr+":"+folderStr+"_i") 
    1219 //                                      Cursor/P/W=$topGraph A, $(folderStr+"_i"),0                                                             //move the cursors 
    1220 //                                      Cursor/P/W=$topGraph/A=0 B, $(folderStr+"_i"),numpnts(yw)-1 
    1221 //                                      DoUpdate 
     1181                                elseif (strlen(ciStr)!=0 && strsearch(traceList, folderStr, 0) != -1 ) //cursors present, but on wrong data 
     1182                                        Wave yw=$("root:"+folderStr+":"+folderStr+"_i") 
     1183                                        Cursor/P/W=$topGraph A, $(folderStr+"_i"),0                                                             //move the cursors 
     1184                                        Cursor/P/W=$topGraph/A=0 B, $(folderStr+"_i"),numpnts(yw)-1 
     1185                                        DoUpdate 
    12221186                                endif 
    1223                          
     1187                                 
     1188                                AreCursorsCorrect(folderStr) 
    12241189                        else 
    12251190                                //print "unchecked, remove the cursors" 
    12261191                                // go back to the full matrix for the resolution calculation (not if SANS data...) 
    12271192                                if(waveExists($("root:"+folderStr+":weights_save"))) 
    1228                                         Duplicate/O $("root:"+folderStr+":weights_save"), $("root:"+folderStr+":"+folderStr+"_res") 
     1193                                        Duplicate/O $("root:"+folderStr+":weights_save"), $("root:"+folderStr+":"+folderStr+"_res"),$("root:"+folderStr+":"+folderStr+"_rest") 
    12291194                                endif 
     1195 
    12301196                                HideInfo 
    12311197                                Cursor/K A 
     
    12561222        if(     strsearch(traceAisOn, folderStr, 0) == -1)              //data and cursors don't match 
    12571223                CheckBox check_0,win=wrapperpanel,value=0 
     1224                HideInfo 
     1225                Cursor/K A 
     1226                Cursor/K B 
    12581227                return(0) 
    12591228        endif 
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis/Models/USANS_SlitSmearing_v40.ipf

    r347 r394  
    1414//     - pass N to CalcR to avoid globals 
    1515 
    16 // 
     16////////////// 
     17// 
     18//// July 2008 SRK 
     19// 
     20// For fitting withe cursors, the matrix must be recalculated for the exact range of the data 
     21// - but the inital dependency of the model (any number of them) was (were) set up to use the full matrix 
     22// -- so: 
     23//      $_res is the resolution for the dependencies. It is always the full size of the data set. If cursors are used, 
     24//                      it is padded with zeroes at the edges to fill. 
     25// 
     26// weights_save: is a pristine copy of the resolution matrix for the full data set, as when loaded 
     27// $_qt, $_qi, $_qs, $_rest: are "trimmed" sets that use the range specified by the cursors. They are created 
     28//                      at load time and are initially the full data range. 
     29// 
     30// there is a wave note attached to $_res that has the current point range for the matrix. This is what the  
     31//              $_rest matrix is expected to be too, so keep these two matrices in sync. 
     32// 
     33//      during fitting, $_rest is used in the structure if cursors are used, since the matrix must be the same dimension (N) 
     34//                      as the (trimmed) data range. It may be the full data range if the cursors are at the ends of the data set. 
     35//                      If no cursors are used, then the $_res wave is used in the structure 
     36////////// 
     37 
     38 
     39 
    1740 
    1841// called only by the main file loader 
     
    6992        Note weights ,nStr 
    7093         
     94        // make a set of "trimmed" data that is currently the full data set 
     95        // but will be trimmed as needed for use with cursors 
     96        // this is necessary to handle the base case of cursors that use the full range of the data! 
     97        Duplicate/O $(baseStr+"_q") $(baseStr+"_qt") 
     98        Duplicate/O $(baseStr+"_i") $(baseStr+"_it") 
     99        Duplicate/O $(baseStr+"_s") $(baseStr+"_st") 
     100        Duplicate/O weights, $(basestr+"_res"+"t") 
     101 
    71102        // save a copy of the untainted matrix to return to... 
    72103        Duplicate/O weights, weights_save 
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Reduction/CatVSTable.ipf

    r328 r394  
    5555        Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Field" 
    5656        Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:MCR"              //added Mar 2008 
    57  
     57//      Make/O/D/N=0 $"root:myGlobals:CatVSHeaderInfo:Reactorpower"       //activate for ILL, June 2008 
    5858 
    5959        If(V_Flag==0) 
     
    7171                ModifyTable width(:myGlobals:CatVSHeaderInfo:RotAngle)=50 
    7272                ModifyTable width(:myGlobals:CatVSHeaderInfo:Field)=50 
     73                ModifyTable width(:myGlobals:CatVSHeaderInfo:MCR)=50 
     74//              ModifyTable width(:myGlobals:CatVSHeaderInfo:Reactorpower)=50           //activate for ILL, June 2008 
    7375                 
    7476                ModifyTable width(Point)=0              //JUN04, remove point numbers - confuses users since point != run 
     
    168170        Wave GField = $"root:myGlobals:CatVSHeaderInfo:Field" 
    169171        Wave GMCR = $"root:myGlobals:CatVSHeaderInfo:MCR"               //added Mar 2008 
    170  
     172//      Wave GReactPow = $"root:myGlobals:CatVSHeaderInfo:ReactorPower"         //activate for ILL June 2008 ( and the sort line too) 
     173//      Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR,GReactPow 
    171174 
    172175        Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR 
     
    195198        Wave Field= $"root:myGlobals:CatVSHeaderInfo:Field" 
    196199        Wave MCR = $"root:myGlobals:CatVSHeaderInfo:MCR"                //added Mar 2008 
    197  
     200//      Wave ReactorPower = $"root:myGlobals:CatVSHeaderInfo:reactorpower"       //activate for ILL, June 08 (+ edit line) 
    198201 
    199202// original order, magnetic at the end 
    200203        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" 
    201206// alternate ordering, put the magnetic information first 
    202207//      Edit Filenames, Labels, RotAngle, Temperature, Field, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens as "Data File Catalog" 
     
    239244        Wave GField = $"root:myGlobals:CatVSHeaderInfo:Field" 
    240245        Wave GMCR = $"root:myGlobals:CatVSHeaderInfo:MCR" 
    241          
     246//      Wave GReactpow = $"root:myGlobals:CatVSHeaderInfo:reactorpower"         //activate for ILL, Jne 2008, (+ last insert @ end of function)  
    242247        lastPoint = numpnts(GLambda) 
    243248                 
     
    326331        InsertPoints lastPoint,1,GMCR 
    327332        GMCR[lastPoint]  = getMonitorCount(fname)/ctime         //total monitor count / total count time 
     333         
     334        // Reactor Power (activate for ILL) 
     335//      InsertPoints lastPoint,1,GReactpow 
     336//      GReactPow[lastPoint]  = getReactorPower(fname) 
    328337         
    329338        return(0) 
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Reduction/ILL_DataReadWrite.ipf

    r376 r394  
    169169 
    170170        // detector physical width (right now assumes square...) (in cm) 
    171         realw[20] = 65 
     171        realw[20] = 102 
    172172         
    173173        // beam stop diameter (assumes circular) (in mm) 
     
    188188        // wavelength spread (FWHM) 
    189189        realw[27] = getWavelengthSpread(fname) 
     190         
     191        realw[52] = getreactorpower(fname) 
    190192         
    191193        // beam stop X-position (motor reading, approximate cm from zero position) 
     
    920922         
    921923        // pos (1) on line 71 => 70 lines x 81 char 
    922         WriteReal(fname,num,5670)  
     924        WriteReal(fname,num*10,5670)  
    923925         
    924926        ///   line 11 column 1 
     
    934936        // your code here 
    935937         
    936         WriteReal(fname,num,5686) 
     938        WriteReal(fname,num*10,5686) 
    937939         
    938940        ///   line 11 column 2 
     
    956958        return(0) 
    957959End 
     960 
     961 
     962Function WritereactorpowerToHeader(fname,num) 
     963        String fname 
     964        Variable num 
     965         
     966        // your code here, default of 1 
     967        WriteReal(fname,num,6204) 
     968         
     969        ///   line 12 column 4 
     970         
     971        return(0) 
     972End 
     973 
     974 
     975 
     976 
     977 
     978 
     979 
    958980 
    959981// total monitor count during data collection 
     
    10931115        //your code here 
    10941116         
    1095         WriteReal(fname,num,5849) 
     1117        WriteReal(fname,10*num,5849) 
    10961118         
    10971119         
     
    11571179         
    11581180        // your code here 
    1159         WriteText(fname,"                              ",2075) 
     1181//              WriteText(fname,"                              ",2075)  // need to write in 30 bites no more.... 
     1182 
     1183        Variable numChars=30 
     1184        String blankStr="" 
     1185        blankStr = PadString(blankStr, numChars, 0x20) 
     1186        WriteText(fname,blankStr,2075) 
     1187         
     1188        if(strlen(str)>numChars) 
     1189                str = str[0,numchars-1] 
     1190        endif 
     1191         
    11601192        WriteText(fname,str,2075)   //// need to change that in order to erase the title and write a new one 
    11611193 
     
    12131245        String fname 
    12141246         
    1215         return("") 
     1247        String suffix = getStringFromHeader(fname,9341,6) 
     1248         
     1249        // replace the leading space w/ "0" 
     1250        suffix = ReplaceString(" ",suffix,"0") 
     1251         
     1252        return(suffix)   //// file suffix (6 characters @ byte 9341) 
    12161253End 
    12171254 
     
    12221259        String fname 
    12231260         
    1224         return("") 
     1261        string str 
     1262         
     1263        str= getStringFromHeader(fname,9350,6) 
     1264         
     1265        // replace leading space(s) w/zero 
     1266        str = ReplaceString(" ", str, "0" ) 
     1267//      print  str 
     1268         
     1269        return(str)  //  6 characters @ byte 9350 
    12251270End 
    12261271 
     
    12631308        return(str) 
    12641309End 
     1310 
     1311 
     1312//reactor power 
     1313Function getReactorpower(fname) 
     1314        String fname 
     1315         
     1316        Variable value 
     1317         
     1318        // your code returning value 
     1319         
     1320//      value = getRealValueFromHeader_2(fname,60,28,5,1,5)  // 
     1321         
     1322        value = getRealValueFromHeader(fname,83) 
     1323         
     1324//      print value 
     1325         
     1326        return(value) 
     1327end 
     1328 
    12651329 
    12661330 
     
    14241488        // your code returning value     
    14251489//      value = getRealValueFromHeader(fname,14)                //Lionel 
    1426         value = getRealValueFromHeader(fname,50)                //SRK 
     1490        value = getRealValueFromHeader(fname,50)/10             //SRK 
    14271491         
    14281492        return(value) 
     
    14371501        // your code returning value 
    14381502//      value = getRealValueFromHeader(fname,15)                //Lionel 
    1439         value = getRealValueFromHeader(fname,51)                //SRK 
     1503        value = getRealValueFromHeader(fname,51)/10             //SRK 
    14401504         
    14411505        return(value) 
     
    14651529        value = getRealValueFromHeader(fname,61)  
    14661530         
    1467         return(value) 
     1531        return(value/10)  // need in cm ILL write in mm 
    14681532end 
    14691533 
     
    16961760        String fname,suffix 
    16971761                 
    1698         // your code to write bounding box to the header, or nothing 
     1762        // replace leading space(s) w/zero 
     1763        suffix = ReplaceString(" ", suffix, "0" ) 
     1764                 
     1765        suffix = suffix[0,5]            //limit to 6 characters 
     1766         
     1767        WriteText(fname,suffix,9350) 
     1768         
    16991769         
    17001770        return(0) 
     
    20262096/// !!!! Make sure the text string is the correct LENGTH before sending it here!!! 
    20272097// SRK - May 2008 
    2028 Function WriteText(path,value,start) 
    2029         string path,value 
     2098Function WriteText(path,str,start) 
     2099        string path,str 
    20302100        variable start 
    20312101         
    20322102        variable refnum 
    20332103         
    2034         Open/A/T= "????" refnum as path 
     2104        Open/A/T= "????TEXT" refnum as path 
    20352105         
    20362106        FStatus refnum 
    20372107        FSetPos refnum, start 
    2038         FBinWrite refNum,value 
     2108        FBinWrite/F=0 refnum, str      //native object format (character) 
    20392109        FSetPos refnum,V_logEOF 
    20402110         
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Reduction/NCNR_DataReadWrite.ipf

    r392 r394  
    15351535end 
    15361536 
     1537// stub for ILL - power is written to their header, not ours 
     1538Function getReactorPower(fname) 
     1539        String fname 
     1540 
     1541        return 0 
     1542 
     1543end 
     1544 
    15371545//////  integer values 
    15381546 
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Reduction/WorkFileUtils.ipf

    r369 r394  
    452452                        // large angle transmission correction is <= 1 and will "bump up" the highest angles 
    453453                        if(doTrans) 
     454                         
     455                                if(trans<0.1 && ii==0 && jj==0) 
     456                                        Print "***transmission is less than 0.1*** and is a significant correction" 
     457                                endif 
     458                                 
     459                                if(trans==0) 
     460                                        if(ii==0 && jj==0) 
     461                                                Print "***transmission is ZERO*** and has been reset to 1.0 for the averaging calculation" 
     462                                        endif 
     463                                        trans = 1 
     464                                endif 
     465                                         
    454466                                data[ii][jj] /= LargeAngleTransmissionCorr(trans,dtdist,xd,yd)          //moved from 1D avg SRK 11/2007 
    455467                                solidAngle[ii][jj] = LargeAngleTransmissionCorr(trans,dtdist,xd,yd)             //testing only 
     
    535547         
    536548        ////this section is the trans_correct() VAX routine 
    537         if(trans<0.1) 
    538                 Print "***transmission is less than 0.1*** and is a significant correction" 
    539         endif 
    540         if(trans==0) 
    541                 Print "***transmission is ZERO*** and has been reset to 1.0 for the averaging calculation" 
    542                 trans = 1 
    543         endif 
     549//      if(trans<0.1) 
     550//              Print "***transmission is less than 0.1*** and is a significant correction" 
     551//      endif 
     552//      if(trans==0) 
     553//              Print "***transmission is ZERO*** and has been reset to 1.0 for the averaging calculation" 
     554//              trans = 1 
     555//      endif 
    544556         
    545557        theta = atan( (sqrt(xd^2 + yd^2))/dtdist )              //theta at the input pixel 
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Reduction/WriteQIS.ipf

    r393 r394  
    517517        Make/O/T/N=(numTextLines) labelWave 
    518518         
    519         sprintf tmpStr," '%s'   '%s'   '%s'",textw[0],textw[1],textw[2] 
     519//      sprintf tmpStr," '%s'   '%s'   '%s'",textw[0],textw[1],textw[2] 
     520        sprintf tmpStr," '%s'        '%s'        '%s'     'SAn''ABC''A123'",GetFileNameFromPathNoSemi(fullPath),textw[1],textw[2] 
    520521        labelWave[0] = tmpStr 
    521         labelWave[1] = textw[6]         //label 
    522          
    523         sprintf tmpStr," %d  %g  %g  %g",intw[2],rw[0],rw[39],rw[2] 
     522        labelWave[1] = " "+textw[6]             //label 
     523         
     524//      sprintf tmpStr," %d  %g  %g  %g",intw[2],rw[0],rw[39],rw[2] 
     525        sprintf tmpStr," %6d        %13.5E     %13.5E     %13.5E",intw[2],rw[0],rw[39],rw[2] 
    524526        labelWave[2] = tmpStr 
    525527        labelWave[3] = " Cnt.Time(sec.)    Mon. Cnt.      Trans. Det. Cnt.  Tot. Det. Cnt." 
    526528         
    527         sprintf tmpStr," %g  %g  %g '%s' %g '%s' %d  %d  %g",rw[4],rw[5],rw[8],textw[7],rw[9],textw[8],intw[4],intw[5],rw[6] 
     529//      sprintf tmpStr," %g  %g  %g '%s' %g '%s' %d  %d  %g",rw[4],rw[5],rw[8],textw[7],rw[9],textw[8],intw[4],intw[5],rw[6] 
     530        sprintf tmpStr,"%10.3g   %9.2g%8.2f '%6s'%8.2f '%6s'%7d%7d%7.2f",rw[4],rw[5],rw[8],textw[7],rw[9],textw[8],intw[4],intw[5],rw[6] 
    528531        labelWave[4] = tmpStr 
    529532        labelWave[5] = " Trans.      Thckns       Temp.           H Field         Table  Holder  Pos" 
    530533         
    531         sprintf tmpStr," %g  %g  %d  '%s'  %g",rw[26],rw[27],intw[9],textw[9],rw[7] 
     534//      sprintf tmpStr," %g  %g  %d  '%s'  %g",rw[26],rw[27],intw[9],textw[9],rw[7] 
     535        sprintf tmpStr," %8.2f        %5.2f          %2d   '%6s'          %6.2f",rw[26],rw[27],intw[9],textw[9],rw[7] 
    532536        labelWave[6] = tmpStr 
    533537        labelWave[7] = " Wavelength &  Spread(FWHM)    Det.#  Type      Sample Rotation Angle" 
    534538         
    535         sprintf tmpStr," %g  %g  %g  %g  %g  %g",rw[18],rw[19],rw[16],rw[17],rw[21],rw[3] 
     539//      sprintf tmpStr," %g  %g  %g  %g  %g  %g",rw[18],rw[19],rw[16],rw[17],rw[21],rw[3] 
     540        sprintf tmpStr," %12.2f%12.2f          %6.2f  %6.2f  %10.2f        %4.1f",rw[18],rw[19],rw[16],rw[17],rw[21],rw[3] 
    536541        labelWave[8] = tmpStr 
    537542        labelWave[9] = " Sam-Det Dis.(m)   Det.Ang.(cm.)   Beam Center(x,y)  Beam Stop(mm)  Atten.No." 
    538543         
    539         sprintf tmpStr," %g  %g  %g  %g  %g  %g",rw[10],rw[11],rw[12],rw[13],rw[14],rw[15] 
     544//      sprintf tmpStr," %g  %g  %g  %g  %g  %g",rw[10],rw[11],rw[12],rw[13],rw[14],rw[15] 
     545        sprintf tmpStr," %8.3f      %10.4E  %10.4E%8.3f      %10.4E  %10.4E",rw[10],rw[11],rw[12],rw[13],rw[14],rw[15] 
    540546        labelWave[10] = tmpStr 
    541547        labelWave[11] = "        Det. Calib Consts. (x)           Det. Calib Consts. (y)" 
    542548         
    543         sprintf tmpStr," %g  %g  %g  '%s'  %g  %g",rw[23],rw[24],rw[25],"    F",rw[45],rw[46] 
     549//      sprintf tmpStr," %g  %g  %g  '%s'  %g  %g",rw[23],rw[24],rw[25],"    F",rw[45],rw[46] 
     550        sprintf tmpStr,"%12.2f%12.2f%12.2f      '%s'%8.2f    %8.2f",rw[23],rw[24],rw[25],"     F",rw[45],rw[46] 
    544551        labelWave[12] = tmpStr 
    545552        labelWave[13] = " Aperture (A1,A2) Sizes(mm)    Sep.(m)    Flip ON   Horiz. and Vert. Cur.(amps)" 
    546553         
    547         sprintf tmpStr," %d  %d  %d  %d  %g  %g  %g",intw[19],intw[20],intw[21],intw[22],rw[47],rw[48],rw[49] 
     554//      sprintf tmpStr," %d  %d  %d  %d  %g  %g  %g",intw[19],intw[20],intw[21],intw[22],rw[47],rw[48],rw[49] 
     555        sprintf tmpStr,"%6d%6d%6d%6d%10.3f%10.6f%10.6f",intw[19],intw[20],intw[21],intw[22],rw[47],rw[48],rw[49] 
    548556        labelWave[14] = tmpStr 
    549557        labelWave[15] = "      Rows        Cols       Factor   Qmin      Qmax" 
Note: See TracChangeset for help on using the changeset viewer.