Ignore:
Timestamp:
Feb 5, 2019 3:13:21 PM (4 years ago)
Author:
srkline
Message:

adding procedures for calculating sector averages of the data

still need to add overlay of sector angles.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Write_VSANS_QIS.ipf

    r1120 r1121  
    394394        String a1Str 
    395395        Variable pixX,pixY 
    396         Variable numTextLines=19,ii,jj,kk 
    397  
     396        Variable numTextLines,ii,jj,kk 
     397        Variable pixSizeX,pixSizeY 
     398 
     399        numTextLines = 23 
    398400        Make/O/T/N=(numTextLines) labelWave 
    399401 
     
    443445        // or -- V_getBeamStopC3_size(type) 
    444446                bstop = V_getBeamStopC2_size(type) 
     447 
     448                pixSizeX = V_getDet_x_pixel_size(type,detStr) 
     449                pixSizeY = V_getDet_y_pixel_size(type,detStr) 
    445450                 
    446451        ///////// 
     
    461466                labelWave[12] = "Average Choices: "+proto[5] 
    462467                labelWave[13] = "Collimation type: "+proto[9] 
    463                 labelWave[14] = "" 
    464                 labelWave[15] = "*** Data written from "+type+" folder and may not be a fully corrected data file ***" 
    465 //              labelWave[16] = "Data columns are Qx - Qy - Qz - I(Qx,Qy) - Err I(Qx,Qy)" 
    466         //      labelWave[16] = "Data columns are Qx - Qy - I(Qx,Qy) - Qz - SigmaQ_parall - SigmaQ_perp - fSubS(beam stop shadow)" 
    467                 labelWave[16] = "Data columns are Qx - Qy - I(Qx,Qy) - err(I) - Qz - SigmaQ_parall - SigmaQ_perp - fSubS(beam stop shadow)" 
    468                 labelWave[17] = "The error wave may not be properly propagated (1/2019)" 
    469                 labelWave[18] = "ASCII data created " +date()+" "+time() 
     468                labelWave[14] = "Panel = "+detStr 
     469                labelWave[15] = "NumXPixels="+num2str(pixX) 
     470                labelWave[16] = "XPixelSize_mm="+num2str(pixSizeX) 
     471                labelWave[17] = "NumYPixels="+num2str(pixY) 
     472                labelWave[18] = "YPixelSize_mm="+num2str(pixSizeY) 
     473                labelWave[19] = "*** Data written from "+type+" folder and may not be a fully corrected data file ***" 
     474//              labelWave[20] = "Data columns are Qx - Qy - Qz - I(Qx,Qy) - Err I(Qx,Qy)" 
     475        //      labelWave[20] = "Data columns are Qx - Qy - I(Qx,Qy) - Qz - SigmaQ_parall - SigmaQ_perp - fSubS(beam stop shadow)" 
     476                labelWave[20] = "Data columns are Qx - Qy - I(Qx,Qy) - err(I) - Qz - SigmaQ_parall - SigmaQ_perp - fSubS(beam stop shadow)" 
     477                labelWave[21] = "The error wave may not be properly propagated (1/2019)" 
     478                labelWave[22] = "ASCII data created " +date()+" "+time() 
    470479                //strings can be too long to print-- must trim to 255 chars 
    471480                for(jj=0;jj<numTextLines;jj+=1) 
     
    518527        //      qval = CalcQval(p+1,q+1,rw[16],rw[17],rw[18],rw[26],rw[13]/10) 
    519528                Duplicate/O qTot,phi,r_dist 
    520                 Variable pixSizeX,pixSizeY,xctr,yctr 
    521                 pixSizeX = V_getDet_x_pixel_size(type,detStr) 
    522                 pixSizeY = V_getDet_y_pixel_size(type,detStr) 
     529                Variable xctr,yctr 
     530 
    523531 
    524532                xctr = V_getDet_beam_center_x_pix(type,detStr) 
     
    603611End 
    604612 
    605 // this assumes that: 
    606 // --QxQy data was written out in the format specified by the Igor macros, that is the x varies most rapidly 
    607 // 
    608 // TODO -- this needs to be made generic for reading in different panels with different XY dimensions 
    609 // -- add the XY dimensions to the QxQyASCII file header somewhere so that it can be read in and used here 
    610 // 
    611 // the SANS analysis 2D loader assumes that the matrix is square, mangling the VSANS data. 
    612 // the column data (for fitting) is still fine, but the matrix representation is incorrect. 
    613 // 
    614 Function V_ConvertQxQy2Mat(Qx,Qy,inten,matStr) 
    615         Wave Qx,Qy,inten 
    616         String matStr 
    617          
    618         String folderStr=GetWavesDataFolder(Qx,1) 
    619          
    620         Variable numX,numY 
    621         numX=48 
    622         numY=128 
    623         Make/O/D/N=(numX,numY) $(folderStr + matStr) 
    624         Wave mat=$(folderStr + matStr) 
    625          
    626         WaveStats/Q Qx 
    627         SetScale/I x, V_min, V_max, "", mat 
    628         WaveStats/Q Qy 
    629         SetScale/I y, V_min, V_max, "", mat 
    630          
    631         Variable xrows=numX 
    632          
    633         mat = inten[q*xrows+p] 
    634          
    635         return(0) 
    636 End 
    637  
    638  
     613 
Note: See TracChangeset for help on using the changeset viewer.