Changeset 1094 for sans/Dev


Ignore:
Timestamp:
Apr 6, 2018 3:02:01 PM (5 years ago)
Author:
srkline
Message:

corrected issues with transmission calculation where the popup menu of sample files was limited in number. this limitation has been removed.

fixed the re-calculation of transmission when the same value is to be patched to multiple sample files with the same group ID. now the transmission is calculated once, for the first file in the popup and the values are simply written to the remaining files.

when the box for the open beam is defined, the panel where it is located is written to the file in a new field under /reduction. it is later recalled in the transmission panel.

Defined a "Reference" beam center position for each carriage as the RIGHT panel center. then all other panel centers (L, T, B) can be derived from this value. if the beam center is measured on the Left panel, it is converted to "right" coordinates before reporting.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
Files:
7 edited

Legend:

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

    r1083 r1094  
    881881        // FB 
    882882        newXCtr_cm[3] = xFR - (2.02 + 2.06)/2 
    883         newYCtr_cm[3] = yFR - (0.12 + 0.19)/2 
     883        newYCtr_cm[3] = yFR - (0.12 + 0.19)/2           // (-) is correct here 
    884884        // FT (duplicate FB) 
    885885        newXCtr_cm[2] = newXCtr_cm[3] 
     
    901901         
    902902        // dummy value for B 
    903         newXCtr_cm[8] = 50 
    904         newYCtr_cm[8] = 50 
     903        newXCtr_cm[8] = 340 
     904        newYCtr_cm[8] = 828 
    905905 
    906906                 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DetectorCorrections.ipf

    r1093 r1094  
    549549Function V_ConvertBeamCtr_to_mmB(folder,detStr,destPath) 
    550550        String folder,detStr,destPath 
     551         
     552         
     553        DoAlert 0,"Error - Beam center is being interpreted as pixels, but needs to be in cm. V_ConvertBeamCtr_to_mmB()" 
    551554         
    552555        Wave data_realDistX = $(destPath + ":entry:instrument:detector_"+detStr+":data_realDistX") 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Read.ipf

    r1092 r1094  
    24662466End 
    24672467 
     2468// THIS IS A NON-NICE ENTERED FIELD 
     2469// -- this is the panel string where the box coordinates refer to (for the open beam and transmission) 
     2470Function/S V_getReduction_BoxPanel(fname) 
     2471        String fname 
     2472 
     2473        String path = "entry:reduction:box_panel"        
     2474        Variable num=60 
     2475        return(V_getStringFromHDF5(fname,path,num)) 
     2476End 
     2477 
    24682478Function/WAVE V_getBoxCoordinates(fname) 
    24692479        String fname 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Write.ipf

    r1092 r1094  
    70447044        return(err) 
    70457045end 
     7046 
     7047// THIS IS A NON-NICE ENTERED FIELD 
     7048// -- this is the panel string where the box coordinates refer to (for the open beam and transmission) 
     7049Function V_writeReduction_BoxPanel(fname,str) 
     7050        String fname,str 
     7051 
     7052//      String path = "entry:reduction:comments"         
     7053 
     7054        Make/O/T/N=1 tmpTW 
     7055        String groupName = "/entry/reduction" 
     7056        String varName = "box_panel" 
     7057        tmpTW[0] = str // 
     7058 
     7059        variable err 
     7060        err = V_WriteTextWaveToHDF(fname, groupName, varName, tmpTW) 
     7061        if(err) 
     7062                Print "HDF write err = ",err 
     7063        endif 
     7064         
     7065        // now be sure to kill the data folder to force a re-read of the data next time this file is read in 
     7066//      err = V_KillNamedDataFolder(fname) 
     7067//      if(err) 
     7068//              Print "DataFolder kill err = ",err 
     7069//      endif 
     7070                 
     7071        return(err) 
     7072End 
    70467073 
    70477074//box counts 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Marquee_Operations.ipf

    r1084 r1094  
    301301                Print "X-center (cm) = ",x_mm/10 
    302302                Print "Y-center (cm) = ",y_mm/10 
     303                 
     304                if(cmpstr(detStr,"FR") == 0) 
     305                        Print "FRONT Reference X-center (cm) = ",x_mm/10 
     306                        Print "FRONT Reference Y-center (cm) = ",y_mm/10 
     307                endif 
     308 
     309                if(cmpstr(detStr,"MR") == 0) 
     310                        Print "MIDDLE Reference X-center (cm) = ",x_mm/10 
     311                        Print "MIDDLE Reference Y-center (cm) = ",y_mm/10 
     312                endif 
     313                 
     314// if measured on the LEFT panel, convert to the RIGHT coordinates for the reference value       
     315// these corrections are exactly the opposite of what is done in V_fDeriveBeamCenters(xFR,yFR,xMR,yMR) 
     316                if(cmpstr(detStr,"FL") == 0) 
     317                        Print "FRONT Reference X-center (cm) = ",x_mm/10 + (0.03 + 0.03)/2 
     318                        Print "FRONT Reference Y-center (cm) = ",y_mm/10 - (0.34 + 0.32)/2 
     319                endif 
     320                 
     321                if(cmpstr(detStr,"ML") == 0) 
     322                        Print "MIDDLE Reference X-center (cm) = ",x_mm/10 + (0.06 + 0.05)/2 
     323                        Print "MIDDLE Reference Y-center (cm) = ",y_mm/10 - (0.14 + 0.01)/2 
     324                endif 
    303325        endif 
    304326         
     
    311333 
    312334// 
    313 //function will write new box coordinates to the data file 
     335//function writes new box coordinates to the data file 
     336// 
     337// also writes the panel where the coordinates were set (non-nice field in /reduction) 
    314338// 
    315339Function V_UpdateBoxCoords() :  GraphMarquee 
     
    338362 
    339363                V_writeBoxCoordinates(gCurrentFile,V_List2NumWave(boxStr,";","inW")) 
     364         
     365                V_writeReduction_BoxPanel(gCurrentFile,detStr) 
    340366 
    341367//              count = V_SumCountsInBox(x1,x2,y1,y2,ct_err,gCurDispType,detStr)                 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Transmission.ipf

    r1084 r1094  
    259259                        gSamMatchList = quote + V_getFileIntentPurposeIDList("SAMPLE","SCATTERING",gTrnGrpID,0) + quote 
    260260                        // this resets a global string, since I can't pass a parameter (only constants) in value=fn()            
    261                         PopupMenu popup_0,mode=1,value=#gSamMatchList 
     261//                      PopupMenu popup_0,mode=1,value=#gSamMatchList 
     262                        PopupMenu popup_0,mode=1,value=V_getSamListForPopup() 
    262263                         
    263264                        break 
     
    269270End 
    270271 
     272Function/S V_getSamListForPopup() 
     273 
     274//      String quote = "\"" 
     275        NVAR gTrnGrpID = root:Packages:NIST:VSANS:Globals:Transmission:gTrnGrpID 
     276 
     277        return(V_getFileIntentPurposeIDList("SAMPLE","SCATTERING",gTrnGrpID,0)) 
     278End 
    271279 
    272280Function V_TEmpBeamPopMenuProc(pa) : PopupMenuControl 
     
    281289                        SetVariable setvar_4,value=_STR:V_getSampleDescription(popStr) 
    282290                         
    283 //                      SetVariable setvar_6,value =_STR:"ML" 
    284291 
    285292                        WAVE boxCoord = V_getBoxCoordinates(popStr) 
     
    287294                        SetVariable setvar_5,value=_STR:V_NumWave2List(boxCoord,";") 
    288295                         
     296                        String detStr = V_getReduction_BoxPanel(popStr) 
     297                        SetVariable setvar_6,value =_STR:detStr 
    289298                         
    290299                        break 
     
    373382                        for(ii=0;ii<num;ii+=1) 
    374383                                SamFile = StringFromList(ii, list, ";") 
    375                                 V_CalcOneTransmission(SamFile,TransFile,EmptyFile)                       
     384                                 
     385                                if(ii==0) 
     386                                        // calculate the transmission for the first file 
     387                                        V_CalcOneTransmission(SamFile,TransFile,EmptyFile)       
     388                                else 
     389                                        // then just write in the values (globals) that V_CalcOne determined 
     390                                        NVAR gTrans = root:Packages:NIST:VSANS:Globals:Transmission:gTrans 
     391                                        NVAR gTransErr = root:Packages:NIST:VSANS:Globals:Transmission:gTransErr 
     392                                         
     393                                        // write both out to the sample *scattering* file on disk 
     394                                        V_writeSampleTransmission(SamFile,gTrans) 
     395                                        V_writeSampleTransError(SamFile,gTransErr)       
     396 
     397                                endif            
    376398                        endfor 
    377399                         
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_WorkFolderUtils.ipf

    r1093 r1094  
    498498        //     so that they are DP, not integer 
    499499        // TODO 
    500         // -- currently only redimensioning the data and linear_data_error - What else??? 
    501         // -- ?? some of this is done at load time for RAW data. shouldn't be an issue to re-do the redimension 
     500        // -- currently only redimensioning the data and linear_data_error - anything else??? 
     501        // -- ?? some of this is done at load time for RAW data. Not a problem to re-do the redimension 
    502502        for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 
    503503                detStr = StringFromList(ii, ksDetectorListAll, ";") 
     
    533533        // x-  the "B" detector is calculated in its own routines 
    534534        // -- document what is generated here: 
    535         //    **in each detector folder: data_realDistX and data_realDistY (2D waves of the mm? position of the pixel) 
     535        //    **in each detector folder: data_realDistX and data_realDistY (2D waves of the [mm] position of each pixel) 
    536536        // x- these spatial calculations ARE DONE as the RAW data is loaded. It allows the RAW 
    537537        //    data to be properly displayed, but without all of the (complete) set of detector corrections 
     
    625625 
    626626        // (3) dead time correction 
    627         // TODO: 
    628         // -- test for correct operation 
     627        // DONE: 
     628        // x- test for correct operation 
    629629        // x- loop over all of the detectors 
    630630        // x- B detector is a special case (do separately, then loop over NoB) 
    631         // -- this DOES alter the data 
    632         // -- verify the error propagation (not done yet) 
     631        // x- this DOES alter the data 
     632        // x- verify the error propagation (not done yet) 
    633633        // 
    634634        Variable countRate 
Note: See TracChangeset for help on using the changeset viewer.