Ignore:
Timestamp:
Aug 3, 2009 6:22:39 PM (13 years ago)
Author:
srkline
Message:

Lots of changes to add the first version of a USANS simulator, like SASCALC

(!) first issue is with the entanglement of dependencies - need to load SANS macros first!

otherwise, worth a first test for interface and accuracy. behavior is similar to the 1D SASCALC

Location:
sans/Dev/trunk/NCNR_User_Procedures
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/Wrapper_v40.ipf

    r516 r544  
    195195Function/S W_FunctionPopupList() 
    196196        String list,tmp 
    197         list = FunctionList("*",";","KIND:10")          //get every user defined curve fit function 
    198  
    199         //now start to remove everything the user doesn't need to see... 
    200  
    201         tmp = FunctionList("*_proto",";","KIND:10")             //prototypes 
    202         list = RemoveFromList(tmp, list  ,";") 
    203          
    204         //prototypes that show up if GF is loaded 
    205         list = RemoveFromList("GFFitFuncTemplate", list) 
    206         list = RemoveFromList("GFFitAllAtOnceTemplate", list) 
    207         list = RemoveFromList("NewGlblFitFunc", list) 
    208         list = RemoveFromList("NewGlblFitFuncAllAtOnce", list) 
    209         list = RemoveFromList("GlobalFitFunc", list) 
    210         list = RemoveFromList("GlobalFitAllAtOnce", list) 
    211         list = RemoveFromList("GFFitAAOStructTemplate", list) 
    212         list = RemoveFromList("NewGF_SetXWaveInList", list) 
    213         list = RemoveFromList("NewGlblFitFuncAAOStruct", list) 
    214          
    215         // more to remove as a result of 2D/Gizmo 
    216         list = RemoveFromList("A_WMRunLessThanDelta", list) 
    217         list = RemoveFromList("WMFindNaNValue", list) 
    218         list = RemoveFromList("WM_Make3DBarChartParametricWave", list) 
    219         list = RemoveFromList("UpdateQxQy2Mat", list) 
    220         list = RemoveFromList("MakeBSMask", list) 
    221          
    222         // MOTOFIT/GenFit bits 
    223         tmp = "GEN_allatoncefitfunc;GEN_fitfunc;GetCheckBoxesState;MOTO_GFFitAllAtOnceTemplate;MOTO_GFFitFuncTemplate;MOTO_NewGF_SetXWaveInList;MOTO_NewGlblFitFunc;MOTO_NewGlblFitFuncAllAtOnce;GeneticFit_UnSmearedModel;GeneticFit_SmearedModel;" 
    224         list = RemoveFromList(tmp, list  ,";") 
    225  
    226         // SANS Reduction bits 
    227         tmp = "ASStandardFunction;Ann_1D_Graph;Avg_1D_Graph;BStandardFunction;CStandardFunction;Draw_Plot1D;MyMat2XYZ;NewDirection;SANSModelAAO_MCproto;Monte_SANS_Threaded;Monte_SANS_NotThreaded;Monte_SANS_W1;Monte_SANS_W2;Monte_SANS;FractionReachingDetector;" 
    228         list = RemoveFromList(tmp, list  ,";") 
    229  
    230         // USANS Reduction bits 
    231         tmp = "DSM_Guinier_Fit;RemoveMaskedPoints;" 
    232         list = RemoveFromList(tmp, list  ,";") 
    233  
    234         //more functions from analysis models (2008) 
    235         tmp = "Barbell_Inner;Barbell_Outer;Barbell_integrand;BCC_Integrand;Integrand_BCC_Inner;Integrand_BCC_Outer;" 
    236         list = RemoveFromList(tmp, list  ,";") 
    237         tmp = "CapCyl;CapCyl_Inner;CapCyl_Outer;ConvLens;ConvLens_Inner;ConvLens_Outer;" 
    238         list = RemoveFromList(tmp, list  ,";") 
    239         tmp = "Dumb;Dumb_Inner;Dumb_Outer;FCC_Integrand;Integrand_FCC_Inner;Integrand_FCC_Outer;" 
    240         list = RemoveFromList(tmp, list  ,";") 
    241         tmp = "Integrand_SC_Inner;Integrand_SC_Outer;SC_Integrand;SphCyl;SphCyl_Inner;SphCyl_Outer;" 
    242         list = RemoveFromList(tmp, list  ,";") 
    243  
    244  
    245         tmp = FunctionList("f*",";","NPARAMS:2")                //point calculations 
    246         list = RemoveFromList(tmp, list  ,";") 
    247          
    248         tmp = FunctionList("fSmear*",";","NPARAMS:3")           //smeared dependency calculations 
    249         list = RemoveFromList(tmp, list  ,";") 
    250          
    251 //      tmp = FunctionList("*X",";","KIND:4")           //XOPs, but these shouldn't show up if KIND:10 is used initially 
    252 //      Print "X* = ",tmp 
    253 //      print " " 
    254 //      list = RemoveFromList(tmp, list  ,";") 
    255          
    256         //non-fit functions that I can't seem to filter out 
    257         list = RemoveFromList("BinaryHS_PSF11;BinaryHS_PSF12;BinaryHS_PSF22;EllipCyl_Integrand;PP_Inner;PP_Outer;Phi_EC;TaE_Inner;TaE_Outer;",list,";") 
     197        //get every user defined curve fit function, remove everything the user doesn't need to see... 
     198        list = User_FunctionPopupList()          
    258199 
    259200        if(strlen(list)==0) 
  • sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/PlotManager/PlotUtilsMacro_v40.ipf

    r516 r544  
    902902        return outputPath 
    903903End 
     904 
     905// a function common to many panels, so put the basic version here that simply 
     906// returns null string if no functions are present. Calling procedures can  
     907// add to the list to customize as needed. 
     908// show the available models 
     909// not the f*(cw,xw) point calculations 
     910// not the *X(cw,xw) XOPS 
     911// 
     912// KIND:10 should show only user-defined curve fitting functions 
     913// - not XOPs 
     914// - not other user-defined functions 
     915Function/S User_FunctionPopupList() 
     916        String list,tmp 
     917        list = FunctionList("*",";","KIND:10")          //get every user defined curve fit function 
     918 
     919        //now start to remove everything the user doesn't need to see... 
     920 
     921        tmp = FunctionList("*_proto",";","KIND:10")             //prototypes 
     922        list = RemoveFromList(tmp, list  ,";") 
     923         
     924        //prototypes that show up if GF is loaded 
     925        list = RemoveFromList("GFFitFuncTemplate", list) 
     926        list = RemoveFromList("GFFitAllAtOnceTemplate", list) 
     927        list = RemoveFromList("NewGlblFitFunc", list) 
     928        list = RemoveFromList("NewGlblFitFuncAllAtOnce", list) 
     929        list = RemoveFromList("GlobalFitFunc", list) 
     930        list = RemoveFromList("GlobalFitAllAtOnce", list) 
     931        list = RemoveFromList("GFFitAAOStructTemplate", list) 
     932        list = RemoveFromList("NewGF_SetXWaveInList", list) 
     933        list = RemoveFromList("NewGlblFitFuncAAOStruct", list) 
     934         
     935        // more to remove as a result of 2D/Gizmo 
     936        list = RemoveFromList("A_WMRunLessThanDelta", list) 
     937        list = RemoveFromList("WMFindNaNValue", list) 
     938        list = RemoveFromList("WM_Make3DBarChartParametricWave", list) 
     939        list = RemoveFromList("UpdateQxQy2Mat", list) 
     940        list = RemoveFromList("MakeBSMask", list) 
     941         
     942        // MOTOFIT/GenFit bits 
     943        tmp = "GEN_allatoncefitfunc;GEN_fitfunc;GetCheckBoxesState;MOTO_GFFitAllAtOnceTemplate;MOTO_GFFitFuncTemplate;MOTO_NewGF_SetXWaveInList;MOTO_NewGlblFitFunc;MOTO_NewGlblFitFuncAllAtOnce;GeneticFit_UnSmearedModel;GeneticFit_SmearedModel;" 
     944        list = RemoveFromList(tmp, list  ,";") 
     945 
     946        // SANS Reduction bits 
     947        tmp = "ASStandardFunction;Ann_1D_Graph;Avg_1D_Graph;BStandardFunction;CStandardFunction;Draw_Plot1D;MyMat2XYZ;NewDirection;SANSModelAAO_MCproto;Monte_SANS_Threaded;Monte_SANS_NotThreaded;Monte_SANS_W1;Monte_SANS_W2;Monte_SANS;FractionReachingDetector;" 
     948        list = RemoveFromList(tmp, list  ,";") 
     949 
     950        // USANS Reduction bits 
     951        tmp = "DSM_Guinier_Fit;RemoveMaskedPoints;" 
     952        list = RemoveFromList(tmp, list  ,";") 
     953 
     954        //more functions from analysis models (2008) 
     955        tmp = "Barbell_Inner;Barbell_Outer;Barbell_integrand;BCC_Integrand;Integrand_BCC_Inner;Integrand_BCC_Outer;" 
     956        list = RemoveFromList(tmp, list  ,";") 
     957        tmp = "CapCyl;CapCyl_Inner;CapCyl_Outer;ConvLens;ConvLens_Inner;ConvLens_Outer;" 
     958        list = RemoveFromList(tmp, list  ,";") 
     959        tmp = "Dumb;Dumb_Inner;Dumb_Outer;FCC_Integrand;Integrand_FCC_Inner;Integrand_FCC_Outer;" 
     960        list = RemoveFromList(tmp, list  ,";") 
     961        tmp = "Integrand_SC_Inner;Integrand_SC_Outer;SC_Integrand;SphCyl;SphCyl_Inner;SphCyl_Outer;" 
     962        list = RemoveFromList(tmp, list  ,";") 
     963 
     964 
     965        tmp = FunctionList("f*",";","NPARAMS:2")                //point calculations 
     966        list = RemoveFromList(tmp, list  ,";") 
     967         
     968        tmp = FunctionList("fSmear*",";","NPARAMS:3")           //smeared dependency calculations 
     969        list = RemoveFromList(tmp, list  ,";") 
     970         
     971//      tmp = FunctionList("*X",";","KIND:4")           //XOPs, but these shouldn't show up if KIND:10 is used initially 
     972//      Print "X* = ",tmp 
     973//      print " " 
     974//      list = RemoveFromList(tmp, list  ,";") 
     975         
     976        //non-fit functions that I can't seem to filter out 
     977        list = RemoveFromList("BinaryHS_PSF11;BinaryHS_PSF12;BinaryHS_PSF22;EllipCyl_Integrand;PP_Inner;PP_Outer;Phi_EC;TaE_Inner;TaE_Outer;",list,";") 
     978 
     979        list = SortList(list) 
     980        return(list) 
     981End 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/AvgGraphics.ipf

    r477 r544  
    7474         
    7575        NVAR isLogScale = $(dest + ":gIsLogScale") 
     76        Variable wasLogScale=isLogScale 
     77         
    7678        if(isLogScale) 
    7779                ConvertFolderToLinearScale(type) 
    7880                //rename the button to reflect "isLin" - the displayed name must have been isLog 
    79                 DoWindow/F SANS_Data 
    80                 MapSliderProc("reset", 0, 1)            //force default values for color mapping 
    81                 Button bisLog,title="isLin",rename=bisLin 
    82                 DoWindow/F Average_Panel 
    83                 DoUpdate 
     81//              DoWindow/F SANS_Data 
     82//              MapSliderProc("reset", 0, 1)            //force default values for color mapping 
     83//              Button bisLog,title="isLin",rename=bisLin 
     84//              DoWindow/F Average_Panel 
     85//              DoUpdate 
    8486        Endif 
    8587 
     
    154156        endswitch 
    155157         
     158        //convert back to log scaling if I changed it... 
     159        if(wasLogScale) 
     160                ConvertFolderToLogScale(type) 
     161                DoUpdate 
     162        endif 
     163         
    156164        //clear the stuff that was created for case of saving files 
    157165        If(doSave) 
     
    159167                String/G root:myGlobals:Protocols:gProtoStr = "" 
    160168        Endif 
     169         
     170         
    161171        return(0) 
    162172         
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Includes_v520.ipf

    r529 r544  
    112112        "Patch Monitor Count" 
    113113        "Read Monitor Count" 
     114        "Read Detector Count" 
    114115        "-" 
    115116        "AddALLToLayout" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MultScatter_MonteCarlo_2D.ipf

    r542 r544  
    473473                                        // this would not be true if simulating anisotropic scattering. 
    474474                                        //testPhi = abs(enoise(1))*2*Pi 
    475                                         testPhi = FindPhi(Vx,Vy)                //use the exiting phi value as defined by Vx and Vy 
     475                                        testPhi = MC_FindPhi(Vx,Vy)             //use the exiting phi value as defined by Vx and Vy 
    476476                                         
    477477                                        // is it on the detector?        
     
    731731Function/S MC_FunctionPopupList() 
    732732        String list,tmp 
    733         list = FunctionList("*",";","KIND:10")          //get every user defined curve fit function 
    734  
    735         //now start to remove everything the user doesn't need to see... 
    736                  
    737         tmp = FunctionList("*_proto",";","KIND:10")             //prototypes 
    738         list = RemoveFromList(tmp, list  ,";") 
    739         //prototypes that show up if GF is loaded 
    740         list = RemoveFromList("GFFitFuncTemplate", list) 
    741         list = RemoveFromList("GFFitAllAtOnceTemplate", list) 
    742         list = RemoveFromList("NewGlblFitFunc", list) 
    743         list = RemoveFromList("NewGlblFitFuncAllAtOnce", list) 
    744         list = RemoveFromList("GlobalFitFunc", list) 
    745         list = RemoveFromList("GlobalFitAllAtOnce", list) 
    746         list = RemoveFromList("GFFitAAOStructTemplate", list) 
    747         list = RemoveFromList("NewGF_SetXWaveInList", list) 
    748         list = RemoveFromList("NewGlblFitFuncAAOStruct", list) 
    749          
    750         // more to remove as a result of 2D/Gizmo 
    751         list = RemoveFromList("A_WMRunLessThanDelta", list) 
    752         list = RemoveFromList("WMFindNaNValue", list) 
    753         list = RemoveFromList("WM_Make3DBarChartParametricWave", list) 
    754         list = RemoveFromList("UpdateQxQy2Mat", list) 
    755         list = RemoveFromList("MakeBSMask", list) 
    756          
    757         // MOTOFIT/GenFit bits 
    758         tmp = "GEN_allatoncefitfunc;GEN_fitfunc;GetCheckBoxesState;MOTO_GFFitAllAtOnceTemplate;MOTO_GFFitFuncTemplate;MOTO_NewGF_SetXWaveInList;MOTO_NewGlblFitFunc;MOTO_NewGlblFitFuncAllAtOnce;GeneticFit_UnSmearedModel;GeneticFit_SmearedModel;" 
    759         list = RemoveFromList(tmp, list  ,";") 
    760  
    761         // SANS Reduction bits 
    762         tmp = "ASStandardFunction;Ann_1D_Graph;Avg_1D_Graph;BStandardFunction;CStandardFunction;Draw_Plot1D;MyMat2XYZ;NewDirection;SANSModelAAO_MCproto;Monte_SANS_Threaded;Monte_SANS_NotThreaded;Monte_SANS_W1;Monte_SANS_W2;FractionReachingDetector;" 
    763         list = RemoveFromList(tmp, list  ,";") 
    764         list = RemoveFromList("Monte_SANS", list) 
    765  
    766         tmp = FunctionList("f*",";","NPARAMS:2")                //point calculations 
    767         list = RemoveFromList(tmp, list  ,";") 
    768          
    769         tmp = FunctionList("fSmear*",";","NPARAMS:3")           //smeared dependency calculations 
    770         list = RemoveFromList(tmp, list  ,";") 
    771          
    772         //non-fit functions that I can't seem to filter out 
    773         list = RemoveFromList("BinaryHS_PSF11;BinaryHS_PSF12;BinaryHS_PSF22;EllipCyl_Integrand;PP_Inner;PP_Outer;Phi_EC;TaE_Inner;TaE_Outer;",list,";") 
    774 //////////////// 
    775  
    776         //more functions from analysis models (2008) 
    777         tmp = "Barbell_Inner;Barbell_Outer;Barbell_integrand;BCC_Integrand;Integrand_BCC_Inner;Integrand_BCC_Outer;" 
    778         list = RemoveFromList(tmp, list  ,";") 
    779         tmp = "CapCyl;CapCyl_Inner;CapCyl_Outer;ConvLens;ConvLens_Inner;ConvLens_Outer;" 
    780         list = RemoveFromList(tmp, list  ,";") 
    781         tmp = "Dumb;Dumb_Inner;Dumb_Outer;FCC_Integrand;Integrand_FCC_Inner;Integrand_FCC_Outer;" 
    782         list = RemoveFromList(tmp, list  ,";") 
    783         tmp = "Integrand_SC_Inner;Integrand_SC_Outer;SC_Integrand;SphCyl;SphCyl_Inner;SphCyl_Outer;" 
    784         list = RemoveFromList(tmp, list  ,";") 
    785  
     733        list = User_FunctionPopupList() 
     734         
    786735        //simplify the display, forcing smeared calculations behind the scenes 
    787736        tmp = FunctionList("Smear*",";","NPARAMS:1")            //smeared dependency calculations 
    788         list = RemoveFromList(tmp, list  ,";") 
     737        list = RemoveFromList(tmp, list,";") 
     738 
    789739 
    790740        if(strlen(list)==0) 
     
    794744        list = SortList(list) 
    795745         
    796 //      list = "default;"+list 
    797746        return(list) 
    798747End               
     
    1005954// 
    1006955// currently only works with SANS data, but can later be expanded to generate fake USANS data sets 
     956// ---- use FakeUSANSDataFolder() instead---- 
    1007957// 
    1008958Function        Fake1DDataFolder(qval,aveint,sigave,sigmaQ,qbar,fSubs,dataFolder) 
     
    12531203end 
    12541204 
     1205//phi is defined from +x axis, proceeding CCW around [0,2Pi] 
     1206ThreadSafe Function MC_FindPhi(vx,vy) 
     1207        variable vx,vy 
     1208         
     1209        variable phi 
     1210         
     1211        phi = atan(vy/vx)               //returns a value from -pi/2 to pi/2 
     1212         
     1213        // special cases 
     1214        if(vx==0 && vy > 0) 
     1215                return(pi/2) 
     1216        endif 
     1217        if(vx==0 && vy < 0) 
     1218                return(3*pi/2) 
     1219        endif 
     1220        if(vx >= 0 && vy == 0) 
     1221                return(0) 
     1222        endif 
     1223        if(vx < 0 && vy == 0) 
     1224                return(pi) 
     1225        endif 
     1226         
     1227         
     1228        if(vx > 0 && vy > 0) 
     1229                return(phi) 
     1230        endif 
     1231        if(vx < 0 && vy > 0) 
     1232                return(phi + pi) 
     1233        endif 
     1234        if(vx < 0 && vy < 0) 
     1235                return(phi + pi) 
     1236        endif 
     1237        if( vx > 0 && vy < 0) 
     1238                return(phi + 2*pi) 
     1239        endif 
     1240         
     1241        return(phi) 
     1242end 
     1243 
     1244 
     1245 
    12551246 
    12561247 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_DataReadWrite.ipf

    r502 r544  
    26402640        return(0) 
    26412641End 
     2642 
     2643 
     2644///// 
     2645Proc ReadDetectorCount(firstFile,lastFile) 
     2646        Variable firstFile=1,lastFile=100 
     2647         
     2648        fReadDetectorCount(firstFile,lastFile) 
     2649End 
     2650 
     2651 
     2652// simple utility to read the detector count from the header, and the summed data value 
     2653// and print out the values 
     2654Function fReadDetectorCount(lo,hi) 
     2655        Variable lo,hi 
     2656         
     2657        String file 
     2658        Variable ii,summed 
     2659         
     2660        for(ii=lo;ii<=hi;ii+=1) 
     2661                file = FindFileFromRunNumber(ii) 
     2662                if(strlen(file) != 0) 
     2663                        ReadHeaderAndData(file) 
     2664                        Wave rw=root:Packages:NIST:RAW:RealsRead 
     2665                        Wave data=root:Packages:NIST:RAW:data                   //data as read in is linear 
     2666                        summed = sum(data,-inf,inf) 
     2667                        printf "File %d:  DetCt Header = %g\t Detector Sum = %g\t Ratio sum/hdr = %g\r",ii,rw[2],summed,summed/rw[2] 
     2668                else 
     2669                        printf "run number %d not found\r",ii 
     2670                endif 
     2671        endfor 
     2672         
     2673        return(0) 
     2674End 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ProDiv.ipf

    r541 r544  
    375375                case 2: // mouse up 
    376376                        // click code here 
    377                         //parse for the first run number 
    378                         SVAR gPlex = root:myGlobals:Protocols:gPlex 
    379                         String item,fname 
    380                          
    381                         item = StringFromList(0, gPlex ,",") 
    382                         fname = FindFileFromRunNumber(str2num(item)) 
    383                         if(strlen(fname) == 0) 
    384                                 Abort "Bad file number in Plex field" 
    385                         endif 
    386                         // load the file 
    387                         ReadHeaderAndData(fname)        //this is the full Path+file 
    388                         UpdateDisplayInformation("RAW") 
    389                         //draw a box of the specified size. This is persistent on the display as you scroll to the offset data 
    390                         NVAR x1 = root:myGlobals:Protocols:gPlexX1 
    391                         NVAR x2 = root:myGlobals:Protocols:gPlexX2 
    392                         NVAR y1 = root:myGlobals:Protocols:gPlexY1 
    393                         NVAR y2 = root:myGlobals:Protocols:gPlexY2 
    394                          
    395                         SetDrawLayer/W=SANS_Data/K UserFront                    //set the layer, and clear it 
    396                         SetDrawEnv/W=SANS_Data xcoord=bottom,ycoord=left,fillpat=0,linethick=3,linefgc=(65535, 65535, 65535) 
    397                         DrawRect/W=SANS_Data x1, y2, x2, y1 
    398                                                  
     377                        if(cmpstr(ba.ctrlName, "ShowBox") == 0) 
     378                         
     379                                //parse for the first run number 
     380                                SVAR gPlex = root:myGlobals:Protocols:gPlex 
     381                                String item,fname 
     382                                 
     383                                item = StringFromList(0, gPlex ,",") 
     384                                fname = FindFileFromRunNumber(str2num(item)) 
     385                                if(strlen(fname) == 0) 
     386                                        Abort "Bad file number in Plex field" 
     387                                endif 
     388                                // load the file 
     389                                ReadHeaderAndData(fname)        //this is the full Path+file 
     390                                UpdateDisplayInformation("RAW") 
     391                                //draw a box of the specified size. This is persistent on the display as you scroll to the offset data 
     392                                NVAR x1 = root:myGlobals:Protocols:gPlexX1 
     393                                NVAR x2 = root:myGlobals:Protocols:gPlexX2 
     394                                NVAR y1 = root:myGlobals:Protocols:gPlexY1 
     395                                NVAR y2 = root:myGlobals:Protocols:gPlexY2 
     396                                 
     397                                SetDrawLayer/W=SANS_Data/K UserFront                    //set the layer, and clear it 
     398                                SetDrawEnv/W=SANS_Data xcoord=bottom,ycoord=left,fillpat=0,linethick=3,linefgc=(65535, 65535, 65535) 
     399                                DrawRect/W=SANS_Data x1, y2, x2, y1 
     400                                 
     401                                Button $ba.ctrlName,title="Clear Box",rename=HideBox,win=DIV_Panel 
     402                                 
     403                        else 
     404                                if(winType("SANS_Data")==1) 
     405                                        SetDrawLayer/W=SANS_Data/K UserFront                    //set the layer, and clear it 
     406                                        Button $ba.ctrlName,title="Show Box",rename=ShowBox,win=DIV_Panel 
     407                                else 
     408                                        Button $ba.ctrlName,title="Show Box",rename=ShowBox,win=DIV_Panel 
     409                                endif 
     410                        endif    
     411                         
    399412                        break 
    400413        endswitch 
     
    545558//      SetVariable setvar003,pos={16,441},size={250,15},title="DIV FILE NAME" 
    546559//      SetVariable setvar003,value= root:myGlobals:Protocols:gPlexName 
    547         Button button0,pos={226,325},size={90,20},proc=ShowBoxButtonProc,title="Show Box" 
     560        Button ShowBox,pos={226,325},size={90,20},proc=ShowBoxButtonProc,title="Show Box" 
    548561        Button button1,pos={25,441},size={150,20},proc=GenerateDIVButtonProc,title="Generate DIV File" 
    549562        Button button2,pos={25,481},size={150,20},proc=ReloadDIVButtonProc,title="Load DIV File" 
     563        Button button4,pos={240,481},size={80,20},proc=DoneDIVButtonProc,title="Done" 
    550564        Button button3,pos={240,10},size={50,20},proc=DIVHelpButtonProc,title="Help" 
    551565        SetVariable setvar00201,pos={84,297},size={50,15},limits={0,128,1},title=" ",value= root:myGlobals:Protocols:gPlexY2 
     
    555569EndMacro 
    556570 
     571 
     572// done 
     573// 
     574Function DoneDIVButtonProc(ba) : ButtonControl 
     575        STRUCT WMButtonAction &ba 
     576 
     577        switch( ba.eventCode ) 
     578                case 2: // mouse up 
     579                        // click code here 
     580                        DoWindow/K DIV_Panel 
     581                        break 
     582        endswitch 
     583 
     584        return 0 
     585End 
    557586 
    558587// load in a DIV file, print out the stats, display in SANS_Data 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/WriteQIS.ipf

    r509 r544  
    436436        //not demo- compatible, but approx 100x faster!! 
    437437         
    438 #if(cmpstr(stringbykey("IGORKIND",IgorInfo(0),":",";"),"pro") == 0) 
    439         Save/G/M="\r\n" labelWave,spWave as fullPath 
    440 #else 
     438// for some reason, Igor 6.10 barfs on this and the Save operation gives an out-of-memory error! 
     439// so for now, go back to the old way... 
     440 
     441//#if(cmpstr(stringbykey("IGORKIND",IgorInfo(0),":",";"),"pro") == 0) 
     442//      Save/G/M="\r\n" labelWave,spWave as fullPath 
     443//#else 
    441444        Open refNum as fullpath 
    442445        wfprintf refNum,"%s\r\n",labelWave 
     
    444447        wfprintf refNum,"%g\r\n",spWave 
    445448        Close refNum 
    446 #endif 
     449//#endif 
    447450 
    448451        Killwaves/Z spWave,labelWave            //don't delete proto! 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/COR_Graph.ipf

    r477 r544  
    300300                        CheckBox $ctrlName, value=0             //not checked 
    301301                        HideInfo/W=COR_Graph 
    302                         Cursor/K A 
    303                         Cursor/K B 
     302                        Cursor/K/W=COR_Graph A 
     303                        Cursor/K/W=COR_Graph B 
    304304                        DoAlert 0,type+" data is not on the graph" 
    305305                endif 
     
    307307                //hide info and cursors, if there are any displayed 
    308308                HideInfo/W=COR_Graph 
    309                 Cursor/K A 
    310                 Cursor/K B 
    311                 CheckBox useCrsrCheck,value= 0 
     309                Cursor/K/W=COR_Graph A 
     310                Cursor/K/W=COR_Graph B 
     311                CheckBox useCrsrCheck,win=COR_Graph,value= 0 
    312312        endif 
    313313        DoUpdate 
     
    335335                        break 
    336336        endswitch 
    337         CheckBox CORCheck,value= (gRadioVal==1) 
    338         CheckBox SAMCheck,value= (gRadioVal==2) 
    339         CheckBox EMPCheck,value= (gRadioVal==3) 
     337        CheckBox CORCheck,win=COR_Graph,value= (gRadioVal==1) 
     338        CheckBox SAMCheck,win=COR_Graph,value= (gRadioVal==2) 
     339        CheckBox EMPCheck,win=COR_Graph,value= (gRadioVal==3) 
    340340         
    341341        //move the cursors to the correct trace on the graph 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/Main_USANS.ipf

    r540 r544  
    2727        "Load USANS Data",A_LoadOneDData() 
    2828        "Convert to 6 Columns",Convert3ColTo6Col() 
     29        "-" 
     30        "USANS Simulator",Show_UCALC() 
    2931        "-" 
    3032        "Feedback or Bug Report",U_OpenTracTicketPage("") 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/USANS/USANS_Includes.ipf

    r473 r544  
    2020#include "CheckVersionFTP"                              //added June 2008 
    2121#include "GaussUtils_v40"                               //added Oct 2008 for unified file loading 
     22 
     23// USANS simulation test 
     24#include "U_CALC" 
Note: See TracChangeset for help on using the changeset viewer.