Ignore:
Timestamp:
Mar 17, 2017 2:06:42 PM (6 years ago)
Author:
srkline
Message:

adding marquee operations to do a simple box sum, for manual calculation of transmission

Error in LamellarParacrystalline? model has been fixed.

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

Legend:

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

    r1025 r1028  
    8989#include "V_Detector_Isolate" 
    9090#include "V_Protocol_Reduction" 
     91#include "V_Marquee_Operations" 
    9192 
    9293 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Test_RAW_Panel.ipf

    r1027 r1028  
    355355                                testY = ScaleToIndex(w,yloc,1) 
    356356                                 
    357                                 if( (testX > 0 && testX < DimSize(w,0)) && (testY > 0 && testY < DimSize(w,1)) ) 
     357                                if( (testX >= 0 && testX < DimSize(w,0)) && (testY >= 0 && testY < DimSize(w,1)) ) 
    358358                                        // we're in-bounds on this wave 
    359359                                         
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Testing_Data_Procs.ipf

    r1022 r1028  
    4444                Duplicate/O $("root:Packages:NIST:VSANS:VCALC:entry:instrument:detector_"+detStr+":det_"+detStr) tmpData 
    4545                Redimension/I tmpData 
     46                // 
     47                // before, NaN became ugly integer -- now it seems to show up as -1? 
     48                // then, the "fake" error becomes NaN 
    4649                tmpData = (tmpData ==   2147483647) ? 0 : tmpData               //the NaN "mask" in the sim data (T/B only)shows up as an ugly integer 
     50                tmpData = (tmpData ==   -1) ? 0 : tmpData               //the NaN "mask" in the sim data (T/B only)shows up as -1 
    4751                V_writeDetectorData(fileName,detStr,tmpData) 
    4852                 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_WorkFolderUtils.ipf

    r1027 r1028  
    558558         
    559559        // (7) normalize to default monitor counts 
    560         // TODO -- each detector is rescaled separately, but the rescaling factor is global (only one monitor!) 
     560        // TODO(DONE) x- each detector is rescaled separately, but the rescaling factor is global (only one monitor!) 
    561561        // TODO -- but there are TWO monitors - so how to switch? 
     562        //  --- AND, there is also /entry/control/monitor_counts !!! Which one is the correct value? Which will NICE write 
    562563        // TODO -- what do I really need to save? 
    563564         
    564565        NVAR gDoMonitorNormalization = root:Packages:NIST:VSANS:Globals:gDoMonitorNormalization 
    565566        if (gDoMonitorNormalization == 1) 
    566                 Print "(stub)Doing monitor normalization -- INCOMPLETE --"// for "+ detStr 
    567                  
     567                 
     568                Variable monCount,savedMonCount 
    568569                defmon=1e8                      //default monitor counts 
     570                monCount = V_getMonitorCount(fname)                     // TODO -- this is read in since VCALC fakes this on output 
     571//              monCount = V_getBeamMonNormData(fname)          // TODO -- I think this is the *real* one to read 
     572                savedMonCount   = monCount 
     573                scale = defMon/monCount         // scale factor to MULTIPLY data by to rescale to defmon 
     574 
     575                // write to newType=fname will put new values in the destination WORK folder 
     576                V_writeBeamMonNormSaved_count(fname,savedMonCount)                      // save the true count 
     577                V_writeBeamMonNormData(fname,defMon)            // mon ct is now 10^8 
     578                                         
     579//                      // TODO 
     580//                      // the low efficiency monitor, expect to use this for white beam mode 
     581//                              -- need code switch here to determine which monitor to use. 
     582// 
     583//                      V_getBeamMonLowData(fname) 
     584//                      V_getBeamMonLowSaved_count(fname)        
     585                         
    569586                for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 
    570587                        detStr = StringFromList(ii, ksDetectorListAll, ";") 
    571588                        Wave w = V_getDetectorDataW(fname,detStr) 
    572589                        Wave w_err = V_getDetectorDataErrW(fname,detStr) 
    573                         Variable monCt = V_getBeamMonNormData(fname) 
    574         //                      V_MonitorNormalization(fill this in) 
    575                 //scale the data to the default montor counts 
    576                  
    577                 // TODO -- un-comment these three lines once monitor counts are reasonable - currently monCt = 9!!! 
    578         //              scale = defmon/monCt 
    579         //              w *= scale 
    580         //              w_err *= scale          //assumes total monitor count is so large there is essentially no error 
    581          
    582         // TODO 
    583         // -- to write back to the local value, get the wave reference rather than the value, then I can  
    584         //    re-assign the value directly, rather than this method (which is not terrible)      
    585                         // V_getBeamMonNormSaved_count() 
    586                         // save the true monitor counts? save the scaling factor? 
    587                         String path = "entry:instrument:beam_monitor_norm:saved_count" 
    588                         Wave/Z savW = $("root:Packages:NIST:VSANS:"+fname+":"+path) 
    589                         savW[0] = scale 
     590 
     591                        // do the calculation right here. It's a simple scaling and not worth sending to another function.       
     592                        //scale the data and error to the default montor counts 
     593                 
     594// 
     595                        w *= scale 
     596                        w_err *= scale          //assumes total monitor count is so large there is essentially no error 
     597 
     598                        // TODO 
     599                        // -- do I want to update and save the integrated detector count? 
     600                        Variable integratedCount = V_getDet_IntegratedCount(fname,detStr) 
     601                        V_writeDet_IntegratedCount(fname,detStr,integratedCount*scale) 
     602 
    590603                endfor 
    591604        else 
    592605                Print "Monitor Normalization correction NOT DONE" 
    593606        endif 
     607         
    594608         
    595609        // (not done) angle dependent efficiency correction 
    596610        NVAR doEfficiency = root:Packages:NIST:VSANS:Globals:gDoDetectorEffCor 
    597611 
     612// 
     613///// these lines are if files are added together, not done (yet) for VSANS 
     614// 
    598615//update totals to put in the work header (at the end of the function) 
    599616//      total_mon += realsread[0] 
     
    606623//       
    607624 
    608         //all is done, except for the bookkeeping, updating the header information in the work folder 
    609  
    610 //      integersread[3] = total_numruns                                         //numruns = 1 
    611 //      realsread[1] = total_mon                        //save the true monitor count 
    612 //      realsread[0] = defmon                                   //monitor ct = defmon 
    613 //      realsread[2] = scale*total_det                  //scaled detector counts 
    614625//       
    615626        //reset the current displaytype to "newtype" 
Note: See TracChangeset for help on using the changeset viewer.