Changeset 916 for sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
- Timestamp:
- Jul 2, 2013 2:38:09 PM (10 years ago)
- 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 2762 2762 fSplitBigFile(splitSize, baseStr) 2763 2763 2764 ShowSplitFileTable() 2764 2765 End 2765 2766 … … 2863 2864 End 2864 2865 2866 // allows the list of loaded files to be edited 2867 Function 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) 2878 End 2865 2879 2866 2880 … … 3135 3149 End 3136 3150 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 3139 3152 // 3140 3153 Function Stream_LoadDecim(ctrlName) … … 3152 3165 3153 3166 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 3154 3181 3155 3182 //loop through everything in the list … … 3180 3207 t_longest = waveMax(rescaledTime) //should be the last point 3181 3208 3182 // (2) do the decimation, just on timePt. Ignore rescaledTime for now3209 // (2) do the decimation, just on timePt. create rescaledTime from the decimated timePt 3183 3210 3184 3211 Duplicate/O timePt, timePt_dTmp -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_DataReadWrite.ipf
r886 r916 1945 1945 // 1946 1946 // 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) 1948 1948 // 1949 1949 // SRK 29JAN09 … … 3111 3111 3112 3112 ////////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 // 3125 Proc RenumberRunNumber(add) 3126 Variable add 3127 3128 fRenumberRunNumber(add) 3129 3130 End 3131 3132 Proc CheckFileNames(firstFile,lastFile) 3133 Variable firstFile=1,lastFile=100 3134 3135 fCheckFileNames(firstFile,lastFile) 3136 End 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. 3142 Function 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) 3177 End 3178 3179 // simple utility to read the file name stored in the file header (and the suffix) 3180 Function 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) 3199 End 3200 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Includes_v520.ipf
r906 r916 127 127 "PatchFileNameInHeader" 128 128 "ReadFileNameInHeader" 129 "-" 130 "Renumber Run Number" 131 "Check File Names" 129 132 // "-" 130 133 // "AddALLToLayout" //added to tile raw 2d panel -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Utils.ipf
r911 r916 994 994 // 995 995 // 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 997 997 // upper/lowercase letters, while the filename on the server (should) be all caps 998 998 // now makes repeated calls to ValidFileString() -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/ProtocolAsPanel.ipf
r890 r916 2069 2069 //get the XY box, if needed 2070 2070 Variable x1,x2,y1,y2,ct_err 2071 String filename=tw[0],tempStr 2071 String filename=tw[0],tempStr //02JUL13 2072 2072 PathInfo/S catPathName 2073 2073 String tempName = S_Path + FindValidFilename(filename) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Tile_2D.ipf
r763 r916 639 639 fRawWindowHook() 640 640 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 642 642 643 643 if(qxqy) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/WorkFileUtils.ipf
r890 r916 312 312 WAVE integersread=$(destPath + ":integersread") 313 313 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 315 315 316 316 //apply nonlinear, Jacobian corrections ---
Note: See TracChangeset
for help on using the changeset viewer.