- Timestamp:
- Feb 17, 2012 12:04:13 PM (11 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/Pol_FlipperPanel.ipf
r835 r836 605 605 end 606 606 607 608 607 // 608 // calculate the (atomic) He polarization at some delta time 609 // 610 // t2 is in hours, gamma in hours 611 // 612 Function Calc_PHe_atT(Po,err_Po,gam,err_gam,t2,err_Pt) 613 Variable Po,err_Po,gam,err_gam,t2,&err_Pt 614 615 616 Variable Pt 617 618 Pt = Po*exp(-t2/gam) 619 620 Variable arg,tmp2 621 // 2 terms, no error in t2 622 err_Pt = Pt^2/Po^2*err_Po^2 + t2^2/gam^4*Pt^2*err_gam^2 623 624 err_Pt = sqrt(err_Pt) 625 626 Printf "At (delta)t=%g P_He(t) = %g +/- %g (%g%)\r",t2,Pt,err_Pt,err_Pt/Pt*100 627 628 return(Pt) 629 End 630 631 632 633 // 609 634 // t2 is in hours, muP0 is at t0 610 635 // … … 615 640 Variable Pcell 616 641 617 618 642 PCell = tanh(muPo * exp(-t2/gam)) 643 // PCell = (muPo * exp(-t2/gam)) 619 644 620 645 Variable arg,tmp2 … … 627 652 628 653 Printf "At t=%g Pcell = %g +/- %g (%g%)\r",t2,Pcell,err_Pcell,err_Pcell/PCell*100 629 630 631 654 632 655 return(PCell) … … 762 785 case 2: // mouse up 763 786 // click code here 764 DoAlert 0,"Help for Flipper Panel not written yet" 787 DisplayHelpTopic/Z/K=1 "Flipper States Panel" 788 if(V_flag !=0) 789 DoAlert 0,"The Flipper States Panel Help file could not be found" 790 endif 765 791 break 766 792 case -1: // control being killed -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/Pol_PolarizationCorrection.ipf
r835 r836 775 775 case 2: // mouse up 776 776 // click code here 777 DoAlert 0,"Help for PolCor Panel not written yet" 777 DisplayHelpTopic/Z/K=1 "Polarization Correction Panel" 778 if(V_flag !=0) 779 DoAlert 0,"The Polarization Correction Panel Help file could not be found" 780 endif 778 781 break 779 782 case -1: // control being killed … … 1017 1020 Variable row,Psm, PsmPf, PCell,err_Psm, err_PsmPf, err_PCell 1018 1021 Variable ii,jj,muPo,err_muPo,gam,err_gam,monCts,t1,num,fileCount 1022 Variable Po,err_Po,Pt,err_Pt,Tmaj,Tmin,err_Tmaj,err_Tmin,Te,err_Te,mu,err_mu,summedMonCts 1019 1023 1020 1024 Variable ea_uu, ea_ud, ea_dd, ea_du … … 1056 1060 err_PsmPf = NumberByKey("err_P_sm_f", condNote, "=", ",", 0) 1057 1061 1062 // 1063 // 1064 // find the proper propotions to add the matrix contributions 1065 // if only one file, this = 1, otherwise it should sum to one 1066 // 1067 Make/O/D/N=10 proportion 1068 proportion = 0 1069 summedMonCts = 0 1070 // loop over the (10) rows in the listWave 1071 for(ii=0;ii<num;ii+=1) 1072 runStr = lb[ii][0] //the run number 1073 if(cmpstr(runStr, "" ) != 0) 1074 fname = FindFileFromRunNumber(str2num(runStr)) 1075 proportion[ii] = getMonitorCount(fname) 1076 summedMonCts += proportion[ii] 1077 endif 1078 endfor 1079 proportion /= summedMonCts 1058 1080 1059 1081 // loop over the (10) rows in the listWave … … 1080 1102 gam = NumberByKey("gamma", decayNote, "=", ",", 0) 1081 1103 err_gam = NumberByKey("err_gamma", decayNote, "=", ",", 0) 1104 Po = NumberByKey("P0", decayNote, "=", ",", 0) 1105 err_Po = NumberByKey("err_P0", decayNote, "=", ",", 0) 1082 1106 // get the elapsed time to calculate PCell at the current file time 1083 1107 t1str = getFileCreationDate(fname) … … 1086 1110 PCell = Calc_PCell_atT(muPo,err_muPo,gam,err_gam,t1,err_PCell) 1087 1111 1112 1113 1114 SVAR cellParamStr = $("root:Packages:NIST:Polarization:Cells:gCell_"+cellStr) 1115 1116 Pt = Calc_PHe_atT(Po,err_Po,gam,err_gam,t1,err_Pt) 1117 1118 Tmaj = Calc_Tmaj(cellParamStr,Pt,err_Pt,err_Tmaj) 1119 Tmin = Calc_Tmin(cellParamStr,Pt,err_Pt,err_Tmin) 1120 1121 // printf "File: %s\r",fname 1122 // printf "Elapsed time = %g hours\r",t1 1123 // printf "Pcell = %g\tTMaj = %g\tTmin = %g\r",PCell,(1+PCell)/2,(1-Pcell)/2 1124 // printf "\t\tRecalculated TMaj = %g\tTmin = %g\r",Tmaj,Tmin 1125 1088 1126 // get file info (monitor counts) 1089 monCts = getMonitorCount(fname) 1090 monCts /= 1e8 //to get a normalized value to add proportionally 1127 // monCts = getMonitorCount(fname) 1128 // monCts /= 1e8 //to get a normalized value to add proportionally 1129 1130 // use the proper proportion of each file to add to each row 1131 // monCts = proportion[ii] 1091 1132 1092 1133 Variable err_monCts … … 1101 1142 matA_err[row][] = 0 1102 1143 endif 1103 ea_uu = (1+Psm)/2 1104 ea_du = (1-Psm)/2 1105 ec_uu = (1+Pcell)/2 1106 ec_du = (1-Pcell)/2 1107 1108 matA[row][0] += ea_uu*ec_uu*monCts 1109 matA[row][1] += ea_du*ec_uu*monCts 1110 matA[row][2] += ea_du*ec_du*monCts 1111 matA[row][3] += ea_uu*ec_du*monCts 1144 // original version 1145 // ea_uu = (1+Psm)/2 1146 // ea_du = (1-Psm)/2 1147 // ec_uu = (1+Pcell)/2 1148 // ec_du = (1-Pcell)/2 1149 // 1150 // matA[row][0] += ea_uu*ec_uu*monCts 1151 // matA[row][1] += ea_du*ec_uu*monCts 1152 // matA[row][2] += ea_du*ec_du*monCts 1153 // matA[row][3] += ea_uu*ec_du*monCts 1154 // 1155 // matA_err[row][0] += (ea_uu*ec_uu*monCts)^2 * (err_Psm^2/Psm^2 + err_Pcell^2/Pcell^2) 1156 // matA_err[row][1] += (ea_du*ec_uu*monCts)^2 * (err_Psm^2/Psm^2 + err_Pcell^2/Pcell^2) 1157 // matA_err[row][2] += (ea_du*ec_du*monCts)^2 * (err_Psm^2/Psm^2 + err_Pcell^2/Pcell^2) 1158 // matA_err[row][3] += (ea_uu*ec_du*monCts)^2 * (err_Psm^2/Psm^2 + err_Pcell^2/Pcell^2) 1159 // end original version 1160 1161 // using Tmaj, Tmin calc from Po, not Pcell 1162 matA[row][0] += (1+Psm)*Tmaj*proportion[ii] 1163 matA[row][1] += (1-Psm)*Tmaj*proportion[ii] 1164 matA[row][2] += (1-Psm)*Tmin*proportion[ii] 1165 matA[row][3] += (1+Psm)*Tmin*proportion[ii] 1112 1166 1113 1167 // this seems to be too large... 1114 // matA_err[row][0] += (1/2*ec_uu*monCts)^2*err_Psm^2 + (1/2*ea_uu*monCts)^2*err_Pcell^2 1115 // matA_err[row][1] += (1/2*ec_uu*monCts)^2*err_Psm^2 + (1/2*ea_du*monCts)^2*err_Pcell^2 1116 // matA_err[row][2] += (1/2*ec_du*monCts)^2*err_Psm^2 + (1/2*ea_du*monCts)^2*err_Pcell^2 1117 // matA_err[row][3] += (1/2*ec_du*monCts)^2*err_Psm^2 + (1/2*ea_uu*monCts)^2*err_Pcell^2 1118 1119 matA_err[row][0] += (ea_uu*ec_uu*monCts)^2 * (err_Psm^2/Psm^2 + err_Pcell^2/Pcell^2) 1120 matA_err[row][1] += (ea_du*ec_uu*monCts)^2 * (err_Psm^2/Psm^2 + err_Pcell^2/Pcell^2) 1121 matA_err[row][2] += (ea_du*ec_du*monCts)^2 * (err_Psm^2/Psm^2 + err_Pcell^2/Pcell^2) 1122 matA_err[row][3] += (ea_uu*ec_du*monCts)^2 * (err_Psm^2/Psm^2 + err_Pcell^2/Pcell^2) 1123 1168 matA_err[row][0] += (Tmaj)^2*err_Psm^2 + (1+Psm)^2*err_Tmaj^2 1169 matA_err[row][1] += (Tmaj)^2*err_Psm^2 + (1-Psm)^2*err_Tmaj^2 1170 matA_err[row][2] += (Tmin)^2*err_Psm^2 + (1-Psm)^2*err_Tmin^2 1171 matA_err[row][3] += (Tmin)^2*err_Psm^2 + (1+Psm)^2*err_Tmin^2 1172 1124 1173 break 1125 1174 case "DU": … … 1129 1178 matA_err[row][] = 0 1130 1179 endif 1131 ea_ud = (1-PsmPf)/2 1132 ea_dd = (1+PsmPf)/2 1133 ec_uu = (1+Pcell)/2 1134 ec_du = (1-Pcell)/2 1135 1136 matA[row][0] += ea_ud*ec_uu*monCts 1137 matA[row][1] += ea_dd*ec_uu*monCts 1138 matA[row][2] += ea_dd*ec_du*monCts 1139 matA[row][3] += ea_ud*ec_du*monCts 1140 1141 // matA_err[row][0] += (1/2*(1+Pcell)/2*monCts)^2*err_PsmPf^2 + (1/2*(1-PsmPf)/2*monCts)^2*err_Pcell^2 1142 // matA_err[row][1] += (1/2*(1+Pcell)/2*monCts)^2*err_PsmPf^2 + (1/2*(1+PsmPf)/2*monCts)^2*err_Pcell^2 1143 // matA_err[row][2] += (1/2*(1-Pcell)/2*monCts)^2*err_PsmPf^2 + (1/2*(1+PsmPf)/2*monCts)^2*err_Pcell^2 1144 // matA_err[row][3] += (1/2*(1-Pcell)/2*monCts)^2*err_PsmPf^2 + (1/2*(1-PsmPf)/2*monCts)^2*err_Pcell^2 1145 1146 matA_err[row][0] += (ea_ud*ec_uu*monCts)^2 * (err_PsmPf^2/PsmPf^2 + err_Pcell^2/Pcell^2) 1147 matA_err[row][1] += (ea_dd*ec_uu*monCts)^2 * (err_PsmPf^2/PsmPf^2 + err_Pcell^2/Pcell^2) 1148 matA_err[row][2] += (ea_dd*ec_du*monCts)^2 * (err_PsmPf^2/PsmPf^2 + err_Pcell^2/Pcell^2) 1149 matA_err[row][3] += (ea_ud*ec_du*monCts)^2 * (err_PsmPf^2/PsmPf^2 + err_Pcell^2/Pcell^2) 1150 1180 // original version 1181 // ea_ud = (1-PsmPf)/2 1182 // ea_dd = (1+PsmPf)/2 1183 // ec_uu = (1+Pcell)/2 1184 // ec_du = (1-Pcell)/2 1185 // 1186 // matA[row][0] += ea_ud*ec_uu*monCts 1187 // matA[row][1] += ea_dd*ec_uu*monCts 1188 // matA[row][2] += ea_dd*ec_du*monCts 1189 // matA[row][3] += ea_ud*ec_du*monCts 1190 // 1191 // matA_err[row][0] += (ea_ud*ec_uu*monCts)^2 * (err_PsmPf^2/PsmPf^2 + err_Pcell^2/Pcell^2) 1192 // matA_err[row][1] += (ea_dd*ec_uu*monCts)^2 * (err_PsmPf^2/PsmPf^2 + err_Pcell^2/Pcell^2) 1193 // matA_err[row][2] += (ea_dd*ec_du*monCts)^2 * (err_PsmPf^2/PsmPf^2 + err_Pcell^2/Pcell^2) 1194 // matA_err[row][3] += (ea_ud*ec_du*monCts)^2 * (err_PsmPf^2/PsmPf^2 + err_Pcell^2/Pcell^2) 1195 // original version 1196 1197 // using Tmaj, Tmin calc from Po, not Pcell 1198 matA[row][0] += (1-PsmPf)*Tmaj*proportion[ii] 1199 matA[row][1] += (1+PsmPf)*Tmaj*proportion[ii] 1200 matA[row][2] += (1+PsmPf)*Tmin*proportion[ii] 1201 matA[row][3] += (1-PsmPf)*Tmin*proportion[ii] 1202 1203 // this seems to be too large... 1204 matA_err[row][0] += (Tmaj)^2*err_PsmPf^2 + (1-PsmPf)^2*err_Tmaj^2 1205 matA_err[row][1] += (Tmaj)^2*err_PsmPf^2 + (1+PsmPf)^2*err_Tmaj^2 1206 matA_err[row][2] += (Tmin)^2*err_PsmPf^2 + (1+PsmPf)^2*err_Tmin^2 1207 matA_err[row][3] += (Tmin)^2*err_PsmPf^2 + (1-PsmPf)^2*err_Tmin^2 1208 1209 1151 1210 break 1152 1211 case "DD": … … 1156 1215 matA_err[row][] = 0 1157 1216 endif 1158 ea_ud = (1-PsmPf)/2 1159 ea_dd = (1+PsmPf)/2 1160 ec_ud = (1-Pcell)/2 1161 ec_dd = (1+Pcell)/2 1162 1163 matA[row][0] += ea_ud*ec_ud*monCts 1164 matA[row][1] += ea_dd*ec_ud*monCts 1165 matA[row][2] += ea_dd*ec_dd*monCts 1166 matA[row][3] += ea_ud*ec_dd*monCts 1167 1168 // matA_err[row][0] += (1/2*(1-Pcell)/2*monCts)^2*err_PsmPf^2 + (1/2*(1-PsmPf)/2*monCts)^2*err_Pcell^2 1169 // matA_err[row][1] += (1/2*(1-Pcell)/2*monCts)^2*err_PsmPf^2 + (1/2*(1+PsmPf)/2*monCts)^2*err_Pcell^2 1170 // matA_err[row][2] += (1/2*(1+Pcell)/2*monCts)^2*err_PsmPf^2 + (1/2*(1+PsmPf)/2*monCts)^2*err_Pcell^2 1171 // matA_err[row][3] += (1/2*(1+Pcell)/2*monCts)^2*err_PsmPf^2 + (1/2*(1-PsmPf)/2*monCts)^2*err_Pcell^2 1172 1173 matA_err[row][0] += (ea_ud*ec_ud*monCts)^2 * (err_PsmPf^2/PsmPf^2 + err_Pcell^2/Pcell^2) 1174 matA_err[row][1] += (ea_dd*ec_ud*monCts)^2 * (err_PsmPf^2/PsmPf^2 + err_Pcell^2/Pcell^2) 1175 matA_err[row][2] += (ea_dd*ec_dd*monCts)^2 * (err_PsmPf^2/PsmPf^2 + err_Pcell^2/Pcell^2) 1176 matA_err[row][3] += (ea_ud*ec_dd*monCts)^2 * (err_PsmPf^2/PsmPf^2 + err_Pcell^2/Pcell^2) 1217 // original version 1218 // ea_ud = (1-PsmPf)/2 1219 // ea_dd = (1+PsmPf)/2 1220 // ec_ud = (1-Pcell)/2 1221 // ec_dd = (1+Pcell)/2 1222 // 1223 // matA[row][0] += ea_ud*ec_ud*monCts 1224 // matA[row][1] += ea_dd*ec_ud*monCts 1225 // matA[row][2] += ea_dd*ec_dd*monCts 1226 // matA[row][3] += ea_ud*ec_dd*monCts 1227 // 1228 // matA_err[row][0] += (ea_ud*ec_ud*monCts)^2 * (err_PsmPf^2/PsmPf^2 + err_Pcell^2/Pcell^2) 1229 // matA_err[row][1] += (ea_dd*ec_ud*monCts)^2 * (err_PsmPf^2/PsmPf^2 + err_Pcell^2/Pcell^2) 1230 // matA_err[row][2] += (ea_dd*ec_dd*monCts)^2 * (err_PsmPf^2/PsmPf^2 + err_Pcell^2/Pcell^2) 1231 // matA_err[row][3] += (ea_ud*ec_dd*monCts)^2 * (err_PsmPf^2/PsmPf^2 + err_Pcell^2/Pcell^2) 1232 // original version 1233 1234 // using Tmaj, Tmin calc from Po, not Pcell 1235 matA[row][0] += (1-PsmPf)*Tmin*proportion[ii] 1236 matA[row][1] += (1+PsmPf)*Tmin*proportion[ii] 1237 matA[row][2] += (1+PsmPf)*Tmaj*proportion[ii] 1238 matA[row][3] += (1-PsmPf)*Tmaj*proportion[ii] 1239 1240 // this seems to be too large... 1241 matA_err[row][0] += (Tmin)^2*err_PsmPf^2 + (1-PsmPf)^2*err_Tmin^2 1242 matA_err[row][1] += (Tmin)^2*err_PsmPf^2 + (1+PsmPf)^2*err_Tmin^2 1243 matA_err[row][2] += (Tmaj)^2*err_PsmPf^2 + (1+PsmPf)^2*err_Tmaj^2 1244 matA_err[row][3] += (Tmaj)^2*err_PsmPf^2 + (1-PsmPf)^2*err_Tmaj^2 1177 1245 1178 1246 break … … 1183 1251 matA_err[row][] = 0 1184 1252 endif 1185 ea_uu = (1+Psm)/2 1186 ea_du = (1-Psm)/2 1187 ec_ud = (1-Pcell)/2 1188 ec_dd = (1+Pcell)/2 1253 // original version 1254 // ea_uu = (1+Psm)/2 1255 // ea_du = (1-Psm)/2 1256 // ec_ud = (1-Pcell)/2 1257 // ec_dd = (1+Pcell)/2 1258 // 1259 // matA[row][0] += ea_uu*ec_ud*monCts 1260 // matA[row][1] += ea_du*ec_ud*monCts 1261 // matA[row][2] += ea_du*ec_dd*monCts 1262 // matA[row][3] += ea_uu*ec_dd*monCts 1263 // 1264 // matA_err[row][0] += (ea_uu*ec_ud*monCts)^2 * (err_Psm^2/Psm^2 + err_Pcell^2/Pcell^2) 1265 // matA_err[row][1] += (ea_du*ec_ud*monCts)^2 * (err_Psm^2/Psm^2 + err_Pcell^2/Pcell^2) 1266 // matA_err[row][2] += (ea_du*ec_dd*monCts)^2 * (err_Psm^2/Psm^2 + err_Pcell^2/Pcell^2) 1267 // matA_err[row][3] += (ea_uu*ec_dd*monCts)^2 * (err_Psm^2/Psm^2 + err_Pcell^2/Pcell^2) 1268 // original version 1269 1270 // using Tmaj, Tmin calc from Po, not Pcell 1271 matA[row][0] += (1+Psm)*Tmin*proportion[ii] 1272 matA[row][1] += (1-Psm)*Tmin*proportion[ii] 1273 matA[row][2] += (1-Psm)*Tmaj*proportion[ii] 1274 matA[row][3] += (1+Psm)*Tmaj*proportion[ii] 1275 1276 // this seems to be too large... 1277 matA_err[row][0] += (Tmin)^2*err_Psm^2 + (1+Psm)^2*err_Tmin^2 1278 matA_err[row][1] += (Tmin)^2*err_Psm^2 + (1-Psm)^2*err_Tmin^2 1279 matA_err[row][2] += (Tmaj)^2*err_Psm^2 + (1-Psm)^2*err_Tmaj^2 1280 matA_err[row][3] += (Tmaj)^2*err_Psm^2 + (1+Psm)^2*err_Tmaj^2 1189 1281 1190 matA[row][0] += ea_uu*ec_ud*monCts 1191 matA[row][1] += ea_du*ec_ud*monCts 1192 matA[row][2] += ea_du*ec_dd*monCts 1193 matA[row][3] += ea_uu*ec_dd*monCts 1194 1195 // matA_err[row][0] += (1/2*(1-Pcell)/2*monCts)^2*err_Psm^2 + (1/2*(1+Psm)/2*monCts)^2*err_Pcell^2 1196 // matA_err[row][1] += (1/2*(1-Pcell)/2*monCts)^2*err_Psm^2 + (1/2*(1-Psm)/2*monCts)^2*err_Pcell^2 1197 // matA_err[row][2] += (1/2*(1+Pcell)/2*monCts)^2*err_Psm^2 + (1/2*(1-Psm)/2*monCts)^2*err_Pcell^2 1198 // matA_err[row][3] += (1/2*(1+Pcell)/2*monCts)^2*err_Psm^2 + (1/2*(1+Psm)/2*monCts)^2*err_Pcell^2 1199 1200 matA_err[row][0] += (ea_uu*ec_ud*monCts)^2 * (err_Psm^2/Psm^2 + err_Pcell^2/Pcell^2) 1201 matA_err[row][1] += (ea_du*ec_ud*monCts)^2 * (err_Psm^2/Psm^2 + err_Pcell^2/Pcell^2) 1202 matA_err[row][2] += (ea_du*ec_dd*monCts)^2 * (err_Psm^2/Psm^2 + err_Pcell^2/Pcell^2) 1203 matA_err[row][3] += (ea_uu*ec_dd*monCts)^2 * (err_Psm^2/Psm^2 + err_Pcell^2/Pcell^2) 1204 1282 1205 1283 break 1206 1284 endswitch … … 1216 1294 // to switch based on pType... 1217 1295 1218 matA[row][0] /= fileCount1219 matA[row][1] /= fileCount1220 matA[row][2] /= fileCount1221 matA[row][3] /= fileCount1222 1223 matA_err[row][0] /= fileCount1224 matA_err[row][1] /= fileCount1225 matA_err[row][2] /= fileCount1226 matA_err[row][3] /= fileCount1296 // matA[row][0] /= fileCount 1297 // matA[row][1] /= fileCount 1298 // matA[row][2] /= fileCount 1299 // matA[row][3] /= fileCount 1300 // 1301 // matA_err[row][0] /= fileCount 1302 // matA_err[row][1] /= fileCount 1303 // matA_err[row][2] /= fileCount 1304 // matA_err[row][3] /= fileCount 1227 1305 1228 1306 SetDataFolder root: … … 1460 1538 DoPrompt "Change Display",dataType,scaling 1461 1539 1462 Display_4(dataType,scaling) 1463 1540 if(V_flag==0) //continue 1541 Display_4(dataType,scaling) 1542 endif 1464 1543 break 1465 1544 case -1: // control being killed … … 1486 1565 DoPrompt "Change Display",dataType,pType 1487 1566 1488 sprintf str,"DisplayTaggedData(\"%s\",\"%s\")",dataType,pType 1489 Execute str 1490 1567 if(V_flag==0) //continue 1568 sprintf str,"DisplayTaggedData(\"%s\",\"%s\")",dataType,pType 1569 Execute str 1570 endif 1491 1571 break 1492 1572 case -1: // control being killed -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/Polarization/Pol_PolarizationPanels.ipf
r835 r836 279 279 case 2: // mouse up 280 280 // click code here 281 DoAlert 0,"Help for Cell Param Panel not written yet" 281 DisplayHelpTopic/Z/K=1 "Fundamental Cell Parameters" 282 if(V_flag !=0) 283 DoAlert 0,"The Cell Parameter Help file could not be found" 284 endif 282 285 break 283 286 case -1: // control being killed … … 471 474 String fname, t0str, condStr,noteStr,t1Str,cellStr 472 475 476 t0Str = "31-OCT-2012 19:30:00" 473 477 switch( ba.eventCode ) 474 478 case 2: // mouse up … … 491 495 Prompt gamma_val, "Enter gamma: " 492 496 Prompt err_gamma, "Enter err_gamma: " 493 Prompt runNum,"Run number for time=0 of decay" 494 DoPrompt "Enter Cell Decay Parameters", Po, err_Po, muPo, err_muPo, gamma_val, err_gamma, runNum 497 Prompt t0Str,"Enter the t=0 time DD-MMM-YYYY HH:MM:SS" 498 // Prompt runNum,"Run number for time=0 of decay" 499 DoPrompt "Enter Cell Decay Parameters", Po, err_Po, muPo, err_muPo, gamma_val, err_gamma, t0Str 495 500 if (V_Flag) 496 501 return -1 // User canceled 497 502 endif 498 499 fname = FindFileFromRunNumber(runNum) 500 t0str = getFileCreationDate(fname) 503 504 // enter the time as a string now, rather than from a run number 505 // fname = FindFileFromRunNumber(runNum) 506 // t0str = getFileCreationDate(fname) 501 507 502 508 // for the wave note … … 869 875 870 876 877 // calculate Tmin and its error 878 Function Calc_Tmin(cellStr,Po,err_Po,err_Tmin) 879 String cellStr 880 Variable Po,err_Po,&err_Tmin 881 882 Variable Tmin,arg 883 Variable Te,err_Te,mu,err_mu 884 // cell constants 885 Te = NumberByKey("Te", cellStr, "=", ",", 0) 886 err_Te = NumberByKey("err_Te", cellStr, "=", ",", 0) 887 mu = NumberByKey("mu", cellStr, "=", ",", 0) 888 err_mu = NumberByKey("err_mu", cellStr, "=", ",", 0) 889 890 Tmin = Te*exp(-mu*(1+Po)) 891 892 //the error 893 err_Tmin = (Tmin/Te)^2*err_Te^2 + (Tmin*(1+Po))^2*err_mu^2 + (Tmin*mu)^2*err_Po^2 894 err_Tmin = sqrt(err_Tmin) 895 896 Printf "Tmin = %g +/- %g (%g%)\r",Tmin,err_Tmin,err_Tmin/Tmin*100 897 898 899 return(Tmin) 900 End 901 902 903 871 904 // calculate PCell and its error 872 905 // … … 1282 1315 case 2: // mouse up 1283 1316 // click code here 1284 DoAlert 0,"Help for Cell Decay Panel not written yet" 1317 DisplayHelpTopic/Z/K=1 "Cell Decay Constant Panel" 1318 if(V_flag !=0) 1319 DoAlert 0,"The Cell Decay Help file could not be found" 1320 endif 1285 1321 break 1286 1322 case -1: // control being killed
Note: See TracChangeset
for help on using the changeset viewer.