Ignore:
Timestamp:
May 4, 2017 3:17:32 PM (6 years ago)
Author:
srkline
Message:

added utilities to allow saving of I(q) data sets either individual or concatenated. At this point, it simply trims a nominal number of points from the beginning and end of each set before concatenation (and then sorting).

These operations will need to be augmented in the future.

File:
1 edited

Legend:

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

    r1035 r1036  
    44 
    55//************************ 
    6 //      Vers. 1.2 092101 
    7 // 
    8 //7/2001 converted protocols to simply use the filenames, rather than the path:filename 
    9 //this should allow portability of the protocols between machines 
    10 //**ALL** protocols now depend on the path "catPathName" 
    11 // 
    12 //procedure files for construction of protocols interactively, 
    13 //selecting files from the CAT/VSHORT table, rather than picking blindly 
    14 //from a dialog - the process of selecting/setting files is not as  
    15 //transparent as it could be for new users 
     6 
    167// 
    178//************************* 
     
    4435//              QDELTA=value            total width of annulus centered at QCENTER 
    4536//              PLOT=string             string from set {Yes,No} = truth of generating plot of averaged data 
    46 //              SAVE=string             string from set {Yes,No} = truth of saving averaged data to disk 
     37//              SAVE=string             string from set {Yes,No} = truth of saving averaged data to disk, now with "Concatenate"  or "Individual" 
    4738//              NAME=string             string from set {Auto,Manual} = Automatic name generation or Manual(dialog) 
    4839// 
    49 //    BINTYPE=string (VSANS binning type) "One;Two;Four;Slit Mode;", defined by ksBinTypeStr 
     40// 
     41//    BINTYPE=string (VSANS binning type) "One;Two;Four;Slit Mode;", as defined by ksBinTypeStr 
     42// 
    5043// 
    5144//              For work.DRK usage: 
    52 //              **the list is COMMA delimited, soparator is = 
     45//              **the list is COMMA delimited, separator is = 
    5346//              DRK=none,DRKMODE=0, 
    5447//              DRK=name                        is the name of the file, must be a full name, expected to be raw data 
     
    8982        String/G root:Packages:NIST:VSANS:Globals:Protocols:gMASK="ask" 
    9083        String/G root:Packages:NIST:VSANS:Globals:Protocols:gAbsStr="ask" 
    91         String/G root:Packages:NIST:VSANS:Globals:Protocols:gAVE="AVTYPE=Circular;SAVE=Yes;NAME=Auto;PLOT=Yes;" 
     84        String/G root:Packages:NIST:VSANS:Globals:Protocols:gAVE="AVTYPE=Circular;SAVE=Yes - Concatenate;NAME=Auto;PLOT=Yes;" 
    9285        String/G root:Packages:NIST:VSANS:Globals:Protocols:gDRK="DRK=none,DRKMODE=0," 
    9386         
     
    528521//              newList = list 
    529522//      endif 
     523 
     524 
     525Function/S V_GetSAMList() 
     526 
     527        String match="SAMPLE" 
     528        String list = V_getFileIntentList(match,0) 
     529 
     530//      Printf "SAM files = %s\r",list   
     531        return(list) 
     532end 
    530533 
    531534 
     
    739742 
    740743 
     744// 
     745Function/S V_PickEMPBeamButton(ctrlName) : ButtonControl 
     746        String ctrlName 
     747        String list="",item="",fname,newList,intent 
     748        Variable ii,num 
     749         
     750        PathInfo catPathName 
     751        String path = S_path 
     752 
     753        String match="EMPTY BEAM" 
     754 
     755// get the list from the file catalog (=0.0007s) 
     756//       
     757        WAVE/T fileNameW = root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames 
     758        WAVE/T intentW = root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent 
     759         
     760        Variable np = numpnts(intentW) 
     761        for(ii=0;ii<np;ii+=1) 
     762                if(cmpstr(intentW[ii],match)==0) 
     763                        list += fileNameW[ii] + ";" 
     764                endif            
     765        endfor 
     766         
     767        List = SortList(List,";",0) 
     768        Printf "EMP Beam files = %s\r",list      
     769 
     770 
     771 
     772         
     773        return(list) 
     774End 
     775 
    741776Function/S V_GetDIVList() 
    742777 
     
    10021037        Button button_quest,pos={20,2},size={150,20},proc=V_ProtocolQuestionnaire,title="Questions" 
    10031038        Button button_quest,help={"Run through the questionnaire for setting up a reduction protocol"} 
    1004          
     1039 
     1040        PopupMenu popup_sam,pos={85,28},size={51,23},proc=SAMFilePopMenuProc 
     1041        PopupMenu popup_sam,mode=1,value= #"V_getSAMList()"      
    10051042        PopupMenu popup_bkg,pos={85,76},size={51,23},proc=BKGFilePopMenuProc 
    10061043        PopupMenu popup_bkg,mode=1,value= #"V_getBGDList()" 
     
    11061143 
    11071144EndMacro 
     1145 
     1146Function SAMFilePopMenuProc(pa) : PopupMenuControl 
     1147        STRUCT WMPopupAction &pa 
     1148 
     1149        switch( pa.eventCode ) 
     1150                case 2: // mouse up 
     1151                        Variable popNum = pa.popNum 
     1152                        String popStr = pa.popStr 
     1153                        SVAR tempStr = root:Packages:NIST:VSANS:Globals:Protocols:gSAM 
     1154                        tempStr = popStr 
     1155                        break 
     1156                case -1: // control being killed 
     1157                        break 
     1158        endswitch 
     1159 
     1160        return 0 
     1161End 
     1162 
    11081163 
    11091164Function BKGFilePopMenuProc(pa) : PopupMenuControl 
     
    12351290// TODO 
    12361291// -- this is a trimmed down version of the "full" set of averaging options 
    1237 //    add to this as needed to add in functionality 
     1292//    add to this as needed as I figure out what functionality is appropriate 
    12381293// 
    12391294//procedure called by protocol panel to ask user for average type choices 
     
    12501305// comment out above line in DEMO_MODIFIED version, and uncomment the line below (to disable PNG save) 
    12511306//      Prompt av_typ, "Type of Average",popup,"Circular;Sector;Rectangular;Annular;2D_ASCII;QxQy_ASCII" 
    1252         Prompt autoSave,"Save files to disk?",popup,"Yes;No" 
     1307        Prompt autoSave,"Save files to disk?",popup,"Yes - Concatenate;Yes - Individual;No" 
    12531308        Prompt autoName,"Auto-Name files?",popup,"Auto;Manual" 
    12541309//      Prompt autoPlot,"Plot the averaged Data?",popup,"Yes;No" 
     
    18501905// x- this is no longer done after the COR step, and CAL is not produced as output of DIV        
    18511906// x- needs to be aware of the file name passed in 
    1852 // -- PromptForPath does not exist in VSANS. Need a better (automated) way to find the file. 
     1907// x- PromptForPath does not exist in VSANS. Need a better (automated) way to find the file. 
    18531908 
    18541909//check for work.div file (prot[2]) 
    18551910//load in if needed 
    1856 // no math is done here, DIV is applied as files are converted to WORK 
    1857 // no need to display DIV, or update any data display 
    1858 // 
    1859 //              DoAlert 0,"DIV step incomplete" 
     1911// no math is done here, DIV is applied as files are converted to WORK (the first operation in VSANS) 
     1912// 
     1913        String divFileName = "" 
    18601914 
    18611915        If(cmpstr("none",prot[2])!=0)           // if !0, then there's a file requested 
     
    18631917                        //ask user for file 
    18641918//                       junkStr = PromptForPath("Select the detector sensitivity file") 
    1865                         junkStr="" 
    1866                         If(strlen(junkStr)==0) 
     1919                        Prompt divFileName,"DIV File",popup,V_PickDIVButton("") 
     1920                        DoPrompt "Select File",divFileName 
     1921 
     1922                        If(strlen(divFileName)==0) 
    18671923                                SetDataFolder root: 
    18681924                                Abort "No file selected, data reduction aborted" 
    18691925                        Endif 
    1870                         V_LoadHDF5Data(junkStr,"DIV") 
     1926                        V_LoadHDF5Data(divFileName,"DIV") 
    18711927                else 
    18721928                        //assume it's a path, and that the first (and only) item is the path:file 
     
    18791935 
    18801936 
    1881  
    1882  
    18831937// TODO: 
    1884 // -- currently does not allow adding RAW data files together 
     1938// -- currently does not allow adding RAW data files together, so no parsing is done 
    18851939//       
    1886  
     1940// 
    18871941        //prompt for sam data => read raw data, add to sam folder 
    18881942        //or parse file(s) from the input paramter string 
     
    19361990        While(0) 
    19371991        // TODO 
    1938         // -- this may not be the most reliable way to pas the file name 
     1992        // -- this may not be the most reliable way to pass the file name (for naming of the saved file later) 
    19391993        SVAR file_name = root:file_Name 
    1940         String sameFileLoaded = file_name               //keep a copy of the sample file loaded 
     1994        String samFileLoaded = file_name                //keep a copy of the sample file loaded 
    19411995         
    19421996        //always update 
     
    21282182// TODO: 
    21292183// -- calculation works, needs proper inputs (solid angle aware) 
    2130 // --   Open beam method is only a stub - fill in calculation in V_AskForAbsoluteParams_Quest() 
     2184// --   Open beam method needs to be verified in V_AskForAbsoluteParams_Quest() 
    21312185        Variable c2,c3,c4,c5,kappa_err 
    21322186        //do absolute scaling if desired 
    2133                 DoAlert 0,"Abs step incomplete" 
     2187//              DoAlert 0,"Abs step incomplete" 
    21342188 
    21352189        if(cmpstr("none",prot[4])!=0) 
     
    21662220 
    21672221// 
    2168 // TODO -- incomplete 
    2169 //              -- fill in the "ask" step 
     2222// TODO 
     2223//              x- fill in the "ask" step 
    21702224//  -- none is OK, except if the kill fails for any reason 
    2171 // -- the regular case of the file name specified by the protocol works correctly 
    2172 // -- don't create a null mask if not used, it will handle the error and print out that the mask is missing 
    2173  
    2174 //mask data if desired (this is done automatically in the average step) and is 
     2225// x- the regular case of the file name specified by the protocol works correctly 
     2226// x- don't create a null mask if not used, it will handle the error and print out that the mask is missing 
     2227 
     2228//mask data if desired (this is done automatically when the data is binned to I(q)) and is 
    21752229//not done explicitly here 
    21762230         
    21772231        //check for mask 
    2178         //add mask if needed 
    2179         // can't properly check the filename - so for now always add 
    21802232        //doesn't change the activeType 
     2233        String mskFileName="" 
     2234         
    21812235        if(cmpstr("none",prot[3])!=0) 
    21822236                If(cmpstr("ask",prot[3])==0) 
    21832237                        //get file from user 
    2184                         // TODO -- fill in the get file prompt, and handle the result 
    2185 //                      junkStr = PromptForPath("Select Mask file") 
    2186                         DoAlert 0,"Mask step incomplete" 
    2187  
    2188                         If(strlen(junkStr)==0) 
     2238                        // TODO 
     2239                        // x- fill in the get file prompt, and handle the result 
     2240                        Prompt mskFileName,"MASK File",popup,V_PickMASKButton("") 
     2241                        DoPrompt "Select File",mskFileName 
     2242//                      if (V_Flag) 
     2243//                              return 0                                                                        // user cancelled 
     2244//                      endif 
     2245 
     2246                        If(strlen(mskFileName)==0)              //use cancelled 
    21892247                                //if none desired, make sure that the old mask is deleted 
    2190                                 //junkStr = GetDataFolder(1) 
    2191                                 //SetDataFolder root:Packages:NIST:MSK 
    21922248                                KillDataFolder/Z root:Packages:NIST:VSANS:MSK: 
    21932249                                NewDataFolder/O root:Packages:NIST:VSANS:MSK 
    2194                                 //SetDataFolder junkStr 
     2250                                 
    21952251                                DoAlert 0,"No Mask file selected, data not masked" 
    21962252                        else 
    2197                                 //read in the file from the dialog 
    2198                                 V_LoadHDF5Data(junkStr,"MSK") 
     2253                                //read in the file from the selection 
     2254                                V_LoadHDF5Data(mskFileName,"MSK") 
    21992255                        Endif 
    22002256                else 
    22012257                        //just read it in from the protocol 
    22022258                        //list processing is necessary to remove any final comma 
    2203                         junkStr = pathStr + StringFromList(0, prot[3],"," ) 
    2204                         V_LoadHDF5Data(junkStr,"MSK") 
     2259                        mskFileName = pathStr + StringFromList(0, prot[3],"," ) 
     2260                        V_LoadHDF5Data(mskFileName,"MSK") 
    22052261                Endif 
     2262                 
    22062263        else 
    22072264                //if none desired, make sure that the old mask is deleted 
     
    22172274         
    22182275 
    2219  
    2220  
    2221  
    22222276        // average/save data as specified 
    2223          
    22242277        //Parse the keyword=<Value> string as needed, based on AVTYPE 
    22252278         
     
    22282281        If(cmpstr(av_type,"none") != 0) 
    22292282                If (cmpstr(av_type,"")==0)              //if the key could not be found... (if "ask" the string) 
    2230                         //get the averaging parameters from the user, as if the set button was hit 
    2231                         //in the panel 
     2283                        //get the averaging parameters from the user, as if the set button was hit in the panel 
    22322284                        V_SetAverageParamsButtonProc("dummy")           //from "ProtocolAsPanel" 
    22332285                        SVAR tempAveStr = root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr 
     
    22442296 
    22452297        // bin and plot the data 
     2298         
    22462299        // TODO 
    2247         // x- currently this bins and plots based on the V_1D_Data panel, NOT the selections above 
    2248         // now takes the the binType from the protocol, and uses two steps to bin and average 
     2300// -- this switch does nothing -- fill it in 
     2301//       x- need to convert BINTYPE keyword into a numerical value to pass 
     2302// 
     2303 
    22492304        String binTypeStr = StringByKey("BINTYPE",prot[5],"=",";") 
    22502305        // plotting is not really necessary, and the graph may not be open - so skip for now? 
     
    22562311 
    22572312 
    2258  
    2259 // TODO 
    2260 // -- this switch does nothing -- fill it in 
    2261 //       -- need to convert BINTYPE keyword into a numerical value to pass 
    2262 //    ?? define a global string and use WhichListItem() to get a number back? 
    2263 // 
    2264          
    22652313        strswitch(av_type)      //dispatch to the proper routine to average to 1D data 
    22662314                case "none":             
     
    22962344        endswitch 
    22972345 
    2298 // TODO -- this call will bin the active type, then the next call bins the active type 
    2299 // -- then later, I dispatch to bin the active type...   
    2300 // -- !!!need to split out the panel draw and the binning calls from V_PlotData_Panel 
     2346// TODO 
     2347// x- this call will bin the active type, then the next call bins the active type 
     2348// x- then later, I dispatch to bin the active type...   
     2349// x- !!!need to split out the panel draw and the binning calls from V_PlotData_Panel 
    23012350// 
    23022351        V_PlotData_Panel()              //this brings the plot window to the front, or draws it (ONLY) 
     
    23082357// TODO 
    23092358// x- how do I get the sample file name? 
    2310 //     sameFileLoaded is the file name loaded (contains the extension) 
     2359//    local variable samFileLoaded is the file name loaded (contains the extension) 
    23112360//       
    23122361        //save data if desired 
    23132362        String fullpath = "", newfileName="" 
    2314         String item = StringByKey("SAVE",prot[5],"=",";")               //does user want to save data? 
    2315         If( (cmpstr(item,"Yes")==0) && (cmpstr(av_type,"none") != 0) )           
     2363        String saveType = StringByKey("SAVE",prot[5],"=",";")           //does user want to save data? 
     2364        If( (cmpstr(saveType[0,2],"Yes")==0) && (cmpstr(av_type,"none") != 0) )          
    23162365                //then save 
    2317                 newFileName = RemoveEnding(sameFileLoaded,".nxs.ngv") 
     2366                newFileName = RemoveEnding(samFileLoaded,".nxs.ngv") 
    23182367                 
    23192368                //pick ABS or AVE extension 
     
    23422391                // 
    23432392                Variable dialog = 0 
     2393 
     2394// TODO 
     2395// -- need to define nBeg and nEnd somewhere 
     2396// -- currently hard-wired 
     2397// --do I need to define these "per-panel"?              
     2398                Variable nBeg = 3, nEnd = 10 
     2399                 
    23442400                PathInfo/S catPathName 
    2345                 item = StringByKey("NAME",prot[5],"=",";")              //Auto or Manual naming 
     2401                String item = StringByKey("NAME",prot[5],"=",";")               //Auto or Manual naming 
    23462402                String autoname = StringByKey("AUTONAME",prot[5],"=",";")               //autoname -  will get empty string if not present 
    23472403                If((cmpstr(item,"Manual")==0) || (cmpstr(newFileName,"") == 0)) 
     
    23812437// TODO: 
    23822438// -- fill in all of the cases, default is only the "standard" I(q) 
    2383                                 V_ConcatenateForSave(activeType,binType) 
    2384                                 V_Write1DData(activeType,newFileName+"."+exten)         //don't pass the full path, just the name 
     2439 
     2440                                if(cmpstr(saveType,"Yes - Concatenate")==0) 
     2441                                        V_Trim1DData(activeType,binType,nBeg,nEnd) 
     2442                                        V_ConcatenateForSave(activeType,binType)                // this removes q=0 point, concatenates, sorts 
     2443                                        V_Write1DData(activeType,newFileName+"."+exten)         //don't pass the full path, just the name 
     2444                                else 
     2445                                        // remove the q=0 point from the back detector, if it's there 
     2446                                        // does not need to know binType 
     2447                                        // does not trim any of the data 
     2448                                        V_RemoveQ0_B(activeType) 
     2449                                        V_Write1DData_NoConcat(activeType,newFileName,binType) 
     2450                                endif 
    23852451 
    23862452                endswitch 
     
    23922458        Return(0) 
    23932459End 
     2460 
     2461 
     2462 
    23942463 
    23952464 
     
    24202489// TODO 
    24212490// -- fill in all of the functionality for calculation from direct beam 
     2491//  and verify that the calculations are numerically correct 
    24222492// 
    24232493//asks the user for absolute scaling information. the user can either 
    2424 //enter the 5 necessary values in manually (missing parameter dialog) 
     2494//enter the necessary values in manually (missing parameter dialog) 
    24252495//or the user can select an empty beam file from a standard open dialog 
    24262496//if an empty beam file is selected, the "kappa" value is automatically calculated 
     
    24402510                //empty beam flux file selected, prompt for file, and use this to calculate KAPPA 
    24412511                Variable kappa=1 
     2512                Variable kappa_err 
    24422513                         
    24432514                //get the necessary variables for the calculation of kappa 
    2444                 Variable detCnt,countTime,attenTrans,monCnt,sdd,pixel 
    2445                 String detStr 
    2446  
    2447                                  
    2448                 //lookup table for transmission factor 
    2449                 //determine which instrument the measurement was done on from acctStr 
    2450                 Variable lambda, attenNo,atten_err 
    2451                  
    2452                 //get the XY box, if needed 
    2453                 Variable x1,x2,y1,y2,ct_err 
    2454                 String filename,tempStr                 //02JUL13 
    2455  
    2456 //              err = GetXYBoxFromFile(tempName,x1,x2,y1,y2)            //xy's are passed/returned by reference 
    2457 //              Printf "Using Box X(%d,%d),Y(%d,%d)\r",x1,x2,y1,y2 
    2458  
    2459                  
     2515                Variable countTime,monCnt,sdd,pixel 
     2516                String detStr,junkStr,errStr 
     2517 
     2518                Variable empAttenFactor,        emp_atten_err 
     2519                 
     2520                //get the XY box and files 
     2521                Variable x1,x2,y1,y2,emptyCts,empty_ct_err 
     2522                String emptyFileName,tempStr,divFileName 
     2523                 
     2524                // TODO 
     2525                // x- need an empty beam file name 
     2526                // 
     2527                Prompt emptyFileName,"Empty Beam File",popup,V_PickEMPBeamButton("") 
     2528                DoPrompt "Select File",emptyFileName 
     2529                if (V_Flag) 
     2530                        return 0                                                                        // user canceled 
     2531                endif 
     2532 
    24602533                //need the detector sensitivity file - make a guess, allow to override 
    2461  
    2462  
    2463                 //toggle SANS_Data to linear display if needed, so that we're working with linear scaled data 
    2464 //              Wave divData = $"root:Packages:NIST:div:Data" 
    2465 //              Wave data = $"root:Packages:NIST:raw:data"              //this will be the linear data 
    2466                 // correct by detector sensitivity 
    2467 //              data /= divData 
    2468                  
    2469                 // now do the sum, only in the box       
    2470 //              detCnt = SumCountsInBox(x1,x2,y1,y2,ct_err,"RAW") 
    2471  
    2472                 //               
     2534                Prompt divFileName,"DIV File",popup,V_PickDIVButton("") 
     2535                DoPrompt "Select File",divFileName 
     2536                if (V_Flag) 
     2537                        return 0                                                                        // user canceled 
     2538                endif 
     2539                V_LoadHDF5Data(divFileName,"DIV") 
     2540 
     2541 
     2542                WAVE xyBoxW = V_getBoxCoordinates(emptyFileName) 
     2543                // TODO 
     2544                // -- need to get the panel string for the sum. 
     2545                // -- the detector string is currently hard-wired 
     2546                detStr = "B" 
     2547 
     2548                 
     2549                // load in the data, and use all of the corrections, especially DIV 
     2550                // (be sure the corrections are actually set to "on", don't assume that they are) 
     2551                // save preferences for file loading 
     2552                Variable savDivPref,savSAPref 
     2553                NVAR gDoDIVCor = root:Packages:NIST:VSANS:Globals:gDoDIVCor 
     2554                savDivPref = gDoDIVCor 
     2555                NVAR gDoSolidAngleCor = root:Packages:NIST:VSANS:Globals:gDoSolidAngleCor 
     2556                savSAPref = gDoSolidAngleCor 
     2557                 
     2558                // set local preferences 
     2559                gDoDIVCor = 1 
     2560                gDoSolidAngleCor = 1 
     2561                 
     2562                V_LoadAndPlotRAW_wName(emptyFileName) 
     2563                // convert raw->SAM 
     2564                V_Raw_to_work("SAM") 
     2565                V_UpdateDisplayInformation("SAM")        
     2566                 
     2567                // and determine box sum and error 
     2568                // store these locally 
     2569                emptyCts = V_SumCountsInBox(xyBoxW[0],xyBoxW[1],xyBoxW[2],xyBoxW[3],empty_ct_err,"SAM",detStr) 
     2570 
     2571                Print "empty counts = ",emptyCts 
     2572                Print "empty err/counts = ",empty_ct_err/emptyCts 
     2573 
     2574                //              TODO 
     2575                // -- get all of the proper values for the calculation 
     2576                // -- verify the calculation (no solid angle needed) 
     2577                 
     2578                // get the attenuation factor for the empty beam 
     2579                empAttenFactor = V_getAttenuator_transmission(emptyFileName) 
     2580                emp_atten_err = V_getAttenuator_trans_err(emptyFileName) 
     2581                 
     2582                countTime = V_getCount_time(emptyFileName) 
     2583                 
     2584                // TODO 
     2585                // -- not sure if this is the correct monitor count to use, but I do know to use "SAM" 
     2586                //   rather than the file. 
     2587                monCnt = V_getBeamMonNormData("SAM") 
     2588                 
     2589                 
     2590                 
    24732591//              kappa = detCnt/countTime/attenTrans*1.0e8/(monCnt/countTime)*(pixel/sdd)^2 
    2474                  
    2475                 Variable kappa_err 
    2476 //              kappa_err = (ct_err/detCnt)^2 + (atten_err/attenTrans)^2 
    2477 //              kappa_err = sqrt(kappa_err) * kappa 
    2478                  
    2479                 // set the parameters in the global string 
    2480 //              Execute "V_AskForAbsoluteParams(1,1,"+junkStr+",1,"+errStr+")"          //no missing parameters, no dialog 
    2481                  
    2482                 //should wipe out the data in the RAW folder, since it's not really RAW now 
    2483 //              DoWindow/K SANS_Data 
    2484  
    2485                 // SRK JUL 2006 don't clear the contents - just kill the window to force new data to be loaded 
    2486                 // - obsucre bug if "ask" in ABS section of protocol clears RAW folder, then Q-axes can't be set from RAW:RealsRead 
    2487  
    2488                 Printf "Kappa was un-successfully calculated as = %g +/- %g (%g %)\r",kappa,kappa_err,(kappa_err/kappa)*100 
     2592                kappa = emptyCts/countTime/empAttenFactor*1.0e8/(monCnt/countTime) 
     2593                 
     2594                kappa_err = (empty_ct_err/emptyCts)^2 + (emp_atten_err/empAttenFactor)^2 
     2595                kappa_err = sqrt(kappa_err) * kappa 
     2596                 
     2597                // TODO 
     2598                // -- set the parameters in the global string 
     2599                junkStr = num2str(kappa) 
     2600                errStr = num2Str(kappa_err) 
     2601                Execute "V_AskForAbsoluteParams(1,1,"+junkStr+",1,"+errStr+")"          //no missing parameters, no dialog 
     2602                 
     2603 
     2604                Printf "Kappa was (maybe) successfully calculated as = %g +/- %g (%g %)\r",kappa,kappa_err,(kappa_err/kappa)*100 
     2605         
     2606                // restore preferences on exit 
     2607                gDoDIVCor = savDivPref 
     2608                gDoSolidAngleCor = savSAPref 
     2609 
    24892610        Endif 
    24902611         
Note: See TracChangeset for help on using the changeset viewer.