Ignore:
Timestamp:
Jul 2, 2013 2:38:09 PM (10 years ago)
Author:
srkline
Message:

Changes to the panel sizes to accommodate smaller screens on laptops. Resized some panels and reorganized some of the controls. Help files have been updated to reflect these changes.

Added function to rename raw data files by copying file on disk, then writing in the new file number to the header. Solves the ICE problem of duplicated run numbers. In NCNR_DataReadWrite. See RenumberRunNumber?

Added new functions to the EventModeProcessing? to split large files (stream mode) and decimate when they are read back in. Added features to the event editing to automatically detect steps, and to show the differential with the data. Panel has improved layout. Still in the beta phase with these new features.

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

Legend:

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

    r915 r916  
    27622762        fSplitBigFile(splitSize, baseStr) 
    27632763         
     2764        ShowSplitFileTable() 
    27642765End 
    27652766 
     
    28632864End 
    28642865 
     2866// allows the list of loaded files to be edited 
     2867Function ShowSplitFileTable() 
     2868 
     2869        SVAR str = root:Packages:NIST:Event:gSplitFileList 
     2870         
     2871        Make/O/T/N=1 root:Packages:NIST:Event:SplitFileWave 
     2872        WAVE tw = root:Packages:NIST:Event:SplitFileWave 
     2873         
     2874        List2TextWave(str,tw) 
     2875        Edit tw 
     2876 
     2877        return(0) 
     2878End 
    28652879 
    28662880 
     
    31353149End 
    31363150 
    3137 // functions that take file names as arguments so that the loading an be done in batch mode 
    3138 // for the mode of "one continuous exposure" 
     3151// loads a list of files, decimating each chunk as it is read in 
    31393152// 
    31403153Function Stream_LoadDecim(ctrlName) 
     
    31523165 
    31533166 
     3167// if "stream" mode is not checked - abort 
     3168        NVAR gEventModeRadioVal= root:Packages:NIST:gEvent_mode 
     3169        if(gEventModeRadioVal != MODE_STREAM) 
     3170                Abort "The mode must be 'Stream' to use this function" 
     3171                return(0) 
     3172        endif 
     3173 
     3174// if the list has been edited, turn it into a list 
     3175        WAVE/T/Z tw = root:Packages:NIST:Event:SplitFileWave 
     3176        if(WaveExists(tw)) 
     3177                listStr = TextWave2SemiList(tw) 
     3178        endif 
     3179         
     3180         
    31543181 
    31553182        //loop through everything in the list 
     
    31803207                t_longest = waveMax(rescaledTime)               //should be the last point 
    31813208                 
    3182 // (2) do the decimation, just on timePt. Ignore rescaledTime for now    
     3209// (2) do the decimation, just on timePt. create rescaledTime from the decimated timePt  
    31833210                 
    31843211                Duplicate/O timePt, timePt_dTmp 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_DataReadWrite.ipf

    r886 r916  
    19451945// 
    19461946// seems to work correctly byte for byte 
    1947 // compression has bee implmented also, for complete replication of the format (n>32767 in a cell) 
     1947// compression has been implmented also, for complete replication of the format (n>32767 in a cell) 
    19481948// 
    19491949// SRK 29JAN09 
     
    31113111 
    31123112////////end of ProDiv() specifics 
     3113 
     3114 
     3115// JUL 2013 
     3116// Yet another fix for an ICE issue. Here the issue is when the run number gets "magically" 
     3117// reset during an experiment. Then there are duplicate run numbers. When procedures key on the run number, 
     3118// the *first* file in the OS file listing is the one that's found. Simply renaming the file with a  
     3119// different number is not sufficient, as the file name embedded in the header must be used (typically from 
     3120// marquee operations) where there is a disconnect between the file load and the function - leading to  
     3121// cases where the current data is "unknown", except for textRead. 
     3122// 
     3123// Hence more patching procedures to re-write files with new file names in the header and the OS. 
     3124// 
     3125Proc RenumberRunNumber(add) 
     3126        Variable add 
     3127 
     3128        fRenumberRunNumber(add) 
     3129 
     3130End 
     3131 
     3132Proc CheckFileNames(firstFile,lastFile) 
     3133        Variable firstFile=1,lastFile=100 
     3134         
     3135        fCheckFileNames(firstFile,lastFile) 
     3136End 
     3137 
     3138 
     3139// will read the 21 character file name and put any spaces at the front of the string 
     3140// like the VAX does. Should have absolutely no effect if there are spaces at the 
     3141// beginning of the string, as the VAX does. 
     3142Function fRenumberRunNumber(add) 
     3143        Variable add 
     3144         
     3145        Variable ii,numItems 
     3146        String item,runStr,list 
     3147        String curFile,newRunStr,newFileStr 
     3148        String pathStr 
     3149        PathInfo catPathName 
     3150        pathStr = S_path 
     3151         
     3152// get a list of all of the files in the folder 
     3153        list = IndexedFile(catPathName,-1,"????")       //get all files in folder 
     3154        numItems = ItemsInList(list,";")                //get the new number of items in the list 
     3155 
     3156// for each file 
     3157        for(ii=0;ii<numItems;ii+=1) 
     3158                curFile = StringFromList(ii, list  ,";" ) 
     3159                runStr = GetRunNumStrFromFile(curFile) 
     3160                 
     3161                if(cmpstr(runStr,"ABC") != 0)           // weed out error if run number can't be found 
     3162                        newRunStr = num2str( str2num(runStr) + add ) 
     3163                        newFileStr = ReplaceString(runStr, curFile, newRunStr ) 
     3164                // change the file name on disk to have a new number (+add) 
     3165                        Printf "Old = %s\t\tNew = %s\r",curFile,newFileStr 
     3166                         
     3167                // copy the file, saving with the new name 
     3168                        CopyFile/I=0/O/P=catPathName curFile as newFileStr 
     3169                         
     3170                // change the run number in the file header to have the new number (writing just the necessary characters) 
     3171                        WriteTextToHeader(pathStr+newFileStr,newRunStr,7)               //start at byte 7 
     3172                endif 
     3173                                         
     3174        endfor 
     3175         
     3176        return(0) 
     3177End 
     3178 
     3179// simple utility to read the file name stored in the file header (and the suffix) 
     3180Function fCheckFileNames(lo,hi) 
     3181        Variable lo,hi 
     3182         
     3183        String file,fileName,suffix,fileInHdr,fileOnDisk 
     3184        Variable ii 
     3185         
     3186        for(ii=lo;ii<=hi;ii+=1) 
     3187                file = FindFileFromRunNumber(ii) 
     3188                if(strlen(file) != 0) 
     3189                        fileOnDisk = ParseFilePath(0, file, ":", 1, 0) 
     3190                        fileInHdr = getFileName(file) 
     3191//                      suffix = getSuffix(file) 
     3192                        printf "File %d:  File on disk = %s\t\tFile in Hdr = %s\r",ii,fileOnDisk,fileInHdr 
     3193                else 
     3194                        printf "run number %d not found\r",ii 
     3195                endif 
     3196        endfor 
     3197         
     3198        return(0) 
     3199End 
     3200 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Includes_v520.ipf

    r906 r916  
    127127        "PatchFileNameInHeader" 
    128128        "ReadFileNameInHeader" 
     129        "-" 
     130        "Renumber Run Number" 
     131        "Check File Names" 
    129132//      "-" 
    130133//      "AddALLToLayout"                        //added to tile raw 2d panel 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Utils.ipf

    r911 r916  
    994994// 
    995995// added 11/99 - uppercase and lowercase versions of the file are tried, if necessary 
    996 // since from marquee, the filename field (textread[0]) must be used, and can be a mix of 
     996// since from marquee, the filename field (textread[0]) must be used, and can be a mix of                       //02JUL13 
    997997// upper/lowercase letters, while the filename on the server (should) be all caps 
    998998// now makes repeated calls to ValidFileString() 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ProtocolAsPanel.ipf

    r890 r916  
    20692069                //get the XY box, if needed 
    20702070                Variable x1,x2,y1,y2,ct_err 
    2071                 String filename=tw[0],tempStr 
     2071                String filename=tw[0],tempStr                   //02JUL13 
    20722072                PathInfo/S catPathName 
    20732073                String tempName = S_Path + FindValidFilename(filename) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Tile_2D.ipf

    r763 r916  
    639639                        fRawWindowHook() 
    640640                        WAVE/T/Z tw = $"root:Packages:NIST:RAW:textRead"        //to be sure that wave exists if no data was ever displayed 
    641                         newFileName= GetNameFromHeader(tw[0]) 
     641                        newFileName= GetNameFromHeader(tw[0])           //02JUL13 
    642642                         
    643643                        if(qxqy) 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/WorkFileUtils.ipf

    r890 r916  
    312312        WAVE integersread=$(destPath + ":integersread") 
    313313        WAVE realsread=$(destPath + ":realsread") 
    314         String/G $(destPath + ":fileList") = textread[0]                        //a list of names of the files in the work file (1) 
     314        String/G $(destPath + ":fileList") = textread[0]                        //a list of names of the files in the work file (1)             //02JUL13 
    315315         
    316316        //apply nonlinear, Jacobian corrections --- 
Note: See TracChangeset for help on using the changeset viewer.