Changeset 669


Ignore:
Timestamp:
Apr 7, 2010 1:02:12 PM (13 years ago)
Author:
srkline
Message:

Fixed the issue with USANS XML data not being written correctly. the structure had not been filled in completely. USANS XML is a "4-column" format with the ususal 3 plus a 4th of -dQv. The XML reader properly looks for the named entry "dQl" to identify the 4th column as USANS data, and handles it appropriately.

fixed a separate issue with reading USANS XML files. dQv was not being read in correctly, now it is.

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

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Common/NIST_XML_v40.ipf

    r665 r669  
    2222         
    2323        Variable rr,gg,bb 
    24         NVAR/Z dQv = root:Packages:NIST:USANS_dQv 
     24        Variable dQv 
     25//      NVAR/Z dQv = root:Packages:NIST:USANS_dQv               //let USANS_CalcWeights set the dQv value 
    2526 
    2627                 
     
    259260                                                //USAS Data 
    260261                                                Wave dQl = $(xmlDataFolder+"dQl") 
    261                                                 dQv = dQl[0] 
     262                                                dQv = - dQl[0]          //make it positive again 
    262263                                         
    263264                                                USANS_CalcWeights(baseStr,dQv) 
     
    498499                        xmlsetAttr(fileID,"/SASroot/SASentry/SASdata/Idata["+num2istr(ii+1)+"]/Idev","","unit",NISTfile.unitsIdev)       
    499500         
    500                         xmladdnode(fileID,"/SASroot/SASentry/SASdata/Idata["+num2istr(ii+1)+"]","","Idev",num2str(NISTfile.dQl[ii]),1) 
    501                         xmlsetAttr(fileID,"/SASroot/SASentry/SASdata/Idata["+num2istr(ii+1)+"]/Idev","","unit",NISTfile.unitsdQl)                
     501                        xmladdnode(fileID,"/SASroot/SASentry/SASdata/Idata["+num2istr(ii+1)+"]","","dQl",num2str(NISTfile.dQl[ii]),1) 
     502                        xmlsetAttr(fileID,"/SASroot/SASentry/SASdata/Idata["+num2istr(ii+1)+"]/dQl","","unit",NISTfile.unitsdQl)                 
    502503                endfor 
    503504        else 
     
    634635                Variable i = 0 
    635636                do 
    636                         WAVE wv= $(StringFromList(i,S_waveNames,";")) 
     637                        WAVE/Z wv= $(StringFromList(i,S_waveNames,";")) 
    637638                        if( WaveExists(wv) == 0 ) 
    638639                                break 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/WriteUSANSData.ipf

    r667 r669  
    211211         
    212212        SVAR USANSFolder = root:Packages:NIST:USANS:Globals:gUSANSFolder 
     213        NVAR dQv = root:Packages:NIST:USANS:Globals:MainPanel:gDQv 
    213214         
    214215        Struct NISTXMLfile nf 
     
    237238        Endif 
    238239         
    239         //Use the evil extra column. Should probably switch to using slit_length in collimation. 
     240        //Use the evil extra column for the resolution "information". Should probably switch to using slit_length in collimation. 
    240241        Duplicate/O qvals,dumWave 
    241         NVAR DQv=$(USANSFolder+":Globals:MainPanel:gDQv") 
    242         dumWave = - DQv 
     242        dumWave = - dQv 
    243243        /// 
    244244         
     
    254254        Endif 
    255255         
    256         //actually open the file here 
    257         //Open refNum as fullpath 
    258          
    259256        //Data 
    260257        Wave nf.Q = qvals 
     
    264261        Wave nf.Idev = sig 
    265262        nf.unitsIdev = "1/cm" 
    266         Wave nf.dQl = sigmaq 
     263        // for slit-smeared USANS, set only a 4th column to  -dQv 
     264        Wave nf.dQl = dumWave 
    267265        nf.unitsdQl= "1/A" 
    268          
    269          
     266 
    270267        //write out the standard header information 
    271268        //fprintf refnum,"FILE: %s\t\t CREATED: %s\r\n",textw[0],textw[1] 
     
    345342        //write confirmation of write operation to history area 
    346343        Print "Averaged XML File written: ", GetFileNameFromPathNoSemi(fullPath) 
    347         KillWaves/Z tempShortProto 
     344        KillWaves/Z dumWave 
    348345        Return(0) 
    349346End 
     
    468465        SetDataFolder root:             //(redundant) 
    469466         
     467        KillWaves/Z res1,res2,res2,ti,te,tq 
     468         
    470469        Return(0) 
    471470End 
Note: See TracChangeset for help on using the changeset viewer.