Ignore:
Timestamp:
Nov 4, 2016 2:26:28 PM (6 years ago)
Author:
srkline
Message:

changes to the calls to GBLoadWave to now use a path and only the file name. Previously I use the full path:name to construct the execute statement.

this is being done to try to act as a workaround for network neighborhood paths in windows 10 (where drives can't be mapped)

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
Files:
5 edited

Legend:

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

    r665 r1016  
    6262        Killwaves/Z data,data0          //kill the old data, if it exists 
    6363         
    64 //      String cmd = "GBLoadWave/N=data/T={72,72}/O/S=4/W=1/U=16384 /Q  \"" + fname +"\"" 
    65         String cmd = "GBLoadWave/N=data/T={72,72}/O/S=4/W=1/U=" 
    66         cmd += num2istr(pixelsX*pixelsY) + " /Q  \"" + fname +"\"" 
    67                  
     64//      String cmd = "GBLoadWave/N=data/T={72,72}/O/S=4/W=1/U=" 
     65//      cmd += num2istr(pixelsX*pixelsY) + " /Q  \"" + fname +"\"" 
     66 
     67        String cmd = "GBLoadWave/N=data/T={72,72}/O/S=4/W=1/P=catPathName/U=" 
     68        cmd += num2istr(pixelsX*pixelsY) + " /Q  \"" + ParseFilePath(0, fname, ":", 1, 0) +"\"" 
     69                         
    6870        Execute cmd  
    6971        SetDataFolder root:Packages:NIST:MSK                                            //make sure correct data folder is set 
     
    396398        SetDataFolder root:myGlobals:DrawMask 
    397399        Killwaves/Z data,data0,tempMask         //kill the old data, if it exists 
    398 //      String cmd = "GBLoadWave/N=data/T={72,72}/O/S=4/W=1/U=16384 /Q  \"" + fname +"\"" 
    399         String cmd = "GBLoadWave/N=data/T={72,72}/O/S=4/W=1/U=" 
    400         cmd += num2istr(pixelsX*pixelsY) + " /Q  \"" + fname +"\"" 
    401          
     400 
     401//      String cmd = "GBLoadWave/N=data/T={72,72}/O/S=4/W=1/U=" 
     402//      cmd += num2istr(pixelsX*pixelsY) + " /Q  \"" + fname +"\"" 
     403 
     404        String cmd = "GBLoadWave/N=data/T={72,72}/O/S=4/W=1/P=catPathName/U=" 
     405        cmd += num2istr(pixelsX*pixelsY) + " /Q  \"" + ParseFilePath(0, fname, ":", 1, 0) +"\"" 
     406                 
    402407        Execute cmd  
    403408        SetDataFolder root:myGlobals:DrawMask                                   //make sure correct data folder is set 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_DataReadWrite.ipf

    r947 r1016  
    244244        //FBinRead Cannot handle 32 bit VAX floating point 
    245245        //GBLoadWave, however, can properly read it 
    246         String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q" 
     246        String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q/P=catPathName" 
    247247        String strToExecute 
    248248        //append "/S=offset/U=numofreals" to control the read 
     
    255255         
    256256        // 4 R*4 values 
    257         strToExecute = GBLoadStr + "/S=39/U=4" + "\"" + fname + "\"" 
     257        strToExecute = GBLoadStr + "/S=39/U=4" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    258258        Execute strToExecute 
    259259        Wave w=$"root:Packages:NIST:RAW:tempGBWave0" 
     
    264264        // 4 R*4 values 
    265265        SetDataFolder curPath 
    266         strToExecute = GBLoadStr + "/S=158/U=4" + "\"" + fname + "\"" 
     266        strToExecute = GBLoadStr + "/S=158/U=4" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    267267        Execute strToExecute 
    268268        b=4      
     
    273273        // 2 R*4 values 
    274274        SetDataFolder curPath 
    275         strToExecute = GBLoadStr + "/S=186/U=2" + "\"" + fname + "\"" 
     275        strToExecute = GBLoadStr + "/S=186/U=2" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    276276        Execute strToExecute 
    277277        b=2      
     
    281281        // 6 R*4 values 
    282282        SetDataFolder curPath 
    283         strToExecute = GBLoadStr + "/S=220/U=6" + "\"" + fname + "\"" 
     283        strToExecute = GBLoadStr + "/S=220/U=6" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    284284        Execute strToExecute 
    285285        b=6      
     
    289289        // 13 R*4 values 
    290290        SetDataFolder curPath 
    291         strToExecute = GBLoadStr + "/S=252/U=13" + "\"" + fname + "\"" 
     291        strToExecute = GBLoadStr + "/S=252/U=13" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    292292        Execute strToExecute 
    293293        b=13 
     
    297297        // 3 R*4 values 
    298298        SetDataFolder curPath 
    299         strToExecute = GBLoadStr + "/S=320/U=3" + "\"" + fname + "\"" 
     299        strToExecute = GBLoadStr + "/S=320/U=3" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    300300        Execute strToExecute 
    301301        b=3      
     
    305305        // 7 R*4 values 
    306306        SetDataFolder curPath 
    307         strToExecute = GBLoadStr + "/S=348/U=7" + "\"" + fname + "\"" 
     307        strToExecute = GBLoadStr + "/S=348/U=7" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    308308        Execute strToExecute 
    309309        b=7 
     
    313313        // 4 R*4 values 
    314314        SetDataFolder curPath 
    315         strToExecute = GBLoadStr + "/S=388/U=4" + "\"" + fname + "\"" 
     315        strToExecute = GBLoadStr + "/S=388/U=4" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    316316        Execute strToExecute 
    317317        b=4      
     
    321321        // 2 R*4 values 
    322322        SetDataFolder curPath 
    323         strToExecute = GBLoadStr + "/S=450/U=2" + "\"" + fname + "\"" 
     323        strToExecute = GBLoadStr + "/S=450/U=2" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    324324        Execute strToExecute 
    325325        b=2 
     
    329329        // 2 R*4 values 
    330330        SetDataFolder curPath 
    331         strToExecute = GBLoadStr + "/S=470/U=2" + "\"" + fname + "\"" 
     331        strToExecute = GBLoadStr + "/S=470/U=2" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    332332        Execute strToExecute 
    333333        b=2 
     
    337337        // 5 R*4 values 
    338338        SetDataFolder curPath 
    339         strToExecute = GBLoadStr + "/S=494/U=5" + "\"" + fname + "\"" 
     339        strToExecute = GBLoadStr + "/S=494/U=5" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    340340        Execute strToExecute 
    341341        b=5      
     
    358358        SetDataFolder curPath 
    359359        //read in the data 
    360         strToExecute = "GBLoadWave/O/N=tempGBwave/B/T={16,2}/S=514/Q" + "\"" + fname + "\"" 
     360        strToExecute = "GBLoadWave/O/N=tempGBwave/B/T={16,2}/S=514/Q/P=catPathName" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    361361        Execute strToExecute 
    362362 
     
    652652        //FBinRead Cannot handle 32 bit VAX floating point 
    653653        //GBLoadWave, however, can properly read it 
    654         String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q" 
     654        String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q/P=catPathName" 
    655655        String strToExecute 
    656656        //append "/S=offset/U=numofreals" to control the read 
     
    662662        SetDataFolder curPath 
    663663        // 4 R*4 values 
    664         strToExecute = GBLoadStr + "/S=39/U=4" + "\"" + fname + "\"" 
     664        strToExecute = GBLoadStr + "/S=39/U=4" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    665665        Execute strToExecute 
    666666         
     
    673673        // 4 R*4 values 
    674674        SetDataFolder curPath 
    675         strToExecute = GBLoadStr + "/S=158/U=4" + "\"" + fname + "\"" 
     675        strToExecute = GBLoadStr + "/S=158/U=4" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    676676        Execute strToExecute 
    677677        b=4      
     
    682682        // 2 R*4 values 
    683683        SetDataFolder curPath 
    684         strToExecute = GBLoadStr + "/S=186/U=2" + "\"" + fname + "\"" 
     684        strToExecute = GBLoadStr + "/S=186/U=2" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    685685        Execute strToExecute 
    686686        b=2      
     
    690690        // 6 R*4 values 
    691691        SetDataFolder curPath 
    692         strToExecute = GBLoadStr + "/S=220/U=6" + "\"" + fname + "\"" 
     692        strToExecute = GBLoadStr + "/S=220/U=6" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    693693        Execute strToExecute 
    694694        b=6      
     
    698698        // 13 R*4 values 
    699699        SetDataFolder curPath 
    700         strToExecute = GBLoadStr + "/S=252/U=13" + "\"" + fname + "\"" 
     700        strToExecute = GBLoadStr + "/S=252/U=13" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    701701        Execute strToExecute 
    702702        b=13 
     
    706706        // 3 R*4 values 
    707707        SetDataFolder curPath 
    708         strToExecute = GBLoadStr + "/S=320/U=3" + "\"" + fname + "\"" 
     708        strToExecute = GBLoadStr + "/S=320/U=3" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    709709        Execute strToExecute 
    710710        b=3      
     
    714714        // 7 R*4 values 
    715715        SetDataFolder curPath 
    716         strToExecute = GBLoadStr + "/S=348/U=7" + "\"" + fname + "\"" 
     716        strToExecute = GBLoadStr + "/S=348/U=7" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    717717        Execute strToExecute 
    718718        b=7 
     
    722722        // 4 R*4 values 
    723723        SetDataFolder curPath 
    724         strToExecute = GBLoadStr + "/S=388/U=4" + "\"" + fname + "\"" 
     724        strToExecute = GBLoadStr + "/S=388/U=4" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    725725        Execute strToExecute 
    726726        b=4      
     
    730730        // 2 R*4 values 
    731731        SetDataFolder curPath 
    732         strToExecute = GBLoadStr + "/S=450/U=2" + "\"" + fname + "\"" 
     732        strToExecute = GBLoadStr + "/S=450/U=2" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    733733        Execute strToExecute 
    734734        b=2 
     
    738738        // 2 R*4 values 
    739739        SetDataFolder curPath 
    740         strToExecute = GBLoadStr + "/S=470/U=2" + "\"" + fname + "\"" 
     740        strToExecute = GBLoadStr + "/S=470/U=2" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    741741        Execute strToExecute 
    742742        b=2 
     
    746746        // 5 R*4 values 
    747747        SetDataFolder curPath 
    748         strToExecute = GBLoadStr + "/S=494/U=5" + "\"" + fname + "\"" 
     748        strToExecute = GBLoadStr + "/S=494/U=5" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    749749        Execute strToExecute 
    750750        b=5      
     
    766766         
    767767        //read in the data 
    768         GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q" 
     768        GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q/P=catPathName" 
    769769 
    770770        curPath = "root:Packages:NIST:"+cur_folder 
     
    793793                SetDataFolder curPath 
    794794                 
    795                 strToExecute = GBLoadStr + "/S="+num2str(offset)+"/U=511" + "\"" + fname + "\"" 
     795                strToExecute = GBLoadStr + "/S="+num2str(offset)+"/U=511" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    796796                Execute strToExecute 
    797797                //Print strToExecute 
     
    802802                offset += 511*4 +2 
    803803                 
    804                 strToExecute = GBLoadStr + "/S="+num2str(offset)+"/U=510" + "\"" + fname + "\"" 
     804                strToExecute = GBLoadStr + "/S="+num2str(offset)+"/U=510" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    805805                SetDataFolder curPath 
    806806                Execute strToExecute 
     
    819819        // 16336 values have been read in -- 
    820820        //read in last 64 values 
    821         strToExecute = GBLoadStr + "/S="+num2str(offset)+"/U=48" + "\"" + fname + "\"" 
     821        strToExecute = GBLoadStr + "/S="+num2str(offset)+"/U=48" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    822822         
    823823        SetDataFolder curPath 
     
    14961496 
    14971497// read a single real value with GBLoadWave 
     1498// SRK 2016 changed to use the path, which may be UNC (that is starting with \\ on windows 10) 
     1499// 
     1500// 
    14981501Function getRealValueFromHeader(fname,start) 
    14991502        String fname 
    15001503        Variable start 
    15011504 
    1502         String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q" 
    1503          
    1504         GBLoadStr += "/S="+num2str(start)+"/U=1" + "\"" + fname + "\"" 
     1505// original, if fname is the full path:name 
     1506//      String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q"   
     1507//      GBLoadStr += "/S="+num2str(start)+"/U=1" + "\"" + fname + "\"" 
     1508 
     1509        String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q/P=catPathName"                     
     1510//      String fileOnly = ParseFilePath(0, fname, ":", 1, 0) 
     1511        GBLoadStr += "/S="+num2str(start)+"/U=1" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
     1512 
     1513         
    15051514        Execute GBLoadStr 
    15061515        Wave w=$"tempGBWave0" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Utils.ipf

    r1003 r1016  
    990990         
    991991        SetDataFolder root: 
    992         String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q" 
     992//      String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q" 
     993        String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q/P=catPathName" 
    993994        String strToExecute="" 
    994995        // 1 R*4 value 
    995         strToExecute = GBLoadStr + "/S=368/U=1" + "\"" + fname + "\"" 
     996//      strToExecute = GBLoadStr + "/S=368/U=1" + "\"" + fname + "\"" 
     997        strToExecute = GBLoadStr + "/S=368/U=1" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\""              //use the path and just the file name 
    996998        Execute strToExecute 
    997999        Wave w=$"root:tempGBWave0" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/RealTimeUpdate_RT.ipf

    r873 r1016  
    852852        //FBinRead Cannot handle 32 bit VAX floating point 
    853853        //GBLoadWave, however, can properly read it 
    854         String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q" 
     854        String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q/P=catPathName" 
    855855        String strToExecute 
    856856        //append "/S=offset/U=numofreals" to control the read 
     
    863863         
    864864        // 4 R*4 values 
    865         strToExecute = GBLoadStr + "/S=39/U=4" + "\"" + fname + "\"" 
     865        strToExecute = GBLoadStr + "/S=39/U=4" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    866866        Execute/Z strToExecute 
    867867        Wave w=$"root:Packages:NIST:RealTime:tempGBWave0" 
     
    872872        // 4 R*4 values 
    873873        SetDataFolder curPath 
    874         strToExecute = GBLoadStr + "/S=158/U=4" + "\"" + fname + "\"" 
     874        strToExecute = GBLoadStr + "/S=158/U=4" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    875875        Execute/Z strToExecute 
    876876        b=4      
     
    881881        // 2 R*4 values 
    882882        SetDataFolder curPath 
    883         strToExecute = GBLoadStr + "/S=186/U=2" + "\"" + fname + "\"" 
     883        strToExecute = GBLoadStr + "/S=186/U=2" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    884884        Execute/Z strToExecute 
    885885        b=2      
     
    889889        // 6 R*4 values 
    890890        SetDataFolder curPath 
    891         strToExecute = GBLoadStr + "/S=220/U=6" + "\"" + fname + "\"" 
     891        strToExecute = GBLoadStr + "/S=220/U=6" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    892892        Execute/Z strToExecute 
    893893        b=6      
     
    897897        // 13 R*4 values 
    898898        SetDataFolder curPath 
    899         strToExecute = GBLoadStr + "/S=252/U=13" + "\"" + fname + "\"" 
     899        strToExecute = GBLoadStr + "/S=252/U=13" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    900900        Execute/Z strToExecute 
    901901        b=13 
     
    905905        // 3 R*4 values 
    906906        SetDataFolder curPath 
    907         strToExecute = GBLoadStr + "/S=320/U=3" + "\"" + fname + "\"" 
     907        strToExecute = GBLoadStr + "/S=320/U=3" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    908908        Execute/Z strToExecute 
    909909        b=3      
     
    913913        // 7 R*4 values 
    914914        SetDataFolder curPath 
    915         strToExecute = GBLoadStr + "/S=348/U=7" + "\"" + fname + "\"" 
     915        strToExecute = GBLoadStr + "/S=348/U=7" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    916916        Execute/Z strToExecute 
    917917        b=7 
     
    921921        // 4 R*4 values 
    922922        SetDataFolder curPath 
    923         strToExecute = GBLoadStr + "/S=388/U=4" + "\"" + fname + "\"" 
     923        strToExecute = GBLoadStr + "/S=388/U=4" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    924924        Execute/Z strToExecute 
    925925        b=4      
     
    929929        // 2 R*4 values 
    930930        SetDataFolder curPath 
    931         strToExecute = GBLoadStr + "/S=450/U=2" + "\"" + fname + "\"" 
     931        strToExecute = GBLoadStr + "/S=450/U=2" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    932932        Execute/Z strToExecute 
    933933        b=2 
     
    937937        // 2 R*4 values 
    938938        SetDataFolder curPath 
    939         strToExecute = GBLoadStr + "/S=470/U=2" + "\"" + fname + "\"" 
     939        strToExecute = GBLoadStr + "/S=470/U=2" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    940940        Execute/Z strToExecute 
    941941        b=2 
     
    945945        // 5 R*4 values 
    946946        SetDataFolder curPath 
    947         strToExecute = GBLoadStr + "/S=494/U=5" + "\"" + fname + "\"" 
     947        strToExecute = GBLoadStr + "/S=494/U=5" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    948948        Execute/Z strToExecute 
    949949        b=5      
     
    966966        SetDataFolder curPath 
    967967        //read in the data 
    968         strToExecute = "GBLoadWave/O/N=tempGBwave/B/T={16,2}/S=514/Q" + "\"" + fname + "\"" 
     968        strToExecute = "GBLoadWave/O/N=tempGBwave/B/T={16,2}/S=514/Q/P=catPathName" + "\"" + ParseFilePath(0, fname, ":", 1, 0) + "\"" 
    969969        Execute/Z strToExecute 
    970970 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Transmission.ipf

    r950 r1016  
    742742        Variable x1,x2,y1,y2,err,attenEmp,attenSam,empty_ct_err,sam_ct_err,samAttenFactor,empAttenFactor,trans_err 
    743743        String suffix = "",pathName,textStr,abortStr,emptyFile,transFile,samFileStr 
    744         String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q" 
    745         String strToExecute 
     744 
    746745         
    747746        num_t_files = numpnts(T_GFilenames) 
     
    870869        Variable x1,x2,y1,y2,err,attenEmp,attenSam,empty_ct_err,sam_ct_err,emp_atten_err,sam_atten_err 
    871870        String suffix = "",pathName,textStr,abortStr,emptyFile,transFile,samFileStr 
    872         String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q" 
    873         String strToExecute 
     871 
    874872         
    875873        num_t_files = numpnts(T_GFilenames) 
     
    10021000        Variable x1,x2,y1,y2,err,attenEmp,attenSam,empty_ct_err,sam_ct_err,emp_atten_err,sam_atten_err 
    10031001        String suffix = "",pathName,textStr,abortStr,emptyFile,transFile,samFileStr 
    1004         String GBLoadStr="GBLoadWave/O/N=tempGBwave/T={2,2}/J=2/W=1/Q" 
    1005         String strToExecute 
    10061002         
    10071003        num_t_files = numpnts(T_GFilenames) 
Note: See TracChangeset for help on using the changeset viewer.