Changeset 8741
- Timestamp:
- 09/05/07 20:36:37 (17 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8740 r8741 22 22 * datacenter/macros/plotdb.C: 23 23 - updated some ranges 24 25 * callisto.cc, star.cc, ganymed.cc, sponde.cc: 26 - updated to allow --rc= 27 - moved execution of jobs into individual block if not already done 28 29 * mbase/MEnv.[h,cc]: 30 - added new member function TakeEnv to take resources from MArgs 31 32 * mpedestal/MExtractPedestal.cc: 33 - made sure that the program doesn't (sould not?) crash whenever 34 a lower bound is given which is much too large 35 36 * mpointing/MPointingDevCalc.cc: 37 - added comments from the runbook about mirror focussing 38 beginning of August 24 39 25 40 -
trunk/MagicSoft/Mars/callisto.cc
r8683 r8741 61 61 gLog << " --debug-env[=1] Display untouched resources after program execution" << endl; 62 62 gLog << " --debug-env=2 Display untouched resources after eventloop setup" << endl; 63 gLog << " --debug-env=3 Debug setting resources from resource file " << endl;63 gLog << " --debug-env=3 Debug setting resources from resource file and command line" << endl; 64 64 gLog << " --debug-mem Debug memory usage" << endl << endl; 65 gLog << " --rc=Name:option Set or overwrite a resource of the resource file." << endl; 66 gLog << " (Note, that this option can be used multiple times." << endl; 65 67 gLog << endl; 66 68 gLog << " -q Quit when job is finished" << endl; … … 198 200 199 201 // 200 // check for the right usage of the program 202 // check for the right usage of the program (number of arguments) 201 203 // 202 204 if (arg.GetNumArguments()!=1) … … 207 209 } 208 210 211 // 212 // Now we access/read the resource file. This will remove all 213 // --rc= from the list of arguments. 214 // 215 MEnv env(kConfig); 216 if (!env.IsValid()) 217 { 218 gLog << err << "ERROR - Reading resource file " << kConfig << "." << endl; 219 return 0xfe; 220 } 221 222 // And move the resource options from the command line to the MEnv 223 if (!env.TakeEnv(arg, kDebugEnv>2)) 224 return 0xfd; 225 226 // 227 // check for the right usage of the program (number of options) 228 // 209 229 if (arg.GetNumOptions()>0) 210 230 { … … 339 359 d->SetBit(MStatusDisplay::kExitLoopOnExit); 340 360 d->SetTitle(kSequence); 341 342 MEnv env(kConfig);343 if (!env.IsValid())344 {345 gLog << err << "Configuration file " << kConfig << " not found." << endl;346 return 0xfe;347 }348 361 349 362 if (kModeC/* || kUseTest*/) -
trunk/MagicSoft/Mars/ganymed.cc
r8724 r8741 58 58 gLog << " --debug-env[=1] Display untouched resources after program execution" << endl; 59 59 gLog << " --debug-env=2 Display untouched resources after eventloop setup" << endl; 60 gLog << " --debug-env=3 Debug setting resources from resource file " << endl;60 gLog << " --debug-env=3 Debug setting resources from resource file and command line" << endl; 61 61 gLog << " --debug-mem Debug memory usage" << endl << endl; 62 gLog << " --rc=Name:option Set or overwrite a resource of the resource file." << endl; 63 gLog << " (Note, that this option can be used multiple times." << endl; 62 64 gLog << endl; 63 65 gLog << " -q Quit when job is finished" << endl; … … 154 156 } 155 157 158 // 159 // check for the right usage of the program (number of arguments) 160 // 161 if (arg.GetNumArguments()!=1) 162 { 163 gLog << warn << "WARNING - Wrong number of arguments..." << endl; 164 Usage(); 165 return 2; 166 } 167 168 // 169 // Now we access/read the resource file. This will remove all 170 // --rc= from the list of arguments. 171 // 172 MEnv env(kConfig); 173 if (!env.IsValid()) 174 { 175 gLog << err << "ERROR - Reading resource file " << kConfig << "." << endl; 176 return 0xfe; 177 } 178 179 // And move the resource options from the command line to the MEnv 180 if (!env.TakeEnv(arg, kDebugEnv>2)) 181 return 0xfd; 182 183 // 184 // check for the right usage of the program (number of options) 185 // 156 186 if (arg.GetNumOptions()>0) 157 187 { … … 159 189 arg.Print("options"); 160 190 gLog << endl; 161 return 2;162 }163 164 //165 // check for the right usage of the program166 //167 if (arg.GetNumArguments()!=1)168 {169 gLog << warn << "WARNING - Wrong number of arguments..." << endl;170 Usage();171 191 return 2; 172 192 } … … 248 268 249 269 // 250 // Calculate pedestal for pedestal-calculation and calibration 251 // 252 MEnv env(kConfig); 253 if (!env.IsValid()) 254 { 255 gLog << err << "Configuration file " << kConfig << " not found." << endl; 256 return 0xfe; 257 } 258 259 MJCut job(Form("MJCut #%d", seq.GetNumAnalysis())); 260 job.SetEnv(&env); 261 job.SetEnvDebug(kDebugEnv); 262 job.SetDisplay(d);; 263 job.SetOverwrite(kOverwrite); 264 job.SetPathOut(kOutpath); 265 job.SetNameOutFile(kOutfile); 266 job.SetNameSummaryFile(kNameSummary); 267 //job.SetNameResultFile(kNameResult); 268 job.EnableWriteOnly(kWriteOnly); 269 //if (kFullDisplay) 270 // job.EnableFullDisplay(kFullDisplay); 271 job.EnableStorageOfResult(!kSkipResult); 272 if (kWriteSummary) // Don't change flag set in SetNameSummaryFile 273 job.EnableStorageOfSummary(); 274 //if (kWriteResult) // Don't change flag set in SetNameSummaryFile 275 // job.EnableStorageOfResult(); 276 277 const Int_t rc = job.Process(seq); 278 if (rc<=0) 279 { 280 gLog << err << "Calculation of cuts failed." << endl << endl; 281 282 //error coding for the automatic analysis (to be filled into the database) 283 switch (rc) 270 // Run cut program. (block for debug-mem) 271 // 272 { 273 MJCut job(Form("MJCut #%d", seq.GetNumAnalysis())); 274 job.SetEnv(&env); 275 job.SetEnvDebug(kDebugEnv); 276 job.SetDisplay(d);; 277 job.SetOverwrite(kOverwrite); 278 job.SetPathOut(kOutpath); 279 job.SetNameOutFile(kOutfile); 280 job.SetNameSummaryFile(kNameSummary); 281 //job.SetNameResultFile(kNameResult); 282 job.EnableWriteOnly(kWriteOnly); 283 //if (kFullDisplay) 284 // job.EnableFullDisplay(kFullDisplay); 285 job.EnableStorageOfResult(!kSkipResult); 286 if (kWriteSummary) // Don't change flag set in SetNameSummaryFile 287 job.EnableStorageOfSummary(); 288 //if (kWriteResult) // Don't change flag set in SetNameSummaryFile 289 // job.EnableStorageOfResult(); 290 291 const Int_t rc = job.Process(seq); 292 if (rc<=0) 284 293 { 285 case 0: // MJCut failed 286 return 3; 287 case -1: // Source not found 288 return 4; 289 case -2: // FillRndSrcCam failed 290 return 5; 291 case -3: // Processing off-data failed 292 return 6; 293 case -4: // Processing on-data failed 294 return 7; 294 gLog << err << "Calculation of cuts failed." << endl << endl; 295 296 //error coding for the automatic analysis (to be filled into the database) 297 switch (rc) 298 { 299 case 0: // MJCut failed 300 return 3; 301 case -1: // Source not found 302 return 4; 303 case -2: // FillRndSrcCam failed 304 return 5; 305 case -3: // Processing off-data failed 306 return 6; 307 case -4: // Processing on-data failed 308 return 7; 309 } 310 return 2; 295 311 } 296 return 2; 297 } 298 299 if (kDebugEnv>0) 300 env.PrintUntouched(); 301 302 if (!job.GetDisplay()) 303 { 304 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 305 return 1; 312 313 if (kDebugEnv>0) 314 env.PrintUntouched(); 315 316 if (!job.GetDisplay()) 317 { 318 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 319 return 1; 320 } 306 321 } 307 322 -
trunk/MagicSoft/Mars/mbase/MEnv.cc
r8731 r8741 57 57 #include "MLog.h" 58 58 #include "MLogManip.h" 59 60 #include "MArgs.h" 59 61 60 62 ClassImp(MEnv); … … 978 980 //--------------------------------------------------------------------------- 979 981 // 982 // Check MArgs for all options "--rc=" and remove them. Options should be 983 // given like 984 // 985 // program --rc=Option1:Test1 --rc=Option2.SubOption:Test2 986 // 987 // If all resources could be interpeted corrctly kTRUE is returned. If 988 // there were problems kFALSE is returned. 989 // 990 Bool_t MEnv::TakeEnv(MArgs &arg, Bool_t print, Bool_t overwrite) 991 { 992 if (!GetTable()) 993 { 994 gLog << err << "ERROR - MEnv not yet initialized." << endl; 995 return kFALSE; 996 } 997 998 Bool_t ret = kTRUE; 999 while (1) 1000 { 1001 const TString rc = arg.GetStringAndRemove("--rc="); 1002 if (rc.IsNull()) 1003 break; 1004 1005 const Ssiz_t pos = rc.First(':'); 1006 if (pos<0) 1007 { 1008 gLog << warn << "WARNING - Resource '" << rc << "' doesn't contain a colon... ignored." << endl; 1009 ret=kFALSE; 1010 continue; 1011 } 1012 if (pos==0) 1013 { 1014 gLog << warn << "WARNING - Resource '" << rc << "' doesn't contain a name... ignored." << endl; 1015 ret=kFALSE; 1016 continue; 1017 } 1018 if (pos==rc.Length()-1) 1019 { 1020 gLog << warn << "WARNING - Resource '" << rc << "' empty... ignored." << endl; 1021 ret=kFALSE; 1022 continue; 1023 } 1024 1025 const TString name = rc(0, pos); 1026 const TString val = rc(pos+1, rc.Length()); 1027 1028 if (print) 1029 gLog << all << "Command line resource '" << name << "' with value '" << val << "'..."; 1030 1031 const Bool_t exists = Defined(name); 1032 if (!exists) 1033 { 1034 SetValue(name, val, kEnvLocal); 1035 if (print) 1036 gLog << "set." << endl; 1037 continue; 1038 } 1039 1040 if (overwrite) 1041 { 1042 SetValue(name, ""); 1043 SetValue(name, val, kEnvLocal); 1044 if (print) 1045 gLog << "changed." << endl; 1046 continue; 1047 } 1048 1049 if (print) 1050 gLog << "skipped/existing." << endl; 1051 } 1052 return ret; 1053 } 1054 1055 //--------------------------------------------------------------------------- 1056 // 980 1057 // Add name and full path to output 981 1058 // -
trunk/MagicSoft/Mars/mbase/MEnv.h
r8716 r8741 15 15 class TAttFill; 16 16 class TPave; 17 18 class MArgs; 17 19 18 20 class MEnv : public TEnv … … 67 69 68 70 void AddEnv(const TEnv &env, Bool_t overwrite=kTRUE); 71 Bool_t TakeEnv(MArgs &args, Bool_t print=kFALSE, Bool_t overwrite=kTRUE); 69 72 70 73 Int_t ReadFile(const char *fname, EEnvLevel level); -
trunk/MagicSoft/Mars/mpedestal/MExtractPedestal.cc
r8633 r8741 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MExtractPedestal.cc,v 1.3 4 2007-07-14 00:02:24tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MExtractPedestal.cc,v 1.35 2007-09-05 19:36:36 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 350 350 const UInt_t num = fRunHeader->GetNumSamplesHiGain()+fRunHeader->GetNumSamplesLoGain(); 351 351 352 // Check upper bound for check window 352 353 if (fCheckWinLast >= num) 353 354 { 354 *fLog << "CheckWindow [" << fCheckWinFirst << "," << fCheckWinLast;355 *fLog << inf << "CheckWindow [" << fCheckWinFirst << "," << fCheckWinLast; 355 356 *fLog << "] out of range [0," << num-1 << "]... "; 356 357 *fLog << "reset upper edge." << endl; … … 359 360 } 360 361 361 if (offset+fExtractWinLast >= num) 362 { 363 *fLog << "ExtractWindow [" << fExtractWinFirst+offset << "," << fExtractWinLast+offset; 362 // Now check lower bound for check window 363 if (fCheckWinFirst>fCheckWinLast) 364 { 365 *fLog << err << "CheckWindow first slice " << fCheckWinFirst; 366 *fLog << " greater than last slice " << fCheckWinLast; 367 *fLog << "... reset to 0." << endl; 368 369 fCheckWinFirst = 0; 370 } 371 372 // check upper bound for extaction window 373 if (fExtractWinLast+offset >= num) 374 { 375 *fLog << inf << "ExtractWindow [" << fExtractWinFirst+offset << "," << fExtractWinLast+offset; 364 376 *fLog << "] out of range [0," << num-1 << "]... "; 365 377 *fLog << "reset upper edge." << endl; … … 368 380 } 369 381 382 // Now check lower bound for check window 383 if (fExtractWinFirst>fExtractWinLast) 384 { 385 *fLog << err << "ExtractionWindow first slice " << fExtractWinFirst+offset; 386 *fLog << " greater than last slice " << fExtractWinLast+offset; 387 *fLog << "... reset to 0." << endl; 388 389 fExtractWinFirst = 0; 390 } 391 392 // Calculate window size for extraction window 370 393 fExtractWinSize = fExtractWinLast-fExtractWinFirst+1; 371 394 395 // Check if use tries to do a fundamental pedestal extraction 396 // with an odd number of slices 372 397 if (fExtractor || TMath::Even(fExtractWinSize)) 373 398 return; 374 399 400 // Make sure the number of extracted slices is even 375 401 fExtractWinLast += offset+fExtractWinLast==num-1 ? -1 : +1; 376 402 377 *fLog << "ExtractionWindow odd... set to [";403 *fLog << inf << "ExtractionWindow odd... set to ["; 378 404 *fLog << fExtractWinFirst+offset << "," << fExtractWinLast+offset << "]" << endl; 379 405 -
trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc
r8731 r8741 166 166 // Lid is closed. (< run 84980) 167 167 // 168 // Mirror refocussing around 4.Aug.2007, from the Runbook: 169 // 170 // [2007-08-04 04:46:47] 171 // We finished with the focussing with Polaris. The images need to be 172 // analysed and new LUTs generated. 173 // 174 // [2007-08-04 23:47:30] 175 // Actually we see that the mispointing is always large; probably since 176 // the LUT tables have not yet been adjusted to the new focussing. 177 // 178 // [2007-08-03 23:07:58] 179 // Data taking stopped. Mirror focussing. 180 // 181 // [2007-08-05 00:09:16] 182 // We take some pictures on stars nearby Cyg X3 with the sbig camera; 183 // actually the spot doesn't look very nice... The pictures have been 184 // saved with name Deneb- and Sadr- Polaris seems a bit better. Should we 185 // have new LUT tables after the focussing? 186 // 187 // [2007-08-10 20:18:48] 188 // Tonight we take first images of Polaris with a new LUT file generated 189 // based on the recent focussing. The image will be analysed tomorrow and 190 // than new LUTs will be generated. For tonight the focussing is still not 191 // changed. 192 // 193 // [2007-08-14 20:57:59] 194 // The weather is fine. There is a group of hobby astronomers at the 195 // helicopter parking. Before data taking, we tried to check the new LUTs. 196 // However, because of technical problems with the new LUTs we had to 197 // postpone the measurements. We lost some 10 min of data taking because 198 // of this. 199 // 200 // [2007-08-14 22:29:37] 201 // Before continuing the observation we perform a focussing test with the 202 // new LUTs from recent Polaris focussing. Note: Data on Her X-1 was taken 203 // with old focussing. We performed PSF measurements on Kornephorus (Zd 204 // 31.77, Az 264,67) first with old LUTs and then with new LUTs. We took 205 // T-points with both focussing. The first T-Point corresponds to the 206 // previous focussing and the second with the improved. Please check both 207 // T-points for eventual misspointing. We found big improvement of the PSF 208 // with the new LUTs and will therefore continue from now on with the new 209 // focussing. Having a first look at the SBIG pictures we see a slightly 210 // misspointing of ~0.1 deg with the new LUTs. 211 // 212 // [2007-08-14 22:46:10] 213 // Comparing the trigger rate with yesterday night we do not see an 214 // improvement with the new focussing. 215 // 216 // 168 217 // 169 218 // ToDo: -
trunk/MagicSoft/Mars/sponde.cc
r8720 r8741 57 57 gLog << " --debug-env[=1] Display untouched resources after program execution" << endl; 58 58 gLog << " --debug-env=2 Display untouched resources after eventloop setup" << endl; 59 gLog << " --debug-env=3 Debug setting resources from resource file " << endl;59 gLog << " --debug-env=3 Debug setting resources from resource file and command line" << endl; 60 60 gLog << " --debug-mem Debug memory usage" << endl << endl; 61 gLog << " --rc=Name:Option Set or overwrite a resource of the resource file." << endl; 62 gLog << " (Note, that this option can be used multiple times." << endl; 61 63 gLog << endl; 62 64 gLog << " -q Quit when job is finished" << endl; … … 119 121 const Bool_t kForceTheta = arg.HasOnlyAndRemove("--force-theta"); 120 122 123 // 124 // check for the right usage of the program (number of arguments) 125 // 126 if (arg.GetNumArguments()<2 || arg.GetNumArguments()>3) 127 { 128 gLog << warn << "WARNING - Wrong number of arguments..." << endl; 129 Usage(); 130 return 2; 131 } 132 133 // 134 // Now we access/read the resource file. This will remove all 135 // --rc= from the list of arguments. 136 // 137 MEnv env(kConfig); 138 if (!env.IsValid()) 139 { 140 gLog << err << "ERROR - Reading resource file " << kConfig << "." << endl; 141 return 0xfe; 142 } 143 144 // And move the resource options from the command line to the MEnv 145 if (!env.TakeEnv(arg, kDebugEnv>2)) 146 return 0xfd; 147 148 // 149 // check for the right usage of the program (number of options) 150 // 121 151 if (arg.GetNumOptions()>0) 122 152 { … … 124 154 arg.Print("options"); 125 155 gLog << endl; 126 return 2;127 }128 129 //130 // check for the right usage of the program131 //132 if (arg.GetNumArguments()<2 || arg.GetNumArguments()>3)133 {134 gLog << warn << "WARNING - Wrong number of arguments..." << endl;135 Usage();136 156 return 2; 137 157 } … … 208 228 209 229 // 210 // Calculate pedestal for pedestal-calculation and calibration 211 // 212 MEnv env(kConfig); 213 if (!env.IsValid()) 214 { 215 gLog << err << "Configuration file " << kConfig << " not found." << endl; 216 return 0xfe; 217 } 218 219 MJSpectrum job(Form("Spectrum - %s", kInfile.Data())); 220 job.SetEnv(&env); 221 job.SetEnvDebug(kDebugEnv); 222 job.SetDisplay(d);; 223 job.SetOverwrite(kOverwrite); 224 job.SetPathOut(kOutfile); 225 job.SetPathIn(kInfile); 226 227 job.ForceTheta(kForceTheta); 228 229 if (!job.Process(seq)) 230 { 231 gLog << err << "Calculation of spectrum failed." << endl << endl; 232 return 2; 233 } 234 if (kDebugEnv>0) 235 env.PrintUntouched(); 236 237 if (!job.GetDisplay()) 238 { 239 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 240 return 1; 230 // Calculate spectrum (block for debug-mem) 231 // 232 { 233 MJSpectrum job(Form("Spectrum - %s", kInfile.Data())); 234 job.SetEnv(&env); 235 job.SetEnvDebug(kDebugEnv); 236 job.SetDisplay(d);; 237 job.SetOverwrite(kOverwrite); 238 job.SetPathOut(kOutfile); 239 job.SetPathIn(kInfile); 240 241 job.ForceTheta(kForceTheta); 242 243 if (!job.Process(seq)) 244 { 245 gLog << err << "Calculation of spectrum failed." << endl << endl; 246 return 2; 247 } 248 if (kDebugEnv>0) 249 env.PrintUntouched(); 250 251 if (!job.GetDisplay()) 252 { 253 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 254 return 1; 255 } 241 256 } 242 257 -
trunk/MagicSoft/Mars/star.cc
r8683 r8741 53 53 gLog << " --debug-env[=1] Display untouched resources after program execution" << endl; 54 54 gLog << " --debug-env=2 Display untouched resources after eventloop setup" << endl; 55 gLog << " --debug-env=3 Debug setting resources from resource file " << endl;55 gLog << " --debug-env=3 Debug setting resources from resource file and command line" << endl; 56 56 gLog << " --debug-mem Debug memory usage" << endl << endl; 57 gLog << " --rc=Name:option Set or overwrite a resource of the resource file." << endl; 58 gLog << " (Note, that this option can be used multiple times." << endl; 57 59 gLog << endl; 58 60 gLog << " Input Options:" << endl; … … 132 134 const TString kOutpath = arg.GetStringAndRemove("--out=", "."); 133 135 136 // 137 // check for the right usage of the program (number of arguments) 138 // 139 if (arg.GetNumArguments()!=1) 140 { 141 gLog << warn << "WARNING - Wrong number of arguments..." << endl; 142 Usage(); 143 return 2; 144 } 145 146 // 147 // Now we access/read the resource file. This will remove all 148 // --rc= from the list of arguments. 149 // 150 MEnv env(kConfig); 151 if (!env.IsValid()) 152 { 153 gLog << err << "ERROR - Reading resource file " << kConfig << "." << endl; 154 return 0xfe; 155 } 156 157 // And move the resource options from the command line to the MEnv 158 if (!env.TakeEnv(arg, kDebugEnv>2)) 159 return 0xfd; 160 161 // 162 // check for the right usage of the program (number of options) 163 // 134 164 if (arg.GetNumOptions()>0) 135 165 { … … 137 167 arg.Print("options"); 138 168 gLog << endl; 139 return 2;140 }141 142 //143 // check for the right usage of the program144 //145 if (arg.GetNumArguments()!=1)146 {147 gLog << warn << "WARNING - Wrong number of arguments..." << endl;148 Usage();149 169 return 2; 150 170 } … … 214 234 215 235 // 216 // Do calibration in a block (debug mem) 217 // 218 MEnv env(kConfig); 219 if (!env.IsValid()) 220 { 221 gLog << err << "Configuration file " << kConfig << " not found." << endl; 222 return 0xfe; 223 } 224 236 // Do star in a block (debug mem) 237 // 225 238 { 226 239 MJStar job(Form("MJStar #%d", seq.GetSequence()));
Note:
See TracChangeset
for help on using the changeset viewer.