Ignore:
Timestamp:
May 20, 2016 4:28:56 PM (6 years ago)
Author:
srkline
Message:

changes to a few analysis models to make these Igor 7-ready

adding mask editing utilities

many changes to event mode for easier processing of split lists

updated event mode help file

+ lots more!

File:
1 edited

Legend:

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

    r995 r999  
    408408                        Wave w_err = V_getDetectorDataErrW(fname,detStr) 
    409409                         
    410                         DIVCorrection(w,w_err,detStr,newType) 
     410                        V_DIVCorrection(w,w_err,detStr,newType) 
    411411                endfor 
    412412        else 
    413                 Print "DIV correction not done"         // not an error since correction was unchecked 
     413                Print "DIV correction NOT DONE"         // not an error since correction was unchecked 
    414414        endif 
    415415         
    416416        // (2) non-linear correction     
    417417        // TODO: 
    418         // x- currently, the "B" detector is skipped 
     418        // x-  the "B" detector is calculated in its own routines 
    419419        // -- document what is generated here: 
    420420        //    **in each detector folder: data_realDistX and data_realDistY (2D waves of the mm? position of the pixel) 
    421         // -- still not sure whether to duplicate these calculations as the RAW data is loaded. It would allow the RAW 
    422         //    data to be properly displayed, but without all of the (complete) set of corrections 
     421        // x- these spatial calculations ARE DONE as the RAW data is loaded. It allows the RAW 
     422        //    data to be properly displayed, but without all of the (complete) set of detector corrections 
    423423        // * the corrected distances are calculated into arrays, but nothing is done with them yet 
    424         // * there is enough information now to calculate the q-arrays 
    425         // -other corrections modify the data, this does NOT 
     424        // * there is enough information now to calculate the q-arrays, so it is done now 
     425        // - other corrections may modify the data, this calculation does NOT modify the data 
    426426        NVAR gDoNonLinearCor = root:Packages:NIST:VSANS:Globals:gDoNonLinearCor 
    427427        // generate a distance matrix for each of the detectors 
     
    461461                 
    462462        else 
    463                 Print "Non-linear correction not done" 
     463                Print "Non-linear correction NOT DONE" 
    464464        endif 
    465465 
    466466        // (3) solid angle correction 
     467        // TODO -- this currently calculates the correction factor AND applys it to the data 
     468        //  -- as a result, the data values are very large since they are divided by a very small 
     469        //     solid angle per pixel. But all of the count values are now on the basis of  
     470        //    counts/(solid angle) --- meaning that they can all be binned together for I(q) 
     471        //    -and- TODO - this will need to be taken into account for absolute scaling (this part is already done) 
     472        // 
     473        // the solid angle correction is calculated for ALL detector panels. 
    467474        NVAR gDoSolidAngleCor = root:Packages:NIST:VSANS:Globals:gDoSolidAngleCor 
    468475        if (gDoSolidAngleCor == 1) 
     
    473480                        Wave w_err = V_getDetectorDataErrW(fname,detStr) 
    474481                        // any other dimensions to pass in? 
    475 //                      SolidAngleCorrection(fill this in) 
     482                        SolidAngleCorrection(w,w_err,fname,detStr,destPath) 
    476483                         
    477484                endfor 
    478485        else 
    479                 Print "Solid Angle correction not done" 
     486                Print "Solid Angle correction NOT DONE" 
    480487        endif    
    481488         
    482489        // (4) dead time correction 
    483         // TODO: -- remove the hard-wired test 
     490        // TODO: 
     491        // x- remove the hard-wired test - done 
    484492        // -- test for correct operation 
    485         // -- loop over all of the detectors 
    486         // -- B detector is a special case (do separately, then loop over NoB) 
     493        // x- loop over all of the detectors 
     494        // x- B detector is a special case (do separately, then loop over NoB) 
    487495        // -- this DOES alter the data 
    488         // -- verify the error propagation 
     496        // -- verify the error propagation (not done yet) 
    489497        // 
    490498        Variable countRate 
     
    515523                 
    516524        else 
    517                 Print "Dead Time correction not done" 
     525                Print "Dead Time correction NOT DONE" 
    518526        endif    
    519527         
    520528         
    521529        // (5) angle-dependent tube shadowing 
     530        // TODO: 
     531        // -- not sure about this correction yet... 
     532        // 
    522533        NVAR gDoTubeShadowCor = root:Packages:NIST:VSANS:Globals:gDoTubeShadowCor 
    523534        if (gDoTubeShadowCor == 1) 
    524          
    525         else 
    526                 Print "Tube shadowing correction not done" 
     535                Print "(stub)Tube Shadow correction" 
     536        else 
     537                Print "Tube shadowing correction NOT DONE" 
    527538        endif    
    528539                 
    529540        // (6) angle dependent transmission correction 
     541        // TODO: 
     542        // -- this still needs to be filled in 
     543        // -- still some debate of when/where in the corrections that this is best applied 
     544        //    - do it here, and it's done whether the output is 1D or 2D 
     545        //    - do it later (where SAMPLE information is used) since this section is ONLY instrument-specific 
    530546        NVAR gDoTrans = root:Packages:NIST:VSANS:Globals:gDoTransmissionCor 
    531547        if (gDoTrans == 1) 
    532                 Print "Doing Large-angle transmission correction"// for "+ detStr 
     548                Print "(stub)Doing Large-angle transmission correction"// for "+ detStr 
    533549                for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 
    534550                        detStr = StringFromList(ii, ksDetectorListAll, ";") 
     
    539555                endfor 
    540556        else 
    541                 Print "Sample Transmission correction not done" 
     557                Print "Sample Transmission correction NOT DONE" 
    542558        endif    
    543559         
     
    546562        // TODO -- but there are TWO monitors - so how to switch? 
    547563        // TODO -- what do I really need to save? 
    548         Print "Doing monitor normalization"// for "+ detStr 
    549  
    550         defmon=1e8                      //default monitor counts 
    551         for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 
    552                 detStr = StringFromList(ii, ksDetectorListAll, ";") 
    553                 Wave w = V_getDetectorDataW(fname,detStr) 
    554                 Wave w_err = V_getDetectorDataErrW(fname,detStr) 
    555                 Variable monCt = V_getBeamMonNormData(fname) 
    556 //                      MonitorNormalization(fill this in) 
    557         //scale the data to the default montor counts 
    558          
    559         // TODO -- un-comment these three lines once monitor counts are reasonable - currently monCt = 9!!! 
    560 //              scale = defmon/monCt 
    561 //              w *= scale 
    562 //              w_err *= scale          //assumes total monitor count is so large there is essentially no error 
    563  
    564 // TODO 
    565 // -- to write back to the local value, get the wave reference rather than the value, then I can  
    566 //    re-assign the value directly, rather than this method (which is not terrible)      
    567                 // V_getBeamMonNormSaved_count() 
    568                 // save the true monitor counts? save the scaling factor? 
    569                 String path = "entry:instrument:beam_monitor_norm:saved_count" 
    570                 Wave/Z savW = $("root:Packages:NIST:VSANS:"+fname+":"+path) 
    571                 savW[0] = scale 
    572         endfor 
    573          
     564         
     565        NVAR gDoMonitorNormalizaton = root:Packages:NIST:VSANS:Globals:gDoMonitorNormalizaton 
     566        if (gDoMonitorNormalizaton == 1) 
     567                Print "(stub)Doing monitor normalization"// for "+ detStr 
     568                 
     569                defmon=1e8                      //default monitor counts 
     570                for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 
     571                        detStr = StringFromList(ii, ksDetectorListAll, ";") 
     572                        Wave w = V_getDetectorDataW(fname,detStr) 
     573                        Wave w_err = V_getDetectorDataErrW(fname,detStr) 
     574                        Variable monCt = V_getBeamMonNormData(fname) 
     575        //                      MonitorNormalization(fill this in) 
     576                //scale the data to the default montor counts 
     577                 
     578                // TODO -- un-comment these three lines once monitor counts are reasonable - currently monCt = 9!!! 
     579        //              scale = defmon/monCt 
     580        //              w *= scale 
     581        //              w_err *= scale          //assumes total monitor count is so large there is essentially no error 
     582         
     583        // TODO 
     584        // -- to write back to the local value, get the wave reference rather than the value, then I can  
     585        //    re-assign the value directly, rather than this method (which is not terrible)      
     586                        // V_getBeamMonNormSaved_count() 
     587                        // save the true monitor counts? save the scaling factor? 
     588                        String path = "entry:instrument:beam_monitor_norm:saved_count" 
     589                        Wave/Z savW = $("root:Packages:NIST:VSANS:"+fname+":"+path) 
     590                        savW[0] = scale 
     591                endfor 
     592        else 
     593                Print "Monitor Normalization correction NOT DONE" 
     594        endif 
    574595         
    575596        // (not done) angle dependent efficiency correction 
    576597        NVAR doEfficiency = root:Packages:NIST:VSANS:Globals:gDoDetectorEffCor 
    577598 
    578          
    579 // this function, in the past did the non-linear, solid angle, transmission, and efficiency corrections all at once 
    580 //      DetCorr(data,data_err,realsread,doEfficiency,doTrans)           //the parameters are waves, and will be changed by the function 
    581  
    582  
    583          
    584         //update totals to put in the work header (at the end of the function) 
     599//update totals to put in the work header (at the end of the function) 
    585600//      total_mon += realsread[0] 
    586601// 
Note: See TracChangeset for help on using the changeset viewer.