Changeset 769 for sans/Dev


Ignore:
Timestamp:
Nov 30, 2010 2:48:30 PM (12 years ago)
Author:
srkline
Message:

fixes to ILL DIV file loading

bug in GenCurveFit? being passed a null hold string

FTP check still not working

Location:
sans/Dev/trunk/NCNR_User_Procedures
Files:
3 edited

Legend:

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

    r764 r769  
    185185        WAVE/Z bar.ffsWaves[0] = fs.resW                //will not exist for 3-column data sets 
    186186         
    187  
     187        // FuncFit can accept a null HoldStr, this cannot.  
     188        if(strlen(holdStr)==0) 
     189                Variable nc=numpnts(bar.w),ii 
     190                for(ii=0;ii<nc;ii+=1) 
     191                        holdStr += "0" 
     192                endfor 
     193                print holdStr 
     194        endif 
     195         
    188196        //need to parse limits, or make up some defaults 
    189197        // limits is (n,2) 
  • sans/Dev/trunk/NCNR_User_Procedures/Common/Installer/CheckVersionFTP.ipf

    r661 r769  
    1818        fileNameStr += "CurrentVersion.txt" 
    1919 
    20         FTPDownload/O/Z url, fileNameStr 
     20        FTPDownload/O/Z/V=7/T=1 url, fileNameStr 
    2121 
    2222        Open/R refNum as fileNameStr 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ILL_DataReadWrite.ipf

    r764 r769  
    248248 
    249249 
     250 
     251/////////DIV file created with NIST reduction so has the VAX format.... painful 
     252//       
    250253// Detector sensitivity files have the same header structure as RAW SANS data 
    251254// as NCNR, just with a different data array (real, rather than integer data) 
     
    261264// 
    262265// type is "DIV" on input 
    263 Function ReadHeaderAndWork1(type,fname) 
    264         String type,fname 
    265          
    266         //type is the desired folder to read the workfile to 
    267         //this data will NOT be automatically displayed 
    268         // gDataDisplayType is unchanged 
    269  
    270         String cur_folder = type 
    271         String curPath = "root:Packages:NIST:"+cur_folder 
    272         SetDataFolder curPath           //use the full path, so it will always work 
    273          
    274         Variable refNum,integer,realval 
    275         String sansfname,textstr 
    276         Variable/G $(curPath + ":gIsLogScale") = 0              //initial state is linear, keep this in DIV folder 
    277          
    278         Make/O/D/N=23 $(curPath + ":IntegersRead") 
    279         Make/O/D/N=52 $(curPath + ":RealsRead") 
    280         Make/O/T/N=11 $(curPath + ":TextRead") 
    281          
    282         WAVE intw=$(curPath + ":IntegersRead") 
    283         WAVE realw=$(curPath + ":RealsRead") 
    284         WAVE/T textw=$(curPath + ":TextRead") 
    285          
    286         // the actual data array, dimensions are set as globals in  
    287         // InitFacilityGlobals() 
    288         NVAR XPix = root:myGlobals:gNPixelsX 
    289         NVAR YPix = root:myGlobals:gNPixelsX 
    290          
    291  
    292          
    293         Make/O/D/N=(XPix,YPix) $(curPath + ":data") 
    294         WAVE data = $(curPath + ":data") 
    295          
    296          
    297 //      print "function used" 
    298  
    299  
    300          
    301          
    302          
    303         //loadwave /H "fname" 
    304          
    305         //Duplicate/O $"fname", datates 
    306          
    307  
    308  
    309                 // (1) 
    310         // fill in your reader for the header here so that intw, realw, and textW are filled in 
    311         // ? possibly a duplication of the raw data reader 
    312         Duplicate/O $("root:Packages:NIST:raw:realsread"),$(curPath+ ":realsread") 
    313         Duplicate/O $("root:Packages:NIST:raw:integersread"),$(curPath+ ":integersread") 
    314         Duplicate/T $("root:Packages:NIST:raw:Textread"),$(curPath+ ":Textread") 
    315          
    316  
    317         //(2) 
    318         // then fill in a reader for the data array that will DIVIDE your data 
    319         // to get the corrected values. 
    320         // fill the data array with the detector values 
    321  
    322         duplicate/O $("root:Packages:NIST:raw:data"),$(curPath+ ":data") 
    323          
    324          
    325         //keep a string with the filename in the DIV folder 
    326         String/G $(curPath + ":fileList") = textw[0] 
    327          
    328         //return the data folder to root 
    329         SetDataFolder root: 
    330          
    331         Return(0) 
    332 End 
    333  
    334  
    335 /////////DIV file created with NIST reduction so has the VAX format.... painful 
    336  
    337  
    338          
    339 // Detector sensitivity files have the same header structure as RAW SANS data 
    340 // as NCNR, just with a different data array (real, rather than integer data) 
    341 // 
    342 // So for your facility, make this reader specific to the format of whatever 
    343 // file you use for a pixel-by-pixel division of the raw detector data 
    344 // to correct for non-uniform sensitivities of the detector. This is typically a 
    345 // measurement of water, plexiglas, or another uniform scattering sample. 
    346 // 
    347 // The data must be normalized to a mean value of 1 
    348 // 
    349 // called from ProtocolAsPanel.ipf 
    350 // 
    351 // type is "DIV" on input 
    352266Function ReadHeaderAndWork(type,fname) 
    353267        String type,fname 
     
    378292        NVAR YPix = root:myGlobals:gNPixelsX 
    379293         
    380  
    381294        Make/O/D/N=(XPix,YPix) $(curPath + ":data") 
    382295        WAVE data = $(curPath + ":data") 
     
    385298        WAVE linear_data = $(curPath + ":linear_data") 
    386299         
    387          
    388 //      print "function used" 
    389          
    390  
    391                 // (1) 
     300        // (1) 
    392301        // fill in your reader for the header here so that intw, realw, and textW are filled in 
    393         // ? possibly a duplication of the raw data reader 
    394         Duplicate/O $("root:Packages:NIST:raw:realsread"),$(curPath+ ":realsread") 
    395         Duplicate/O $("root:Packages:NIST:raw:integersread"),$(curPath+ ":integersread") 
    396         Duplicate/T $("root:Packages:NIST:raw:Textread"),$(curPath+ ":Textread") 
    397          
     302        // -- these are not really needed at all, so skip them for now 
     303        // a simple duplication of some other data may be sufficient 
     304        if(exists("root:Packages:NIST:raw:realsread") == 1) 
     305                Duplicate/O $("root:Packages:NIST:raw:realsread"),$(curPath+ ":realsread") 
     306                Duplicate/O $("root:Packages:NIST:raw:integersread"),$(curPath+ ":integersread") 
     307                Duplicate/O/T $("root:Packages:NIST:raw:Textread"),$(curPath+ ":Textread") 
     308        endif 
    398309 
    399310        //(2) 
    400311        // then fill in a reader for the data array that will DIVIDE your data 
    401312        // to get the corrected values. 
    402         // fill the data array with the detector values 
    403313 
    404314        //here you load in your file, you're already in the DIV folder 
    405 //      LoadWave/H/O "Macintosh HD:Users:srkline:Desktop:linear_data.ibw" 
    406         LoadWave/H/O fname              //since fname is the full path 
    407          
    408         ConvertFolderToLogScale(type) 
    409          
     315        LoadWave/O fname                //since fname is the full path 
     316                 
    410317        String loadedStr = StringFromList(0,S_waveNames,";")            //then name of the wave loaded 
    411318 
    412         //then copy the loaded wave to data and to linear data, in the DIV folder 
    413         duplicate/O $("loadedStr"),$(curPath+ ":data") 
    414         duplicate/O $("loadedStr"),$(curPath+ ":linear_data") 
    415          
     319        // if data loaded in is already named "data", don't bother with this step 
     320        if(exists("data") == 0) 
     321                duplicate/O $loadedStr,$(curPath+ ":data") 
     322        endif 
     323        // if data loaded in is already named "linear_data", don't bother with this step 
     324        if(exists("linear_data") == 0) 
     325                duplicate/O $loadedStr,$(curPath+ ":linear_data") 
     326        endif 
    416327         
    417328        //keep a string with the filename in the DIV folder 
     
    423334        Return(0) 
    424335End 
    425  
    426  
    427  
    428336 
    429337 
Note: See TracChangeset for help on using the changeset viewer.