Ignore:
Timestamp:
Mar 13, 2017 1:39:33 PM (6 years ago)
Author:
srkline
Message:

adding to the functionality of the data reduction protocol

getting the 1D plotting to work both as a standalone plot and part of the reduction protocol (where the choices are all made and fed in)

added log/lin toggle to 1D display. abc exponent scaling is fundamentally more messy, and has been shelved for now. Revisit if demand is there.

fixed bug in how raw data files are identified, to prevent .abs files from being incorrectly identified as raw (if same name before extension). Works correctly now, but may need tweak in future if naming scheme changes.

File:
1 edited

Legend:

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

    r1023 r1027  
    3131 
    3232 
    33 Function V_QBinAllPanels(folderStr) 
     33Function V_QBinAllPanels(folderStr,binType) 
    3434        String folderStr 
     35        Variable binType 
    3536 
    3637        // do the back, middle, and front separately 
    3738         
    3839//      figure out the binning type (where is it set?) 
    39         Variable binType,ii,delQ 
     40        Variable ii,delQ 
    4041        String detStr 
    4142 
    42         binType = V_GetBinningPopMode() 
     43//      binType = V_GetBinningPopMode() 
    4344 
    4445//// TODO: 
    45 // x- currently the "B" detector is skipped - it was skipped in  
    46 //       previous functions where q values are calculated        
     46// 
    4747//       
    4848        delQ = SetDeltaQ(folderStr,"B") 
    4949         
    5050        // dispatch based on binning type 
    51         if(binType == 1) 
     51        if(binType == 1 || binType == 2 || binType == 3) 
    5252                VC_fDoBinning_QxQy2D(folderStr, "B")            //normal binning, nothing to combine 
    5353        endif 
     
    9999End 
    100100 
    101  
    102  
    103  
    104 Proc V_Combine1DData() 
    105  
    106 // get the current display type 
    107         String type = root:Packages:NIST:VSANS:Globals:gCurDispType 
    108  
     101// concatenates and sorts the 1D data in "type" WORK folder 
     102// uses the current display if type=="" 
     103// 
     104Function V_ConcatenateForSave(type,binType) 
     105        String type 
     106        Variable binType 
     107         
     108// get the current display type, if null string passed in 
     109        SVAR curtype = root:Packages:NIST:VSANS:Globals:gCurDispType 
     110         
     111        if(strlen(type)==0) 
     112                type = curType 
     113        endif 
    109114 
    110115// trim the data if needed 
    111116        // remove the q=0 point from the back detector, if it's there 
     117        // does not need to know binType 
    112118        V_RemoveQ0_B(type) 
    113  
    114119 
    115120// concatenate the data sets 
     
    119124        Killwaves/Z tmp_q,tmp_i,tmp_s 
    120125        setDataFolder root: 
    121         V_1DConcatenate(type) 
     126        V_1DConcatenate(type,binType) 
    122127         
    123128// sort the data set 
    124129        V_TmpSort1D(type) 
    125130         
     131        return(0) 
     132End 
     133 
     134// 
     135// this is only called from the button on the data panel 
     136// so the type is the currently displayed type, and the binning is from the panel 
     137// 
     138Function V_SimpleSave1DData(type,saveName) 
     139        String type,saveName 
     140 
     141//  
     142// get the current display type, if null string passed in 
     143        SVAR curtype = root:Packages:NIST:VSANS:Globals:gCurDispType 
     144        Variable binType = V_GetBinningPopMode() 
     145         
     146        V_ConcatenateForSave(curType,binType) 
     147         
    126148// write out the data set to a file 
    127         String/G saveName="" 
    128         V_GetNameForSave("") 
     149        if(strlen(saveName)==0) 
     150                Execute "V_GetNameForSave()" 
     151                SVAR newName = root:saveName 
     152                saveName = newName 
     153        endif 
     154         
    129155        V_Write1DData(type,saveName) 
    130156 
    131157End 
     158 
    132159 
    133160Proc V_GetNameForSave(str) 
    134161        String str 
    135         String/G saveName=str 
     162        String/G root:saveName=str 
    136163End 
    137164 
     
    180207// binType = 4 = Slit Mode 
    181208// 
    182 Function V_1DConcatenate(folderStr) 
     209// if binType is passed in as -9999, get the binning mode from the popup 
     210// otherwise the value is assumed good (from a protocol) 
     211// 
     212Function V_1DConcatenate(folderStr,binType) 
    183213        String folderStr 
    184          
    185         Variable binType = V_GetBinningPopMode() 
    186          
     214        Variable binType 
     215         
     216        if(binType==-9999) 
     217                binType = V_GetBinningPopMode() 
     218        endif    
    187219         
    188220        SetDataFolder $("root:Packages:NIST:VSANS:"+folderStr) 
Note: See TracChangeset for help on using the changeset viewer.