Ignore:
Timestamp:
Oct 7, 2008 1:09:04 PM (14 years ago)
Author:
ajj
Message:

Moving data folders into root:Packages:NIST

This could be hairy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/WorkFileUtils.ipf

    r412 r418  
    6363         
    6464        // if the desired workfile doesn't exist, let the user know, and just make a new one 
    65         destPath = "root:"+newType + ":data" 
     65        destPath = "root:Packages:NIST:"+newType + ":data" 
    6666        if(WaveExists($destpath) == 0) 
    6767                Print "There is no old work file to add to - a new one will be created" 
     
    7272         
    7373        //now make references to data in newType folder 
    74         DestPath="root:"+newType         
     74        DestPath="root:Packages:NIST:"+newType   
    7575        WAVE data=$(destPath +":data")                  // these wave references point to the EXISTING work data 
    7676        WAVE/T textread=$(destPath + ":textread") 
     
    109109         
    110110        //DetCorr() has not been applied to the data in RAW , do it now in a local reference to the raw data 
    111         WAVE raw_data = $"root:RAW:data" 
    112         WAVE raw_reals =  $"root:RAW:realsread" 
    113         WAVE/T raw_text = $"root:RAW:textread" 
    114         WAVE raw_ints = $"root:RAW:integersread" 
     111        WAVE raw_data = $"root:Packages:NIST:RAW:data" 
     112        WAVE raw_reals =  $"root:Packages:NIST:RAW:realsread" 
     113        WAVE/T raw_text = $"root:Packages:NIST:RAW:textread" 
     114        WAVE raw_ints = $"root:Packages:NIST:RAW:integersread" 
    115115         
    116116        //check for log-scaling of the raw data - make sure it's linear 
     
    243243        // replace with the contents of raw 
    244244 
    245         destPath = "root:" + newType 
     245        destPath = "root:Packages:NIST:" + newType 
    246246         
    247247        //check for log-scaling of the RAW data and adjust if necessary 
     
    250250 
    251251        //copy from current dir (RAW) to work, defined by destpath 
    252         DestPath = "root:"+newType 
    253         Duplicate/O $"root:RAW:data",$(destPath + ":data") 
    254 //      Duplicate/O $"root:RAW:vlegend",$(destPath + ":vlegend") 
    255         Duplicate/O $"root:RAW:textread",$(destPath + ":textread") 
    256         Duplicate/O $"root:RAW:integersread",$(destPath + ":integersread") 
    257         Duplicate/O $"root:RAW:realsread",$(destPath + ":realsread") 
     252        DestPath = "root:Packages:NIST:"+newType 
     253        Duplicate/O $"root:Packages:NIST:RAW:data",$(destPath + ":data") 
     254//      Duplicate/O $"root:Packages:NIST:RAW:vlegend",$(destPath + ":vlegend") 
     255        Duplicate/O $"root:Packages:NIST:RAW:textread",$(destPath + ":textread") 
     256        Duplicate/O $"root:Packages:NIST:RAW:integersread",$(destPath + ":integersread") 
     257        Duplicate/O $"root:Packages:NIST:RAW:realsread",$(destPath + ":realsread") 
    258258        Variable/G $(destPath + ":gIsLogscale")=0                       //overwite flag in newType folder, data converted (above) to linear scale 
    259259         
     
    329329        String type 
    330330         
    331         WAVE reals=$("root:RAW:realsread") 
     331        WAVE reals=$("root:Packages:NIST:RAW:realsread") 
    332332        reals[1]=1              //true monitor counts, still in raw 
    333333        Raw_to_work(type) 
    334334        //data is now in "type" folder 
    335         WAVE data=$("root:"+type+":data") 
    336         WAVE new_reals=$("root:"+type+":realsread") 
     335        WAVE data=$("root:Packages:NIST:"+type+":data") 
     336        WAVE new_reals=$("root:Packages:NIST:"+type+":realsread") 
    337337         
    338338        Variable norm_mon,tot_mon,scale 
     
    355355        String type 
    356356         
    357         WAVE reals=$("root:RAW:realsread") 
     357        WAVE reals=$("root:Packages:NIST:RAW:realsread") 
    358358        reals[1]=1              //true monitor counts, still in raw 
    359359        Add_Raw_to_work(type) 
    360360        //data is now in "type" folder 
    361         WAVE data=$("root:"+type+":data") 
    362         WAVE new_reals=$("root:"+type+":realsread") 
     361        WAVE data=$("root:Packages:NIST:"+type+":data") 
     362        WAVE new_reals=$("root:Packages:NIST:"+type+":realsread") 
    363363         
    364364        Variable norm_mon,tot_mon,scale 
     
    747747        // if the desired workfile doesn't exist, let the user know, and abort 
    748748        String destPath="" 
    749         destPath = "root:"+Type + ":data" 
     749        destPath = "root:Packages:NIST:"+Type + ":data" 
    750750        if(WaveExists($destpath) == 0) 
    751751                Print "There is no work file in "+type+"--Aborting" 
     
    754754        //check for DIV 
    755755        // if the DIV workfile doesn't exist, let the user know,and abort 
    756         destPath = "root:DIV:data" 
     756        destPath = "root:Packages:NIST:DIV:data" 
    757757        if(WaveExists($destpath) == 0) 
    758758                Print "There is no work file in DIV --Aborting" 
     
    766766        //copy type information to CAL, wiping out the old contents of the CAL folder first 
    767767         
    768         //destPath = "root:CAL" 
     768        //destPath = "root:Packages:NIST:CAL" 
    769769        //SetDataFolder destPath 
    770770        //KillWaves/A/Z                 //get rid of the old data in CAL folder 
     
    775775 
    776776        //copy from current dir (type)=destPath to CAL, overwriting CAL contents 
    777         destPath = "root:" + type 
    778         Duplicate/O $(destPath + ":data"),$"root:CAL:data" 
    779 //      Duplicate/O $(destPath + ":vlegend"),$"root:CAL:vlegend" 
    780         Duplicate/O $(destPath + ":textread"),$"root:CAL:textread" 
    781         Duplicate/O $(destPath + ":integersread"),$"root:CAL:integersread" 
    782         Duplicate/O $(destPath + ":realsread"),$"root:CAL:realsread" 
     777        destPath = "root:Packages:NIST:" + type 
     778        Duplicate/O $(destPath + ":data"),$"root:Packages:NIST:CAL:data" 
     779//      Duplicate/O $(destPath + ":vlegend"),$"root:Packages:NIST:CAL:vlegend" 
     780        Duplicate/O $(destPath + ":textread"),$"root:Packages:NIST:CAL:textread" 
     781        Duplicate/O $(destPath + ":integersread"),$"root:Packages:NIST:CAL:integersread" 
     782        Duplicate/O $(destPath + ":realsread"),$"root:Packages:NIST:CAL:realsread" 
    783783        //need to save a copy of filelist string too (from the current type folder) 
    784784        SVAR oldFileList = $(destPath + ":fileList") 
    785785 
    786786        //now switch to reference waves in CAL folder 
    787         destPath = "root:CAL" 
     787        destPath = "root:Packages:NIST:CAL" 
    788788        //make appropriate wave references 
    789789        Wave data=$(destPath + ":data")                                 // these wave references point to the data in CAL 
     
    795795        String/G $(destPath + ":fileList") = oldFileList 
    796796 
    797         Wave div_data = $"root:DIV:data"                //hard-wired in.... 
     797        Wave div_data = $"root:Packages:NIST:DIV:data"          //hard-wired in.... 
    798798        //do the division, changing data in CAL 
    799799        data /= div_data 
     
    855855        String destPath 
    856856        //check for "type" 
    857         destPath = "root:"+Type + ":data" 
     857        destPath = "root:Packages:NIST:"+Type + ":data" 
    858858        if(WaveExists($destpath) == 0) 
    859859                Print "There is no work file in "+type+"--Aborting" 
     
    861861        Endif 
    862862        //check for log-scaling of the "type" data and adjust if necessary 
    863         destPath = "root:"+Type 
     863        destPath = "root:Packages:NIST:"+Type 
    864864        NVAR gIsLogScale = $(destPath + ":gIsLogScale") 
    865865        if(gIsLogScale) 
     
    872872        //copy over the waves data,vlegend,text,integers,reals(read) 
    873873 
    874         String oldType= "root:"+type            //this is where the data to be absoluted is  
     874        String oldType= "root:Packages:NIST:"+type              //this is where the data to be absoluted is  
    875875        //copy from current dir (type) to ABS, defined by destPath 
    876         Duplicate/O $(oldType + ":data"),$"root:ABS:data" 
    877 //      Duplicate/O $(oldType + ":vlegend"),$"root:ABS:vlegend" 
    878         Duplicate/O $(oldType + ":textread"),$"root:ABS:textread" 
    879         Duplicate/O $(oldType + ":integersread"),$"root:ABS:integersread" 
    880         Duplicate/O $(oldType + ":realsread"),$"root:ABS:realsread" 
     876        Duplicate/O $(oldType + ":data"),$"root:Packages:NIST:ABS:data" 
     877//      Duplicate/O $(oldType + ":vlegend"),$"root:Packages:NIST:ABS:vlegend" 
     878        Duplicate/O $(oldType + ":textread"),$"root:Packages:NIST:ABS:textread" 
     879        Duplicate/O $(oldType + ":integersread"),$"root:Packages:NIST:ABS:integersread" 
     880        Duplicate/O $(oldType + ":realsread"),$"root:Packages:NIST:ABS:realsread" 
    881881        //need to save a copy of filelist string too (from the current type folder) 
    882882        SVAR oldFileList = $(oldType + ":fileList") 
    883883        //need to copy filelist string too 
    884         String/G $"root:ABS:fileList" = oldFileList 
     884        String/G $"root:Packages:NIST:ABS:fileList" = oldFileList 
    885885         
    886886        //now switch to ABS folder 
    887887        //make appropriate wave references 
    888         WAVE data=$"root:ABS:data"                                      // these wave references point to the "type" data in ABS 
    889         WAVE/T textread=$"root:ABS:textread"                    //that are to be directly operated on 
    890         WAVE integersread=$"root:ABS:integersread" 
    891         WAVE realsread=$"root:ABS:realsread" 
    892         Variable/G $"root:ABS:gIsLogscale"=0                    //make new flag in ABS folder, data is linear scale 
     888        WAVE data=$"root:Packages:NIST:ABS:data"                                        // these wave references point to the "type" data in ABS 
     889        WAVE/T textread=$"root:Packages:NIST:ABS:textread"                      //that are to be directly operated on 
     890        WAVE integersread=$"root:Packages:NIST:ABS:integersread" 
     891        WAVE realsread=$"root:Packages:NIST:ABS:realsread" 
     892        Variable/G $"root:Packages:NIST:ABS:gIsLogscale"=0                      //make new flag in ABS folder, data is linear scale 
    893893         
    894894        //do the actual absolute scaling here, modifying the data in ABS 
     
    937937        // if the desired workfile doesn't exist, let the user know, and abort 
    938938        String destPath="" 
    939         destPath = "root:"+oldType + ":data" 
     939        destPath = "root:Packages:NIST:"+oldType + ":data" 
    940940        if(WaveExists($destpath) == 0) 
    941941                Print "There is no work file in "+oldtype+"--Aborting" 
     
    949949 
    950950        //copy from current dir (type)=destPath to newtype, overwriting newtype contents 
    951         destPath = "root:" + oldtype 
    952         Duplicate/O $(destPath + ":data"),$("root:"+newtype+":data") 
    953         Duplicate/O $(destPath + ":textread"),$("root:"+newtype+":textread") 
    954         Duplicate/O $(destPath + ":integersread"),$("root:"+newtype+":integersread") 
    955         Duplicate/O $(destPath + ":realsread"),$("root:"+newtype+":realsread") 
     951        destPath = "root:Packages:NIST:" + oldtype 
     952        Duplicate/O $(destPath + ":data"),$("root:Packages:NIST:"+newtype+":data") 
     953        Duplicate/O $(destPath + ":textread"),$("root:Packages:NIST:"+newtype+":textread") 
     954        Duplicate/O $(destPath + ":integersread"),$("root:Packages:NIST:"+newtype+":integersread") 
     955        Duplicate/O $(destPath + ":realsread"),$("root:Packages:NIST:"+newtype+":realsread") 
    956956        //need to save a copy of filelist string too (from the current type folder) 
    957957        SVAR oldFileList = $(destPath + ":fileList") 
    958958 
    959959        //now switch to reference waves in newtype folder 
    960         destPath = "root:"+newtype 
     960        destPath = "root:Packages:NIST:"+newtype 
    961961        Variable/G $(destPath + ":gIsLogScale")=0                       //make new flag in newtype folder, data is linear scale 
    962962        //need to copy filelist string too 
     
    10451045        NVAR pixelsY = root:myGlobals:gNPixelsY 
    10461046         
    1047         WAVE/Z data1=$("root:"+workMathStr+"File_1:data") 
     1047        WAVE/Z data1=$("root:Packages:NIST:"+workMathStr+"File_1:data") 
    10481048        If(cmpstr(str2,"UNIT MATRIX")==0) 
    10491049                Make/O/N=(pixelsX,pixelsY) root:myGlobals:WorkMath:data         //don't put in File_2 folder 
     
    10531053                //Load set #2 
    10541054                Load_NamedASC_File(pathStr+str2,workMathStr+"File_2") 
    1055                 WAVE/Z data2=$("root:"+workMathStr+"File_2:data") 
     1055                WAVE/Z data2=$("root:Packages:NIST:"+workMathStr+"File_2:data") 
    10561056        Endif 
    10571057 
     
    10651065        //copy contents of str1 folder to dest and create the wave ref (it will exist) 
    10661066        CopyWorkContents(workMathStr+"File_1",workMathStr+dest) 
    1067         WAVE/Z destData=$("root:"+workMathStr+dest+":data") 
     1067        WAVE/Z destData=$("root:Packages:NIST:"+workMathStr+dest+":data") 
    10681068         
    10691069        //dispatch 
     
    12291229        String type 
    12301230         
    1231         SetDataFolder $("root:"+type) 
     1231        SetDataFolder $("root:Packages:NIST:"+type) 
    12321232        KillWaves/a/z 
    12331233        KillStrings/a/z 
Note: See TracChangeset for help on using the changeset viewer.