Changeset 392


Ignore:
Timestamp:
Jun 30, 2008 8:49:58 PM (15 years ago)
Author:
srkline
Message:

Changed NCNR_ raw data reader to get the magnetic field strength (actually the voltage) from byte 348, rather than 190.

Added Jan Ilavsky's fixes to all data loaders to accept 2-column data. A fake error is generated for the data set as read in, so the data can be treated as 3-column data from that point.

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

Legend:

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

    r391 r392  
    388388                         
    389389                        // clear the table (a subwindow) 
     390                        DoWindow/F WrapperPanel                         // ?? had to add this in during all of the cursor meddling... 
    390391                        KillWindow wrapperPanel#T0 
    391392                        Edit/W=(20,174,634,435)/HOST=# 
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Analysis/Models/PlotUtilsMacro_v40.ipf

    r385 r392  
    7676        String fileName = S_fileName 
    7777        Variable numCols = V_flag 
     78         
     79        //changes JIL 
     80        if(numCols==2)          //no errors      
     81                n1 = StringFromList(1, S_waveNames ,";" )                
     82                Duplicate/O $("root:"+n1), errorTmp 
     83                 errorTmp = 0.01*(errorTmp)+ 0.03*sqrt(errorTmp) 
     84                S_waveNames+="errorTmp;" 
     85                numCols=3 
     86        endif 
    7887         
    7988        if(numCols==3)          //simple 3-column data with no resolution information 
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Reduction/NCNR_DataReadWrite.ipf

    r370 r392  
    14351435 
    14361436//field strength is at byte 190 
     1437// 190 is not the right location, 348 looks to be correct for the electromagnets, 450 for the  
     1438// superconducting magnet. Although each place is only the voltage, it is correct 
    14371439Function getFieldStrength(fname) 
    14381440        String fname 
    14391441         
    1440         return(getRealValueFromHeader(fname,190)) 
     1442//      return(getRealValueFromHeader(fname,190)) 
     1443        return(getRealValueFromHeader(fname,348)) 
    14411444end 
    14421445 
  • sans/Dev/trunk/NCNR_User_Procedures/SANS/Reduction/PlotUtils.ipf

    r328 r392  
    2828        LoadWave/G/D/A 
    2929        String filename = S_fileName 
     30        Variable numCols = V_flag 
     31         
     32        //changes JIL 
     33        if(numCols==2)          //no errors      
     34                n1 = StringFromList(1, S_waveNames ,";" )                
     35                Duplicate/O $("root:"+n1), errorTmp 
     36                errorTmp = 0.01*(errorTmp)+ 0.03*sqrt(errorTmp) 
     37                S_waveNames+="errorTmp;" 
     38                numCols=3 
     39        endif 
    3040          
    31         if(V_flag==3) 
     41        if(numCols==3) 
    3242                String w0,w1,w2,n0,n1,n2,wt 
    3343                Variable rr,gg,bb 
     
    104114        endif 
    105115         
    106         if(V_flag == 6) 
     116        if(numCols == 6) 
    107117                String w0,w1,w2,n0,n1,n2,wt 
    108118                String w3,w4,w5,n3,n4,n5                        //3 extra waves to load 
     
    196206        endif 
    197207         
    198         if(V_flag==5)                   //old USANS desmeared data 
     208        if(numCols==5)                  //old USANS desmeared data 
    199209                String w0,w1,w2,n0,n1,n2,w3,n3,w4,n4 
    200210                Variable rr,gg,bb 
     
    275285        LoadWave/G/D/A/Q fileStr 
    276286        String fileName = S_fileName 
    277  
    278         if(V_flag==3) 
     287        Variable numCols = V_flag 
     288         
     289        //changes JIL 
     290        if(numCols==2)          //no errors      
     291                n1 = StringFromList(1, S_waveNames ,";" )                
     292                Duplicate/O $("root:"+n1), errorTmp 
     293                errorTmp = 0.01*(errorTmp)+ 0.03*sqrt(errorTmp) 
     294                S_waveNames+="errorTmp;" 
     295                numCols=3 
     296        endif 
     297 
     298        if(numCols==3) 
    279299                String w0,w1,w2,n0,n1,n2,wt 
    280300                 
     
    318338        endif 
    319339         
    320         if(V_flag == 6) 
     340        if(numCols == 6) 
    321341                String w0,w1,w2,n0,n1,n2,wt 
    322342                String w3,w4,w5,n3,n4,n5                        //3 extra waves to load 
     
    375395        endif 
    376396 
    377         if(V_flag==5) 
     397        if(numCols==5) 
    378398                String w0,w1,w2,n0,n1,n2,w3,n3,w4,n4 
    379399                Variable rr,gg,bb 
  • sans/Dev/trunk/NCNR_User_Procedures/USANS/PlotUtils_USANS.ipf

    r328 r392  
    1313        LoadWave/G/D/A 
    1414        String filename = S_fileName 
    15          
    16         if(V_flag==3) 
     15        Variable numCols = V_flag 
     16         
     17        //changes JIL 
     18        if(numCols==2)          //no errors      
     19                n1 = StringFromList(1, S_waveNames ,";" )                
     20                Duplicate/O $("root:"+n1), errorTmp 
     21                 errorTmp = 0.01*(errorTmp)+ 0.03*sqrt(errorTmp) 
     22                S_waveNames+="errorTmp;" 
     23                numCols=3 
     24        endif 
     25         
     26        if(numCols==3) 
    1727                String w0,w1,w2,n0,n1,n2,wt 
    1828                Variable rr,gg,bb 
     
    100110        endif 
    101111         
    102         if(V_flag == 6) 
     112        if(numCols == 6) 
    103113                String w0,w1,w2,n0,n1,n2,wt 
    104114                String w3,w4,w5,n3,n4,n5                        //3 extra waves to load 
     
    202212        endif 
    203213 
    204         if(V_flag==5) 
     214        if(numCols==5) 
    205215                String w0,w1,w2,n0,n1,n2,w3,n3,w4,n4 
    206216                Variable rr,gg,bb 
     
    283293        LoadWave/G/D/A/Q fileStr 
    284294        String fileName = S_fileName 
    285          
    286         if(V_flag==3) 
     295        Variable numCols = V_flag 
     296         
     297        //changes JIL 
     298        if(numCols==2)          //no errors      
     299                n1 = StringFromList(1, S_waveNames ,";" )                
     300                Duplicate/O $("root:"+n1), errorTmp 
     301                 errorTmp = 0.01*(errorTmp)+ 0.03*sqrt(errorTmp) 
     302                S_waveNames+="errorTmp;" 
     303                numCols=3 
     304        endif 
     305         
     306        if(numCols==3) 
    287307                String w0,w1,w2,n0,n1,n2,wt 
    288308                 
     
    327347        endif 
    328348         
    329         if(V_flag == 6) 
     349        if(numCols == 6) 
    330350                String w0,w1,w2,n0,n1,n2,wt 
    331351                String w3,w4,w5,n3,n4,n5                        //3 extra waves to load 
     
    385405        endif 
    386406 
    387         if(V_flag==5) 
     407        if(numCols==5) 
    388408                String w0,w1,w2,n0,n1,n2,w3,n3,w4,n4 
    389409                Variable rr,gg,bb 
Note: See TracChangeset for help on using the changeset viewer.