Ignore:
Timestamp:
Nov 16, 2017 10:57:32 AM (5 years ago)
Author:
srkline
Message:

lots of changes here:
many little fixes to clean up TODO items and marke them DONE

changed the handling of the panel "gap" to split the gap evenly. Q-calculations have been re-verified with this change.

re-named the list of "bin Type" values, and added a few more choices. Streamlined how the averaging and plotting works with this list so that it can be more easily modified as different combinations of binning are envisioned. This resulted in a lot of excess code being cut out and replaced with cleaner logic. This change has also been verified to work as intended.

Attenuation is now always calculated from the table. The table also by (NEW) definition has values for the white beam (one waelength) and graphite (multiple possible wavelengths) where the wavelengths are artificially scaled (*1000) or *1e6) so that the interpolations can be done internally without the need for multiple attenuator tables.

File:
1 edited

Legend:

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

    r1064 r1073  
    1717//    some experiments (magnetic, rotation, temperature scans, etc.) but are necessary for others. 
    1818// 
    19 // TODO PRIORITY: 
     19// (DONE): 
    2020// x- clean up the list of files that now accumulates in the RawVSANS folder!!! Everything is there, including 
    2121//    files that are NOT RAW VSANS data (MASK and DIV, but these are HDF) 
     
    3131// clear out the folders in the RawVSANS folder, otherwise any changes/patches written to disk 
    3232// will not be read in, the "bad" local copy will be read in. 
    33 // TODO: 
     33// (DONE) 
    3434//  x- this *may* be a very slow operation. Warn users. Give them a choice to keep local copies. If 
    3535//     the "patched" values are written locally too, then maybe the update from disk is not needed. 
    3636//     But typically, I'd like to see that the disk version really did get updated... 
    37 // -- make a background task to periodically "kill" a few of the files? maybe too dangerous. 
    38 // -- change the V_GetHeaderInfoToWave function to allow "refreshing" of a single row, say after 
     37// x- (NO)make a background task to periodically "kill" a few of the files? maybe too dangerous. 
     38// x- (NO)change the V_GetHeaderInfoToWave function to allow "refreshing" of a single row, say after 
    3939//    a file has been patched - then the disk and local copies are in sync 
    4040// 
     
    160160                ModifyTable width(Point)=0              //JUN04, remove point numbers - confuses users since point != run 
    161161 
    162 // TODO: 
     162// (DONE) 
    163163//  x- experimental hook with contextual menu 
    164164//               
     
    171171// clear out the folders in the RawVSANS folder, otherwise any changes/patches written to disk 
    172172// will not be read in, the "bad" local copy will be read in for any subsequent operations. 
    173 // TODO: 
     173// (DONE) 
    174174//  x- this *may* be a very slow operation. Warn users. Give them a choice to keep local copies? If 
    175175//     the "patched" values are written locally too, then maybe the update from disk is not needed. 
     
    192192        numitems = ItemsInList(list,";") 
    193193         
     194        // show a progress bar for filling the file catalog 
     195        Variable indefinite=0,useIgorDraw=1 
     196        NewPanel /N=ProgressPanel /W=(285,111,739,193) 
     197        ValDisplay valdisp0,win=ProgressPanel,pos={18,32},size={342,18},limits={0,numitems,0},barmisc={0,0} 
     198        ValDisplay valdisp0,win=ProgressPanel,value= _NUM:0 
     199        DrawText 20,24,"Refreshing file catalog... Please Wait..." 
     200 
     201        if( indefinite ) 
     202                ValDisplay valdisp0,win=ProgressPanel,mode= 4   // candy stripe 
     203        else 
     204                ValDisplay valdisp0,win=ProgressPanel,mode= 3   // bar with no fractional part 
     205        endif 
     206        if( useIgorDraw ) 
     207                ValDisplay valdisp0,win=ProgressPanel,highColor=(49535,1000,1000)               //(0,65535,0) 
     208        endif 
     209        Button bStop,win=ProgressPanel,pos={375,32},size={50,20},title="Stop" 
     210        DoUpdate /W=ProgressPanel /E=1  // mark this as our progress window 
     211         
     212         
    194213        //loop through all of the files in the list, reading CAT/SHORT information if the file is RAW SANS 
    195         //***version numbers have been removed*** 
    196214        String str,fullName 
    197215        Variable lastPoint 
     
    232250                Endif 
    233251                ii+=1 
     252                 
     253                ValDisplay valdisp0,win=ProgressPanel,value= _NUM:ii 
     254                DoUpdate /W=ProgressPanel 
     255                 
    234256        while(ii<numitems) 
     257         
     258        KillWindow ProgressPanel 
     259 
    235260//Now sort them all based on some criterion that may be facility dependent (aim is to order them as collected) 
    236261        V_SortWaves() 
     262         
    237263//Append the files that are not raw files to the list 
    238  
    239264        V_AppendNotRAWFiles(notRAWlist)  
    240265        KillWaves/Z notRAWlist 
     
    245270        // 
    246271        // clean out again, so that the file SAVE is not slow due to the large experiment size 
    247         // TODO x- decide if this is really necessary (not necessary at this point) 
     272        // (DONE) x- decide if this is really necessary (not necessary at this point) 
    248273//       
    249274//      V_CleanOutRawVSANS() 
     
    339364End 
    340365 
    341 //sorts all of the waves of header information using the suffix (A123)  
    342 //the result is that all of the data is in the order that it was collected, 
    343 // regardless of how the prefix or run numbers were changed by the user 
     366// 
    344367Function V_SortWaves() 
    345368        Wave/T GFilenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames" 
     
    463486         
    464487//      //read the file alphanumeric suffix 
    465 //      // TODO x- this does not exist for VSANS - so is there an equivalent, or delete? ((delete)) 
     488//      // (DONE) x- this does not exist for VSANS - so is there an equivalent, or delete? ((delete)) 
    466489//      InsertPoints lastPoint,1,GSuffix 
    467490//      GSuffix[lastPoint]="unknown" 
     
    492515         
    493516        //Attenuators 
    494         // TODO -- this is the "number" of the attenuator, but what is its relation to the 
    495         //   stack of 4 plates? binary representation? 
     517        // (DONE) x- this is the "number" of the attenuator 
    496518        InsertPoints lastPoint,1,GNumAttens 
    497519        GNumAttens[lastPoint]=V_getAtten_number(fname) 
Note: See TracChangeset for help on using the changeset viewer.