Changeset 631 for sans/Dev/trunk/NCNR_User_Procedures
- Timestamp:
- Feb 19, 2010 10:18:56 AM (13 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Common/DataSetHandling.ipf
r612 r631 605 605 // state of the checkbox 606 606 ControlInfo/W=$(win) DANoDS2_cb 607 if(V_ flag)607 if(V_Value) 608 608 DS2 = "NullSolvent" 609 609 endif … … 976 976 977 977 result_i = set1_i - (set2Scale*interp(set1_q[p],set2_q,set2_i)) 978 result_s = sqrt(set1_s^2 + set2Scale^2*interp(set1_q[p],set2_q,set2_s))978 result_s = sqrt(set1_s^2 + (set2Scale*interp(set1_q[p],set2_q,set2_s))^2 ) 979 979 //Calculate result error wave - can we produce corrected Q error? 980 980 … … 1004 1004 //Do addition of I waves - including interpolation if necessary. 1005 1005 Wave result_i = $(resultPath+resultName+"_i") 1006 Wave result_s = $(resultPath+resultName+"_s") 1006 1007 Wave set1_i = $(set1Path+set1Name+"_i") 1007 1008 Wave set1_q = $(set1Path+set1Name+"_q") 1009 Wave set1_s = $(set1Path+set1Name+"_s") 1008 1010 Wave set2_i = $(set2Path+set2Name+"_i") 1009 1011 Wave set2_q = $(set2Path+set2Name+"_q") 1012 Wave set2_s = $(set2Path+set2Name+"_s") 1013 1010 1014 result_i = set1_i + set2Scale*interp(set1_q[p],set2_q,set2_i) 1011 1012 //Calculate result error wave - can we produce corrected Q error? 1013 1015 //Calculate result error wave (note that this is identical to subtraction) 1016 result_s = sqrt(set1_s^2 + (set2Scale*interp(set1_q[p],set2_q,set2_s))^2 ) 1017 1018 // - can we produce corrected Q error? 1014 1019 //Generate history string to record what was done? 1015 1020 return 0 … … 1038 1043 //Do multiplcation of I waves - including interpolation if necessary. 1039 1044 Wave result_i = $(resultPath+resultName+"_i") 1045 Wave result_s = $(resultPath+resultName+"_s") 1040 1046 Wave set1_i = $(set1Path+set1Name+"_i") 1041 1047 Wave set1_q = $(set1Path+set1Name+"_q") 1048 Wave set1_s = $(set1Path+set1Name+"_s") 1042 1049 Wave set2_i = $(set2Path+set2Name+"_i") 1043 1050 Wave set2_q = $(set2Path+set2Name+"_q") 1051 Wave set2_s = $(set2Path+set2Name+"_s") 1052 1044 1053 result_i = set1_i*set2Scale*interp(set1_q[p],set2_q,set2_i) 1045 1046 1047 //Calculate result error wave - can we produce corrected Q error? 1054 //Calculate result error wave 1055 // sum each of the relative errors, interpolating set 2 intensity and error as needed 1056 // then sqrt 1057 result_s = (set2Scale*interp(set1_q[p],set2_q,set2_i)*set1_s)^2 1058 result_s += (set2Scale*set1_i*interp(set1_q[p],set2_q,set2_s))^2 1059 result_s = sqrt(result_s) 1060 1061 // - can we produce corrected Q error? 1048 1062 1049 1063 //Generate history string to record what was done? … … 1073 1087 //Do division of I waves - including interpolation if necessary. 1074 1088 Wave result_i = $(resultPath+resultName+"_i") 1089 Wave result_s = $(resultPath+resultName+"_s") 1075 1090 Wave set1_i = $(set1Path+set1Name+"_i") 1076 1091 Wave set1_q = $(set1Path+set1Name+"_q") 1092 Wave set1_s = $(set1Path+set1Name+"_s") 1077 1093 Wave set2_i = $(set2Path+set2Name+"_i") 1078 1094 Wave set2_q = $(set2Path+set2Name+"_q") 1095 Wave set2_s = $(set2Path+set2Name+"_s") 1096 1079 1097 result_i = set1_i/(set2Scale*interp(set1_q[p],set2_q,set2_i) ) 1080 1081 //Calculate result error wave - can we produce corrected Q error? 1098 //Calculate result error wave 1099 // sum each of the relative errors, interpolating set 2 intensity and error as needed 1100 // then sqrt 1101 result_s = (set1_s/set2Scale/interp(set1_q[p],set2_q,set2_i))^2 1102 result_s += (interp(set1_q[p],set2_q,set2_s)*set1_i/set2Scale/interp(set1_q[p],set2_q,set2_i)^2)^2 1103 result_s = sqrt(result_s) 1104 1105 // - can we produce corrected Q error? 1082 1106 1083 1107 //Generate history string to record what was done? -
sans/Dev/trunk/NCNR_User_Procedures/Common/Installer/FilesToRemove++.itx
r413 r631 9 9 X SetScale/P x 0,1,"", IExtFolders; SetScale y 0,0,"", IExtFolders 10 10 11 WAVES/T IExtFiles IHFolders11 WAVES/T IExtFiles 12 12 BEGIN 13 "SANS_Analysis.xop" "Put in Igor Help Files" 14 "NCNR_Extensions" "NCNR_Help_Files" 13 "SANS_Analysis.xop" 14 "NCNR_Extensions" 15 "XMLutils.xop" 16 "MonteCarlo.xop" 15 17 END 16 18 X SetScale/P x 0,1,"", IExtFiles; SetScale y 0,0,"", IExtFiles 19 20 WAVES/T IHFolders 21 BEGIN 22 "Put in Igor Help Files" 23 "NCNR_Help_Files" 24 END 17 25 X SetScale/P x 0,1,"", IHFolders; SetScale y 0,0,"", IHFolders 18 26 … … 30 38 "SANS_Analysis_Docs_09JUN06.ihf" 31 39 "SANS_Model_Docs_09JUN06.ihf" 40 "BetaSANSRednTools_APR08.ihf" 41 "SANS_Analysis_Docs_v4.00.ihf" 42 "SANS_Model_Docs_v4.00.ihf" 43 "SANS_Reduction_Help_v5.10.ihf" 44 "USANSReductionHelp_v2.21.ihf" 32 45 "Put in Igor Help Files" 33 46 "NCNR_Help_Files" -
sans/Dev/trunk/NCNR_User_Procedures/Common/Installer/NCNR_Install.ipf
r570 r631 22 22 // package-6.001 23 23 // - lots more diagnostics added 24 25 // FEB 2010 - now make use of the user-specific procedure path. It's always writeable, and not in the application folder 26 // -- now I need to search both locations to move old stuff out 27 // -- then install clean into the new user path (userPathStr) 28 // 24 29 25 30 Function InstallNCNRMacros(forceInstall) … … 74 79 75 80 76 String igorPathStr,homePathStr 81 String igorPathStr,homePathStr,userPathStr 77 82 PathInfo Igor 78 83 igorPathStr = S_Path //these have trailing colons 79 84 PathInfo home //the location where this was run from... 80 85 homePathStr = S_Path 86 // the Igor 6.1 User Procedure Path, same sub-folders as in Igor App Folder 87 userPathStr=RemoveEnding(SpecialDirPath("Igor Pro User Files",0,0,0),":")+":" 81 88 82 89 // clean up old stuff, moving to home:old_moved_files … … 86 93 variable i=0, AliasSet=0, isThere = 0 87 94 String tmpStr 88 89 // clean up the Igor Extensions 95 96 97 ////////////////////////////////////////////////////////////////////// 98 99 ////// clean up the Igor Extensions (first the old path -- in the App folder) 90 100 NewPath /Q/O ExPath, igorPathStr+"Igor Extensions:" 91 101 PathInfo ExPath … … 93 103 string strFileList = IndexedFile(ExPath, -1, "????" ) 94 104 105 //files first 95 106 Wave/T extFiles=root:IExtFiles 96 97 107 for (i=0; i<itemsInList(strFileList); i+=1) 98 108 tmpStr = StringFromList(i,strFileList) … … 107 117 Wave/T extFolders=root:IExtFolders 108 118 strFileList = IndexedDir(ExPath, -1, 0 ) 119 109 120 for (i=0; i<itemsInList(strFileList); i+=1) 110 121 tmpStr = StringFromList(i,strFileList) … … 115 126 endif 116 127 endfor 117 118 // clean up the user procedures (files first) 128 129 ////// then clean up the Igor Extensions (now look in the User Path, by changing the definition of ExPath) 130 NewPath /Q/O ExPath, userPathStr+"Igor Extensions:" 131 PathInfo ExPath 132 extPathStr = S_Path 133 strFileList = IndexedFile(ExPath, -1, "????" ) 134 135 for (i=0; i<itemsInList(strFileList); i+=1) 136 tmpStr = StringFromList(i,strFileList) 137 isThere = CheckForMatch(tmpStr,extFiles) 138 if(isThere) 139 MoveFile/O/P=ExPath tmpStr as homePathStr+"NCNR_Moved_Files:"+tmpStr 140 Print "Move file "+ tmpStr + " from Igor Extensions: "+num2str(V_flag) 141 endif 142 endfor 143 144 //then anything that shows up as a folder 145 strFileList = IndexedDir(ExPath, -1, 0 ) 146 for (i=0; i<itemsInList(strFileList); i+=1) 147 tmpStr = StringFromList(i,strFileList) 148 isThere = CheckForMatch(tmpStr,extFolders) 149 if(isThere) 150 MoveFolder extPathStr+tmpStr as homePathStr+"NCNR_Moved_Files:NCNR_Moved_Folders:"+tmpStr 151 Print "Move folder "+ tmpStr + " from Igor Extensions: "+num2str(V_flag) 152 endif 153 endfor 154 155 ////////////////////////////////////////////////////////////////////// 156 157 /////// clean up the User Procedures -- in the APP folder 119 158 NewPath /Q/O UPPath, igorPathStr+"User Procedures:" 120 159 PathInfo UPPath … … 122 161 strFileList = IndexedFile(UPPath, -1, "????" ) //for files 123 162 163 // (files first) 124 164 Wave/T UPFilesWave=root:UPFiles 125 126 165 for (i=0; i<itemsInList(strFileList); i+=1) 127 166 tmpStr = StringFromList(i,strFileList) … … 133 172 endfor 134 173 135 // clean up the user procedures(folders second)174 //(folders second) 136 175 strFileList = IndexedDir(UPPath, -1, 0) //for folders, just the names, not full paths 137 138 176 Wave/T UPFoldersWave=root:UPFolders 139 177 … … 148 186 endfor 149 187 150 // now try to move the Igor Help files out 188 /////// now clean up the User Procedures -- in the User Folder 189 NewPath /Q/O UPPath, userPathStr+"User Procedures:" 190 PathInfo UPPath 191 UPPathStr = S_Path 192 strFileList = IndexedFile(UPPath, -1, "????" ) //for files 193 194 // (files first) 195 for (i=0; i<itemsInList(strFileList); i+=1) 196 tmpStr = StringFromList(i,strFileList) 197 isThere = CheckForMatch(tmpStr,UPFilesWave) 198 if(isThere) 199 MoveFile/O/P=UPPath tmpStr as homePathStr+"NCNR_Moved_Files:"+tmpStr 200 Print "Move file "+ tmpStr + " from User Procedures: "+num2str(V_flag) 201 endif 202 endfor 203 204 //(folders second) 205 strFileList = IndexedDir(UPPath, -1, 0) //for folders, just the names, not full paths 206 207 for (i=0; i<itemsInList(strFileList); i+=1) 208 tmpStr = StringFromList(i,strFileList) 209 isThere = CheckForMatch(tmpStr,UPFoldersWave) 210 if(isThere) 211 // THIS is the problem, when NCNR_Help_Files is moved - it is in use 212 MoveFolder/Z UPPathStr + tmpStr as homePathStr+"NCNR_Moved_Files:NCNR_Moved_Folders:"+tmpStr 213 Print "Move folder "+ tmpStr + " from User Procedures: "+num2str(V_flag) 214 endif 215 endfor 216 217 218 ////////////////////////////////////////////////////////////////////// 219 220 221 222 /////// now try to clean up the Igor Help Files (in the APP folder) 151 223 NewPath /Q/O IHPath, igorPathStr+"Igor Help Files:" 152 224 PathInfo IHPath … … 154 226 strFileList = IndexedFile(IHPath, -1, "????" ) //for files 155 227 228 // files first 156 229 Wave/T IHFilesWave=root:IHFiles 157 230 … … 168 241 Wave/T IHFilesWave=root:IHFolders 169 242 strFileList = IndexedDir(IHPath, -1, 0) 243 170 244 for (i=0; i<itemsInList(strFileList); i+=1) 171 245 tmpStr = StringFromList(i,strFileList) … … 177 251 endfor 178 252 179 // INSTALL the new stuff 180 //(1) copy the items to install to the User Procedures folder 181 //(2) set up the aliases from there 253 /////// now try the Igor Help Files (in the USER folder) 254 NewPath /Q/O IHPath, userPathStr+"Igor Help Files:" 255 PathInfo IHPath 256 IHPathStr = S_Path 257 strFileList = IndexedFile(IHPath, -1, "????" ) //for files 258 259 // files first 260 for (i=0; i<itemsInList(strFileList); i+=1) 261 tmpStr = StringFromList(i,strFileList) 262 isThere = CheckForMatch(tmpStr,IHFilesWave) 263 if(isThere) 264 MoveFile/O/P=IHPath tmpStr as homePathStr+"NCNR_Moved_Files:"+tmpStr 265 Print "Move file "+ tmpStr + " from Igor Help Files: "+num2str(V_flag) 266 endif 267 endfor 268 269 // then anything that shows up as a folder 270 strFileList = IndexedDir(IHPath, -1, 0) 271 272 for (i=0; i<itemsInList(strFileList); i+=1) 273 tmpStr = StringFromList(i,strFileList) 274 isThere = CheckForMatch(tmpStr,IHFolders) 275 if(isThere) 276 MoveFolder IHPathStr + tmpStr as homePathStr+"NCNR_Moved_Files:NCNR_Moved_Folders:"+tmpStr 277 Print "Move folder "+ tmpStr + " from Igor Help Files: "+num2str(V_flag) 278 endif 279 endfor 280 281 282 283 // at this point all of the old stuff is cleaned up as best as I can 284 // 285 // at this point the paths point to the User Folder, not in the App folder 286 287 288 289 290 //////////// INSTALL the new stuff 291 // 292 //(1) copy the items to install to the User Special Folder 293 //(2) --- now I don't need to set up aliases! they are just there 182 294 // 183 295 // the old ones should be gone already, so just put in the new ones … … 185 297 // they may not be possible to remove, so try to overwrite... 186 298 187 // and then create shortcuts for XOP and help files 188 // MoveFolder/Z=1/O homePathStr+"NCNR_Help_Files" as UPPathStr+"NCNR_Help_Files" 189 // Print "Move folder NCNR_Help_Files into User Procedures, overwrite if needed: "+num2str(V_flag) 190 // if(V_Flag != 0) 191 MoveFolder/Z=1 homePathStr+"NCNR_Help_Files" as UPPathStr+"NCNR_Help_Files" 192 Print "******Move folder NCNR_Help_Files into User Procedures, NO overwite: "+num2str(V_flag) 299 NewPath /Q/O SpecialPath, userPathStr 300 301 // the help files 302 MoveFolder/Z=1 homePathStr+"NCNR_Help_Files" as IHPathStr+"NCNR_Help_Files" 303 Print "******Move folder NCNR_Help_Files into User Special Folder, NO overwite: "+num2str(V_flag) 304 305 // not needed now 306 // CreateAliasShortcut/O/P=SpecialPath "NCNR_Help_Files" as igorPathStr+"Igor Help Files:NCNR_Help_Files" 307 // Print "Creating shortcut from NCNR_Help_Files into Igor Help Files: "+num2str(V_flag) 308 309 310 // the User Procedures 311 MoveFolder/Z=1 homePathStr+"NCNR_User_Procedures" as UPPathStr+"NCNR_User_Procedures" 312 Print "*******Move folder NCNR_User_Procedures into User Procedures, NO overwrite: "+num2str(V_flag) 313 314 // don't need an alias for the UserProcedures - they're already here.... 315 316 317 // Igor Extensions 318 MoveFolder/Z=1 homePathStr+"NCNR_Extensions" as UPPathStr+"NCNR_Extensions" 319 Print "*******Move folder NCNR_Extensions into User Procedures, NO overwrite: "+num2str(V_flag) 320 // 321 // not needed now 322 // if(isMac) 323 // CreateAliasShortcut/O/P=UPPath "NCNR_Extensions:Mac_XOP" as igorPathStr+"Igor Extensions:NCNR_Extensions" 324 // else 325 // CreateAliasShortcut/O/P=UPPath "NCNR_Extensions:Win_XOP" as igorPathStr+"Igor Extensions:NCNR_Extensions" 193 326 // endif 194 CreateAliasShortcut/O/P=UPPath "NCNR_Help_Files" as igorPathStr+"Igor Help Files:NCNR_Help_Files" 195 Print "Creating shortcut from NCNR_Help_Files into Igor Help Files: "+num2str(V_flag) 196 197 198 // MoveFolder/Z=1/O homePathStr+"NCNR_User_Procedures" as UPPathStr+"NCNR_User_Procedures" 199 // Print "Move folder NCNR_User_Procedures into User Procedures, overwrite if needed: "+num2str(V_flag) 200 // if(V_flag !=0) 201 MoveFolder/Z=1 homePathStr+"NCNR_User_Procedures" as UPPathStr+"NCNR_User_Procedures" 202 Print "*******Move folder NCNR_User_Procedures into User Procedures, NO overwrite: "+num2str(V_flag) 203 // endif 204 // don't need an alias for the UserProcedures - they're already here.... 205 206 207 // MoveFolder/Z=1/O homePathStr+"NCNR_Extensions" as UPPathStr+"NCNR_Extensions" 208 // Print "Move folder NCNR_Extensions into User Procedures, overwrite if needed: "+num2str(V_flag) 209 // if(V_flag !=0) 210 MoveFolder/Z=1 homePathStr+"NCNR_Extensions" as UPPathStr+"NCNR_Extensions" 211 Print "*******Move folder NCNR_Extensions into User Procedures, NO overwrite: "+num2str(V_flag) 212 // endif 213 if(isMac) 214 CreateAliasShortcut/O/P=UPPath "NCNR_Extensions:Mac_XOP" as igorPathStr+"Igor Extensions:NCNR_Extensions" 215 else 216 CreateAliasShortcut/O/P=UPPath "NCNR_Extensions:Win_XOP" as igorPathStr+"Igor Extensions:NCNR_Extensions" 217 endif 218 Print "Creating shortcut for XOP into Igor Extensions: "+num2str(V_flag) 327 // Print "Creating shortcut for XOP into Igor Extensions: "+num2str(V_flag) 219 328 220 329 221 330 // put shortcuts to the template in the "top" folder 222 // ??331 // 223 332 NewPath/O/Q UtilPath, homePathStr+"NCNR_SANS_Utilities:" 224 333 strFileList = IndexedFile(UtilPath,-1,".pxt") … … 233 342 // endif 234 343 endfor 235 236 // old method, used shortcuts from main package (risky if user deletes them) 237 // CreateAliasShortcut/O/P=home "NCNR_Help_Files" as igorPathStr+"Igor Help Files:NCNR_Help_Files" 238 // CreateAliasShortcut/O/P=home "NCNR_User_Procedures" as igorPathStr+"User Procedures:NCNR_User_Procedures" 239 // if(isMac) 240 // CreateAliasShortcut/O/P=home "NCNR_Extensions:Mac XOP" as igorPathStr+"Igor Extensions:NCNR_Extensions" 241 // else 242 // CreateAliasShortcut/O/P=home "NCNR_Extensions:Win XOP" as igorPathStr+"Igor Extensions:NCNR_Extensions" 243 // endif 244 344 245 345 246 346 // installation is done, quit to start fresh
Note: See TracChangeset
for help on using the changeset viewer.