Changeset 987 for sans/Dev/trunk/NCNR_User_Procedures/Reduction
- Timestamp:
- Mar 17, 2016 5:00:30 PM (7 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Utils.ipf
r982 r987 53 53 strswitch(funcStr) 54 54 case "Big Debye": 55 tmpInten = VC_Debye(10 ,3000,0.0001,qTot[p][q])55 tmpInten = VC_Debye(100,3000,0.0001,qTot[p][q]) 56 56 break 57 57 case "Big Sphere": … … 80 80 endswitch 81 81 82 // TODO: this is faked to get around the singularity at the center of the back detector 83 // 84 // 85 if(cmpstr(type,"B") == 0) 86 Variable nx,ny,px,py 87 nx = VCALC_get_nPix_X(type) 88 ny = VCALC_get_nPix_Y(type) 89 px = trunc(nx/2) 90 py = trunc(ny/2) 91 92 tmpInten[px][py] = (tmpInten[px][py+1] + tmpInten[px][py-1])/2 93 endif 94 95 82 96 83 97 /////////////// -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_HDF5_VSANS_Utils.ipf
r986 r987 72 72 End 73 73 End 74 75 76 74 77 75 78 … … 530 533 531 534 // 532 // given a filename of a SANS data filename of the form533 // name.anything 534 // returns the name as a string without the".fbdfasga" extension535 // given a filename of a VSANS data file of the form 536 // name.anything.any.other (any number of extensions is OK) 537 // returns the name as a string without ANY ".fbdfasga" extension 535 538 // 536 539 // returns the input string if a "." can't be found (maybe it wasn't there) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_RW_Utils.ipf
r985 r987 89 89 // TODO 90 90 // -- get rid of these fake calibration waves as "real" ones are filled in by NICE 91 91 92 Execute "MakeFakeCalibrationWaves()" 93 92 94 // fMakeFakeCalibrationWaves() //skips the alert 93 95 … … 163 165 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_B 164 166 Wave det_B=data 165 Redimension/N=(150,150)/E=1 det_B167 // Redimension/N=(150,150)/E=1 det_B 166 168 Redimension/D det_B 167 // det_B = p+q+2168 169 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_B:det_B" 169 det_B=tmpw170 det_B += 2170 // det_B=tmpw 171 // det_B += 2 171 172 Wave distance=distance 172 distance = 2200173 distance = VCALC_getSDD("B")*100 // to convert m to cm 173 174 174 175 … … 176 177 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_MT 177 178 Wave det_MT=data 178 Redimension/N=(npix,48)/E=1 det_MT179 // Redimension/N=(npix,48)/E=1 det_MT 179 180 Redimension/D det_MT 180 181 SetScale/I x -npix/2,npix/2,"",det_MT … … 183 184 // det_MT += 2 184 185 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MT:det_MT" 185 det_MT=tmpw186 det_MT += 2186 // det_MT=tmpw 187 // det_MT += 2 187 188 Wave distance=distance 188 distance = 1030189 distance = VCALC_getSDD("MT")*100 // to convert m to cm 189 190 190 191 191 192 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_MB 192 193 Wave det_MB=data 193 Redimension/N=(npix,48)/E=1 det_MB194 // Redimension/N=(npix,48)/E=1 det_MB 194 195 Redimension/D det_MB 195 196 SetScale/I x -npix/2,npix/2,"",det_MB … … 198 199 // det_MB += 2 199 200 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MB:det_MB" 200 det_MB=tmpw201 det_MB += 2201 // det_MB=tmpw 202 // det_MB += 2 202 203 Wave distance=distance 203 distance = 1030204 distance = VCALC_getSDD("MB")*100 // to convert m to cm 204 205 205 206 … … 207 208 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_ML 208 209 Wave det_ML=data 209 Redimension/N=(48,npix)/E=1 det_ML210 // Redimension/N=(48,npix)/E=1 det_ML 210 211 Redimension/D det_ML 211 212 SetScale/I x -ctr-48,-ctr,"",det_ML … … 214 215 // det_ML += 2 215 216 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_ML:det_ML" 216 det_ML=tmpw217 det_ML += 2217 // det_ML=tmpw 218 // det_ML += 2 218 219 Wave distance=distance 219 distance = 1000220 distance = VCALC_getSDD("ML")*100 // to convert m to cm 220 221 221 222 222 223 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_MR 223 224 Wave det_MR=data 224 Redimension/N=(48,npix)/E=1 det_MR225 // Redimension/N=(48,npix)/E=1 det_MR 225 226 Redimension/D det_MR 226 227 SetScale/I x ctr,ctr+48,"",det_MR … … 228 229 // det_MR +=2 229 230 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_MR:det_MR" 230 det_MR=tmpw231 det_MR += 2231 // det_MR=tmpw 232 // det_MR += 2 232 233 Wave distance=distance 233 distance = 1000234 distance = VCALC_getSDD("MR")*100 // to convert m to cm 234 235 235 236 … … 237 238 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FT 238 239 Wave det_FT=data 239 Redimension/N=(npix,48)/E=1 det_FT240 // Redimension/N=(npix,48)/E=1 det_FT 240 241 Redimension/D det_FT 241 242 SetScale/I x -npix/2,npix/2,"",det_FT 242 243 SetScale/I y ctr,ctr+48,"",det_FT 243 244 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FT:det_FT" 244 det_FT=tmpw245 // det_FT=tmpw 245 246 Wave distance=distance 246 distance = 180247 distance = VCALC_getSDD("FT")*100 // to convert m to cm 247 248 248 249 249 250 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FB 250 251 Wave det_FB=data 251 Redimension/N=(npix,48)/E=1 det_FB252 // Redimension/N=(npix,48)/E=1 det_FB 252 253 Redimension/D det_FB 253 254 SetScale/I x -npix/2,npix/2,"",det_FB 254 255 SetScale/I y -ctr-48,-ctr,"",det_FB 255 256 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FB:det_FB" 256 det_FB=tmpw257 // det_FB=tmpw 257 258 Wave distance=distance 258 distance = 180259 distance = VCALC_getSDD("FB")*100 // to convert m to cm 259 260 260 261 261 262 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FL 262 263 Wave det_FL=data 263 Redimension/N=(48,npix)/E=1 det_FL264 // Redimension/N=(48,npix)/E=1 det_FL 264 265 Redimension/D det_FL 265 266 SetScale/I x -ctr-48,-ctr,"",det_FL 266 267 SetScale/I y -npix/2,npix/2,"",det_FL 267 268 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FL:det_FL" 268 det_FL=tmpw269 // det_FL=tmpw 269 270 Wave distance=distance 270 distance = 150271 distance = VCALC_getSDD("FL")*100 // to convert m to cm 271 272 272 273 273 274 SetDataFolder root:Packages:NIST:VSANS:RAW:entry:entry:instrument:detector_FR 274 275 Wave det_FR=data 275 Redimension/N=(48,npix)/E=1 det_FR276 // Redimension/N=(48,npix)/E=1 det_FR 276 277 Redimension/D det_FR 277 278 SetScale/I x ctr,ctr+48,"",det_FR 278 279 SetScale/I y -npix/2,npix/2,"",det_FR 279 280 wave tmpw=$"root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_FR:det_FR" 280 det_FR=tmpw281 // det_FR=tmpw 281 282 Wave distance=distance 282 distance = 150283 distance = VCALC_getSDD("FR")*100 // to convert m to cm 283 284 284 285 285 286 // get rid of zeros 286 det_FL += 2287 det_FR += 2288 det_FT += 2289 det_FB += 2287 // det_FL += 2 288 // det_FR += 2 289 // det_FT += 2 290 // det_FB += 2 290 291 291 292 … … 626 627 // a separate function that will write and generate if needed, and use this in specific cases 627 628 // only if I really have to force it. 629 // 630 // --Attributes are not currently saved. Fix this, maybe make it optional? See the help file for 631 // DemoAttributes(w) example under the HDF5SaveData operation 628 632 // 629 633 // -x change the /P=home to the user-defined data path (catPathName) … … 799 803 ////////////////////////////// 800 804 805 806 807 808 //////// function to take VCALC information and 809 // fill in the simulated information as needed to make a "fake" data file 810 // 801 811 // TODO: 802 // -- this must be called as needed to force a re-read of the data from disk 803 // "as needed" means that when an operation is done that needs to ensure 804 // a fresh read from disk, it must take care of the kill. 805 // -- the ksBaseDFPath needs to be removed. It's currently pointing to RawVSANS, which is 806 // really not used as intended anymore. 807 // 808 Function V_KillNamedDataFolder(fname) 809 String fname 810 811 Variable err=0 812 813 String folderStr = V_GetFileNameFromPathNoSemi(fname) 814 folderStr = V_RemoveDotExtension(folderStr) 815 816 KillDataFolder/Z $(ksBaseDFPath+folderStr) 817 err = V_flag 818 819 return(err) 812 // -- identify all of the necessary bits to change 813 // -- maybe want a panel to make it easier to decide what inputs to change in the file 814 // -- decide if it's better to write wholesale, or as individual waves 815 // 816 Macro Copy_VCALC_to_VSANSFile() 817 818 String fileName = V_DoSaveFileDialog("pick the file to write to") 819 print fileName 820 // 821 if(strlen(fileName) > 0) 822 writeVCALC_to_file(fileName) 823 endif 824 End 825 826 // 827 // TODO -- fill this in as needed to get fake data that's different 828 // 829 Function writeVCALC_to_file(fileName) 830 String fileName 831 832 // the wavelength 833 // Variable lam = V_getWavelength("VCALC") //doesn't work, the corresponding folder in VCALC has not been defined 834 V_writeWavelength(fileName,VCALC_getWavelength()) 835 836 // the front SDD (correct units) 837 // the middle SDD (correct units) 838 // the back SDD (correct units) 839 840 // the detectors, all 9 + the correct SDD (that accounts for the offset of T/B panels 841 Variable ii,val 842 String detStr 843 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 844 detStr = StringFromList(ii, ksDetectorListAll, ";") 845 Duplicate/O $("root:Packages:NIST:VSANS:VCALC:entry:entry:instrument:detector_"+detStr+":det_"+detStr) tmpData 846 Redimension/I tmpData 847 tmpData = (tmpData == 2147483647) ? 0 : tmpData //the NaN "mask" in the sim data (T/B only)shows up as an ugly integer 848 849 V_writeDetectorData(fileName,detStr,tmpData) 850 val = VCALC_getTopBottomSDDOffset(detStr)/10 + VCALC_getSDD(detStr)*100 // make sure value is in cm 851 print val 852 V_writeDet_distance(fileName,detStr,val) 853 endfor 854 855 // the calibration data for each detector 856 857 // the dead time for each detector 858 859 //? other detector geometry - lateral separation? 860 861 862 // description of the sample 863 864 // sample information 865 // name, title, etc 866 867 // fake the information about the count setup, so I have different numbers to read 868 869 // ?? anything else that I'd like to see on the catalog - I could change them here to see different values 870 // different collimation types? 871 // 872 873 return(0) 820 874 end 821 875 822 //given a filename of a SANS data filename of the form 823 // name.anything 824 //returns the name as a string without the ".fbdfasga" extension 825 // 826 // returns the input string if a "." can't be found (maybe it wasn't there) 827 Function/S V_RemoveDotExtension(item) 828 String item 829 String invalid = item // 830 Variable num=-1 831 832 //find the "dot" 833 String runStr="" 834 Variable pos = strsearch(item,".",0) 835 if(pos == -1) 836 //"dot" not found 837 return (invalid) 838 else 839 //found, get all of the characters preceeding it 840 runStr = item[0,pos-1] 841 return (runStr) 842 Endif 843 End 844 845 //returns a string containing filename (WITHOUT the ;vers) 846 //the input string is a full path to the file (Mac-style, still works on Win in IGOR) 847 //with the folders separated by colons 848 // 849 // called by MaskUtils.ipf, ProtocolAsPanel.ipf, WriteQIS.ipf 850 // 851 Function/S V_GetFileNameFromPathNoSemi(fullPath) 852 String fullPath 853 854 Variable offset1,offset2 855 String filename="" 856 //String PartialPath 857 offset1 = 0 858 do 859 offset2 = StrSearch(fullPath, ":", offset1) 860 if (offset2 == -1) // no more colons ? 861 fileName = FullPath[offset1,strlen(FullPath) ] 862 //PartialPath = FullPath[0, offset1-1] 863 break 864 endif 865 offset1 = offset2+1 866 while (1) 867 868 //remove version number from name, if it's there - format should be: filename;N 869 filename = StringFromList(0,filename,";") //returns null if error 870 871 Return filename 872 End 876 877 878 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Initialize.ipf
r980 r987 159 159 160 160 161 // lookup waves for log and linear display of images 162 SetDataFolder root:Packages:NIST:VSANS:Globals 163 Variable num,val,offset 164 num=10000 165 offset = 1/num 166 167 Make/O/D/N=(num) logLookupWave,linearLookupWave 168 linearLookupWave = (p+1)/num 169 170 logLookupWave = log(linearLookupWave) 171 val = logLookupWave[0] 172 logLookupWave += -val + offset 173 val = logLookupWave[num-1] 174 logLookupWave /= val 175 176 SetDataFolder root: 161 177 162 178 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Test_RAW_Panel.ipf
r984 r987 403 403 // make sure log scaling is correct 404 404 NVAR state = root:Packages:NIST:VSANS:Globals:gIsLogScale 405 405 if(State == 0) 406 // lookup wave 407 Wave LookupWave = root:Packages:NIST:VSANS:Globals:linearLookupWave 408 else 409 // lookup wave - the linear version 410 Wave LookupWave = root:Packages:NIST:VSANS:Globals:logLookupWave 411 endif 412 406 413 407 414 //************ … … 435 442 MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(200,70,310,160) 436 443 437 ModifyImage/W=VSANS_Data#det_panelsB ''#0 log=State444 ModifyImage/W=VSANS_Data#det_panelsB ''#0 ctabAutoscale=0,lookup= LookupWave 438 445 439 446 // make the plot square … … 479 486 MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(200,70,310,160) 480 487 481 ModifyImage/W=VSANS_Data#det_panelsM ''#0 log=State482 ModifyImage/W=VSANS_Data#det_panelsM ''#1 log=State483 ModifyImage/W=VSANS_Data#det_panelsM ''#2 log=State484 ModifyImage/W=VSANS_Data#det_panelsM ''#3 log=State488 ModifyImage/W=VSANS_Data#det_panelsM ''#0 ctabAutoscale=0,lookup= LookupWave 489 ModifyImage/W=VSANS_Data#det_panelsM ''#1 ctabAutoscale=0,lookup= LookupWave 490 ModifyImage/W=VSANS_Data#det_panelsM ''#2 ctabAutoscale=0,lookup= LookupWave 491 ModifyImage/W=VSANS_Data#det_panelsM ''#3 ctabAutoscale=0,lookup= LookupWave 485 492 486 493 // make the plot square … … 526 533 MoveSubWindow/W=VSANS_Data#det_panelsM fnum=(320,70,430,160) 527 534 528 ModifyImage/W=VSANS_Data#det_panelsF ''#0 log=State529 ModifyImage/W=VSANS_Data#det_panelsF ''#1 log=State530 ModifyImage/W=VSANS_Data#det_panelsF ''#2 log=State531 ModifyImage/W=VSANS_Data#det_panelsF ''#3 log=State535 ModifyImage/W=VSANS_Data#det_panelsF ''#0 ctabAutoscale=0,lookup= LookupWave 536 ModifyImage/W=VSANS_Data#det_panelsF ''#1 ctabAutoscale=0,lookup= LookupWave 537 ModifyImage/W=VSANS_Data#det_panelsF ''#2 ctabAutoscale=0,lookup= LookupWave 538 ModifyImage/W=VSANS_Data#det_panelsF ''#3 ctabAutoscale=0,lookup= LookupWave 532 539 533 540 // make the plot square … … 688 695 689 696 690 // TODO -- this appears to be complete... 697 // TODO: 698 // -- come up with a better definition of the log lookup wave (> 1000 pts, what is the first point) 699 // -- make an equivalent linear wave 700 // -- hard wire it in so it is created at initialization and stored someplace safe 701 // -- catch the error if it doesn't exist (re-make the wave as needed) 702 // 703 // Using the ModifyImage log=1 keyword fails for values of zero in the data, which is a common 704 // occurrence with count data. the display just goes all gray, so that's not an option. Use the lookup wave instead 705 // 691 706 // toggle the (z) value of the display log/lin 692 707 // … … 704 719 String newStateStr,newTitleStr 705 720 721 706 722 curState = str2num(S_UserData) 707 723 … … 710 726 newStateStr="1" 711 727 newTitleStr = "isLog" 728 // lookup wave 729 Wave LookupWave = root:Packages:NIST:VSANS:Globals:logLookupWave 712 730 else 713 731 newState = 0 714 732 newStateStr="0" 715 733 newTitleStr = "isLin" 734 // lookup wave - the linear version 735 Wave LookupWave = root:Packages:NIST:VSANS:Globals:linearLookupWave 716 736 endif 717 737 … … 722 742 723 743 // on the front: 724 ModifyImage/W=VSANS_Data#det_panelsF ''#0 log=newState725 ModifyImage/W=VSANS_Data#det_panelsF ''#1 log=newState726 ModifyImage/W=VSANS_Data#det_panelsF ''#2 log=newState727 ModifyImage/W=VSANS_Data#det_panelsF ''#3 log=newState744 ModifyImage/W=VSANS_Data#det_panelsF ''#0 ctabAutoscale=0,lookup= LookupWave 745 ModifyImage/W=VSANS_Data#det_panelsF ''#1 ctabAutoscale=0,lookup= LookupWave 746 ModifyImage/W=VSANS_Data#det_panelsF ''#2 ctabAutoscale=0,lookup= LookupWave 747 ModifyImage/W=VSANS_Data#det_panelsF ''#3 ctabAutoscale=0,lookup= LookupWave 728 748 //on the middle: 729 ModifyImage/W=VSANS_Data#det_panelsM ''#0 log=newState 730 ModifyImage/W=VSANS_Data#det_panelsM ''#1 log=newState 731 ModifyImage/W=VSANS_Data#det_panelsM ''#2 log=newState 732 ModifyImage/W=VSANS_Data#det_panelsM ''#3 log=newState 749 // ModifyImage/W=VSANS_Data#det_panelsM ''#0 log=newState 750 // ModifyImage/W=VSANS_Data#det_panelsM ''#1 log=newState 751 // ModifyImage/W=VSANS_Data#det_panelsM ''#2 log=newState 752 // ModifyImage/W=VSANS_Data#det_panelsM ''#3 log=newState 753 754 ModifyImage/W=VSANS_Data#det_panelsM ''#0 ctabAutoscale=0,lookup= LookupWave 755 ModifyImage/W=VSANS_Data#det_panelsM ''#1 ctabAutoscale=0,lookup= LookupWave 756 ModifyImage/W=VSANS_Data#det_panelsM ''#2 ctabAutoscale=0,lookup= LookupWave 757 ModifyImage/W=VSANS_Data#det_panelsM ''#3 ctabAutoscale=0,lookup= LookupWave 758 759 733 760 // on the back: 734 ModifyImage/W=VSANS_Data#det_panelsB ''#0 log=newState761 ModifyImage/W=VSANS_Data#det_panelsB ''#0 ctabAutoscale=0,lookup= LookupWave 735 762 736 763 break -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Utilities_General.ipf
r981 r987 68 68 End 69 69 70 71 72 // TODO: 73 // -- this must be called as needed to force a re-read of the data from disk 74 // "as needed" means that when an operation is done that needs to ensure 75 // a fresh read from disk, it must take care of the kill. 76 // -- the ksBaseDFPath needs to be removed. It's currently pointing to RawVSANS, which is 77 // really not used as intended anymore. 78 // 79 Function V_KillNamedDataFolder(fname) 80 String fname 81 82 Variable err=0 83 84 String folderStr = V_GetFileNameFromPathNoSemi(fname) 85 folderStr = V_RemoveDotExtension(folderStr) 86 87 KillDataFolder/Z $(ksBaseDFPath+folderStr) 88 err = V_flag 89 90 return(err) 91 end 92 93 //given a filename of a SANS data filename of the form 94 // name.anything 95 //returns the name as a string without the ".fbdfasga" extension 96 // 97 // returns the input string if a "." can't be found (maybe it wasn't there) 98 Function/S V_RemoveDotExtension(item) 99 String item 100 String invalid = item // 101 Variable num=-1 102 103 //find the "dot" 104 String runStr="" 105 Variable pos = strsearch(item,".",0) 106 if(pos == -1) 107 //"dot" not found 108 return (invalid) 109 else 110 //found, get all of the characters preceeding it 111 runStr = item[0,pos-1] 112 return (runStr) 113 Endif 114 End 115 116 //returns a string containing filename (WITHOUT the ;vers) 117 //the input string is a full path to the file (Mac-style, still works on Win in IGOR) 118 //with the folders separated by colons 119 // 120 // called by MaskUtils.ipf, ProtocolAsPanel.ipf, WriteQIS.ipf 121 // 122 Function/S V_GetFileNameFromPathNoSemi(fullPath) 123 String fullPath 124 125 Variable offset1,offset2 126 String filename="" 127 //String PartialPath 128 offset1 = 0 129 do 130 offset2 = StrSearch(fullPath, ":", offset1) 131 if (offset2 == -1) // no more colons ? 132 fileName = FullPath[offset1,strlen(FullPath) ] 133 //PartialPath = FullPath[0, offset1-1] 134 break 135 endif 136 offset1 = offset2+1 137 while (1) 138 139 //remove version number from name, if it's there - format should be: filename;N 140 filename = StringFromList(0,filename,";") //returns null if error 141 142 Return filename 143 End 144 145 // 146 // -- this was copied directly, no changes , from PlotUtils_Macro_v40 147 // 148 // returns the path to the file, or null if the user cancelled 149 // fancy use of optional parameters 150 // 151 // enforce short file names (25 characters) 152 Function/S V_DoSaveFileDialog(msg,[fname,suffix]) 153 String msg,fname,suffix 154 Variable refNum 155 // String message = "Save the file as" 156 157 if(ParamIsDefault(fname)) 158 // Print "fname not supplied" 159 fname = "" 160 endif 161 if(ParamIsDefault(suffix)) 162 // Print "suffix not supplied" 163 suffix = "" 164 endif 165 166 String outputPath,tmpName,testStr 167 Variable badLength=0,maxLength=25,l1,l2 168 169 170 tmpName = fname + suffix 171 172 do 173 badLength=0 174 Open/D/M=msg/T="????" refNum as tmpName //OS will allow 255 characters, but then I can't read it back in! 175 outputPath = S_fileName 176 177 testStr = ParseFilePath(0, outputPath, ":", 1, 0) //just the filename 178 if(strlen(testStr)==0) 179 break //cancel, allow exit 180 endif 181 if(strlen(testStr) > maxLength) 182 badlength = 1 183 DoAlert 2,"File name is too long. Is\r"+testStr[0,maxLength-1]+"\rOK?" 184 if(V_flag==3) 185 outputPath = "" 186 break 187 endif 188 if(V_flag==1) //my suggested name is OK, so trim the output 189 badlength=0 190 l1 = strlen(testStr) //too long length 191 l1 = l1-maxLength //number to trim 192 //Print outputPath 193 l2=strlen(outputPath) 194 outputPath = outputPath[0,l2-1-l1] 195 //Print "modified ",outputPath 196 endif 197 //if(V_flag==2) do nothing, let it go around again 198 endif 199 200 while(badLength) 201 202 return outputPath 203 End 204 205 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_WorkFolderUtils.ipf
r984 r987 301 301 // "newType" to "type", then when Raw_to_work() gets to CopyHDFToWorkFolder(), the KillDataFolder/Z 302 302 // line fails (but reports no error), then DuplicateDataFolder fails, and reports an error. Trying 303 // to simplify this condition, I can't duplicate the errorfor WM...303 // to simplify this condition, I can't reproduce the bug for WM... 304 304 Macro Convert_to_Workfile(newtype, doadd) 305 305 String newtype,doadd
Note: See TracChangeset
for help on using the changeset viewer.