Changeset 1033 for sans/Dev/trunk


Ignore:
Timestamp:
Apr 24, 2017 2:04:29 PM (6 years ago)
Author:
srkline
Message:

Adding utilities to calculate transmission. Added V_Transmission.ipf file. Getting the functionality to work, user interface or incorporation into the data reduction protocol is still to be decided.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
Files:
1 added
5 edited

Legend:

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

    r1030 r1033  
    9292#include "V_RealTimeUpdate" 
    9393#include "V_Combine_1D" 
     94#include "V_Transmission" 
    9495 
    9596 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DIVUtils.ipf

    r1030 r1033  
    1010//   JAN 2017 
    1111// 
     12// TODO: 
     13// -- complete the description of the steps needed... 
     14// Data needs to be reduced to the "COR" level - that means that the  
     15// PLEX data has been added to work files, and the empty and blocked beam have been 
     16// subtracted off. 
     17// -- but what detector corrections should/ should not be done? 
     18// -- non-linear corrections are not needed, since this will strictly be a per-pixel correction 
     19// -- solid angle? 
     20// -- dead time? 
     21// -- efficiency? 
     22// -- large angle transmission? 
    1223// 
    13 // 
     24// we may need to think more carefully about some of these since the front carriage may need to be  
     25// closer than the nominal 4m distance on SANS that was deemed far enough back to be "safe" from  
     26// the high angle issues. 
    1427// 
    1528// 
     
    2538// 
    2639// 
     40 
     41 
     42 
     43 
     44 
    2745 
    2846//works on the data in "type" folder (expecting data to be reduced to the COR level) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MainPanel.ipf

    r1029 r1033  
    8282        String ctrlName 
    8383 
    84          CalcTrans() 
     84         V_InitTransmissionPanel() 
    8585End 
    8686 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_PatchFiles.ipf

    r1026 r1033  
    313313        fname = S_path + fname 
    314314 
    315         Variable nRows = 13 
     315        Variable nRows = 14 
    316316        Redimension/N=(nRows,3) ListWave 
    317317        Redimension/N=(nRows,3) selWave 
     
    349349        listWave[8][1] = "group_id (sample)" 
    350350        listWave[8][2] = num2str(V_getSample_group_ID(fname)) 
    351  
    352         listWave[9][1] = "box_count" 
    353         listWave[9][2] = num2str(V_getBoxCounts(fname)) 
    354          
    355         listWave[10][1] = "box_count_error" 
    356         listWave[10][2] = num2str(V_getBoxCountsError(fname)) 
    357          
    358         listWave[11][1] = "whole_trans" 
    359         listWave[11][2] = num2str(V_getSampleTransWholeDetector(fname)) 
    360          
    361         listWave[12][1] = "whole_trans_error" 
    362         listWave[12][2] = num2str(V_getSampleTransWholeDetErr(fname)) 
    363          
    364          
     351         
     352        listWave[9][1] = "Box Coordinates" 
     353        WAVE boxCoord = V_getBoxCoordinates(fname) 
     354        listWave[9][2] = V_NumWave2List(boxCoord,";") 
     355 
     356        listWave[10][1] = "box_count" 
     357        listWave[10][2] = num2str(V_getBoxCounts(fname)) 
     358         
     359        listWave[11][1] = "box_count_error" 
     360        listWave[11][2] = num2str(V_getBoxCountsError(fname)) 
     361         
     362        listWave[12][1] = "whole_trans" 
     363        listWave[12][2] = num2str(V_getSampleTransWholeDetector(fname)) 
     364         
     365        listWave[13][1] = "whole_trans_error" 
     366        listWave[13][2] = num2str(V_getSampleTransWholeDetErr(fname))    
    365367                 
    366368         
     
    970972        switch(V_Value) // numeric switch 
    971973                case 0: // execute if case matches expression 
    972                         V_WriteHeaderForPatch_0(tempName) 
     974                        V_WriteHeaderForPatch_0(tempName)               //control 
    973975                        break           // exit from switch 
    974976                case 1:  
    975                         V_WriteHeaderForPatch_1(tempName) 
     977                        V_WriteHeaderForPatch_1(tempName)               //reduction 
    976978                        break 
    977979                case 2:  
    978                         V_WriteHeaderForPatch_2(tempName) 
     980                        V_WriteHeaderForPatch_2(tempName)               // sample 
    979981                        break 
    980982                case 3:  
    981                         V_WriteHeaderForPatch_3(tempName) 
     983                        V_WriteHeaderForPatch_3(tempName)               // instrument 
    982984                        break 
    983985                case 4:  
    984                         V_WriteHeaderForPatch_4(tempName) 
     986                        V_WriteHeaderForPatch_4(tempName)               //detectors 
    985987                        break 
    986988                case 5:  
    987                         V_WriteHeaderForPatch_5(tempName) 
     989                        V_WriteHeaderForPatch_5(tempName)               // polSANS 
    988990                        break 
    989991                default:                        // optional default expression executed 
     
    10991101                err = V_writeSample_GroupID(fname,val) 
    11001102        endif    
    1101          
    1102         if ((selWave[9][0] & 2^4) != 0)         //"box_count" 
    1103                 val = str2num(listWave[9][2]) 
     1103 
     1104 
     1105 
     1106        if ((selWave[9][0] & 2^4) != 0)         //"box coordinates" 
     1107                str = listWave[9][2] 
     1108                err = V_writeBoxCoordinates(fname,V_List2NumWave(str,";","inW")) 
     1109        endif    
     1110         
     1111 
     1112         
     1113        if ((selWave[10][0] & 2^4) != 0)                //"box_count" 
     1114                val = str2num(listWave[10][2]) 
    11041115                err = V_writeBoxCounts(fname,val) 
    11051116        endif    
    11061117         
    1107         if ((selWave[10][0] & 2^4) != 0)                //"box_count_error" 
    1108                 val = str2num(listWave[10][2]) 
     1118        if ((selWave[11][0] & 2^4) != 0)                //"box_count_error" 
     1119                val = str2num(listWave[11][2]) 
    11091120                err = V_writeBoxCountsError(fname,val) 
    11101121        endif    
    11111122         
    1112         if ((selWave[11][0] & 2^4) != 0)                //"whole_trans" 
    1113                 val = str2num(listWave[11][2]) 
     1123        if ((selWave[12][0] & 2^4) != 0)                //"whole_trans" 
     1124                val = str2num(listWave[12][2]) 
    11141125                err = V_writeSampleTransWholeDetector(fname,val) 
    11151126        endif    
    11161127         
    1117         if ((selWave[12][0] & 2^4) != 0)                //"whole_trans_error" 
    1118                 val = str2num(listWave[12][2]) 
     1128        if ((selWave[13][0] & 2^4) != 0)                //"whole_trans_error" 
     1129                val = str2num(listWave[13][2]) 
    11191130                err = V_writeSampleTransWholeDetErr(fname,val) 
    11201131        endif    
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Utilities_General.ipf

    r1027 r1033  
    387387         
    388388        return outputPath 
     389End 
     390 
     391 
     392 
     393// 
     394// this will only load the data into RAW, overwriting whatever is there. no copy is put in rawVSANS 
     395// 
     396Function V_LoadAndPlotRAW_wName(fname) 
     397        String fname 
     398 
     399        Variable err=   V_LoadHDF5Data(fname,"RAW")                     // load the data  
     400//      Print "Load err = "+num2str(err) 
     401        if(!err) 
     402                SVAR hdfDF = root:file_name                     // last file loaded, may not be the safest way to pass 
     403                String folder = StringFromList(0,hdfDF,".") 
     404                 
     405                // this (in SANS) just passes directly to fRawWindowHook() 
     406                V_UpdateDisplayInformation("RAW")               // plot the data in whatever folder type 
     407                                 
     408                // set the global to display ONLY if the load was called from here, not from the  
     409                // other routines that load data (to read in values) 
     410                SVAR gLastFile =        root:Packages:NIST:VSANS:Globals:gLastLoadedFile 
     411                gLastFile = hdfDF 
     412        endif 
    389413End 
    390414 
     
    11201144End 
    11211145 
     1146//********************* 
     1147// List utilities 
     1148//********************* 
     1149Function/WAVE V_List2TextWave(list,sep,waveStr) 
     1150        String list,sep,waveStr 
     1151         
     1152        Variable n= ItemsInList(list,sep) 
     1153        Make/O/T/N=(n) $waveStr= StringFromList(p,list,sep) 
     1154        return $waveStr 
     1155End 
     1156 
     1157Function/WAVE V_List2NumWave(list,sep,waveStr) 
     1158        String list,sep,waveStr 
     1159         
     1160        Variable n= ItemsInList(list,sep) 
     1161        Make/O/D/N=(n) $waveStr= str2num( StringFromList(p,list,sep) ) 
     1162        return $waveStr 
     1163End 
     1164 
     1165Function /S V_TextWave2List(w,sep) 
     1166        Wave/T w 
     1167        String sep 
     1168         
     1169        String newList="" 
     1170        Variable n=numpnts(w),ii=0 
     1171        do 
     1172                newList += w[ii] + sep 
     1173                ii+=1 
     1174        while(ii<n) 
     1175        return(newList) 
     1176End 
     1177 
     1178//for numerical waves 
     1179Function/S V_NumWave2List(w,sep) 
     1180        Wave w 
     1181        String sep 
     1182         
     1183        String newList="",temp="" 
     1184        Variable n=numpnts(w),ii=0,val 
     1185        do 
     1186                val=w[ii] 
     1187                temp="" 
     1188                sprintf temp,"%g",val 
     1189                newList += temp 
     1190                newList += sep 
     1191                ii+=1 
     1192        while(ii<n) 
     1193        return(newList) 
     1194End 
Note: See TracChangeset for help on using the changeset viewer.