Changeset 9131 for trunk/MagicSoft/Mars/datacenter/macros
- Timestamp:
- 08/25/08 17:29:28 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/filloptical.C
r8996 r9131 38 38 // Returns 2 in case of invalid file or line in file. 39 39 // Returns 3 in case of a missing object name in the database. 40 // Returns 4 in case of a telescope line with more or less than 2 arguments 41 // Returns 5 in case of a timestamp line with more or less than 4 arguments 42 // Returns 6 in case of a object line with more or less than 10 arguments 40 43 // 41 44 /////////////////////////////////////////////////////////////////////////// … … 84 87 TString skylevel; 85 88 TString fwhm; 89 TString ellipticity; 90 TString posangle; 86 91 TString aperturer; 87 92 TString mag; … … 130 135 if (arr->GetEntries()!=2) 131 136 { 132 cout << "WARNING: Telescopeline with less or more than 2 arguments found " << endl; 133 return 2; 137 cout << "WARNING: Telescopeline with less or more than 2 arguments found in file " << 138 fname(TRegexp("20[0-9][0-9]_[0-1][0-9]_[0-3][0-9]_.*_[RV][_]?[12]?[.]instr", kFALSE)) << endl; 139 cout << "Line: " << line << endl; 140 return 4; 134 141 } 135 142 telescope=(*arr)[0]->GetName(); … … 146 153 if (arr->GetEntries()!=4) 147 154 { 148 cout << "WARNING: Timestampline with less or more than 4 arguments found " << endl; 149 return 2; 155 cout << "WARNING: Timestampline with less or more than 4 arguments found in file " << 156 fname(TRegexp("20[0-9][0-9]_[0-1][0-9]_[0-3][0-9]_.*_[RV][_]?[12]?[.]instr", kFALSE)) << endl; 157 cout << "Line: " << line << endl; 158 return 5; 150 159 } 151 160 numexp+=1; … … 162 171 else 163 172 { 164 if (arr->GetEntries()!= 8)173 if (arr->GetEntries()!=10) 165 174 { 166 cout << "WARNING: Objectline with less or more than 8 arguments found " << endl; 167 cout << line << endl; 168 return 2; 175 cout << "WARNING: Objectline with less or more than 10 arguments found in file " << 176 fname(TRegexp("20[0-9][0-9]_[0-1][0-9]_[0-3][0-9]_.*_[RV][_]?[12]?[.]instr", kFALSE)) << endl; 177 cout << "Line: " << line << endl; 178 return 6; 169 179 } 170 180 … … 197 207 } 198 208 199 object = Form("%s/%s", (*arr)[0]->GetName(),(*arr)[1]->GetName()); 200 skylevel = (*arr)[2]->GetName(); 201 fwhm = (*arr)[3]->GetName(); 202 aperturer = (*arr)[4]->GetName(); 203 mag = (*arr)[5]->GetName(); 204 magerr = (*arr)[6]->GetName(); 205 status = (*arr)[7]->GetName(); 209 object = Form("%s/%s", (*arr)[0]->GetName(),(*arr)[1]->GetName()); 210 skylevel = (*arr)[2]->GetName(); 211 fwhm = (*arr)[3]->GetName(); 212 ellipticity = (*arr)[4]->GetName(); 213 posangle = (*arr)[5]->GetName(); 214 aperturer = (*arr)[6]->GetName(); 215 mag = (*arr)[7]->GetName(); 216 magerr = (*arr)[8]->GetName(); 217 status = (*arr)[9]->GetName(); 206 218 //make sure that no nonsense values enter the db 207 219 if (skylevel.Contains("-")) 208 220 skylevel = "NULL"; 221 if (ellipticity.Contains("-")) 222 ellipticity = "NULL"; 209 223 if (fwhm.Contains("-") || !fwhm.IsFloat()) 210 224 fwhm = "NULL"; 225 if (posangle.EndsWith("-")) 226 posangle = "NULL"; 211 227 if (!mag.IsFloat()) 212 228 mag = "NULL"; … … 221 237 /* 222 238 cout << numexp << "th exposure: star # " << numstars << endl; 223 cout << " timestamp: " << timestamp << endl; 224 cout << " exposure : " << exposure << endl; 225 cout << " fitsfile : " << fitsfile << endl; 226 cout << " object : " << object << endl; 227 cout << " skylevel : " << skylevel << endl; 228 cout << " fwhm : " << fwhm << endl; 229 cout << " aperturer: " << aperturer << endl; 230 cout << " mag : " << mag << " +/- " << magerr << endl; 231 cout << " status : " << status << endl << endl; 239 cout << " timestamp : " << timestamp << endl; 240 cout << " exposure : " << exposure << endl; 241 cout << " fitsfile : " << fitsfile << endl; 242 cout << " object : " << object << endl; 243 cout << " skylevel : " << skylevel << endl; 244 cout << " fwhm : " << fwhm << endl; 245 cout << " ellipticity: " << ellipticity << endl; 246 cout << " posangle : " << posangle << endl; 247 cout << " aperturer : " << aperturer << endl; 248 cout << " mag : " << mag << " +/- " << magerr << endl; 249 cout << " status : " << status << endl << endl; 232 250 */ 251 233 252 Int_t statuskey = serv.QueryKeyOfName("Status", status.Data()); 234 253 Int_t objectkey = serv.QueryKeyOfName("Object", object.Data()); … … 241 260 query=Form("fTimeStamp='%s', fExposure=%s, fFitsFileKEY=%d, " 242 261 "fObjectKEY=%d, fSkyLevel=%s, fFWHM=%s, " 243 "f ApertureRadius=%s, fInstrumentalMag=%s, "244 "fInstrumentalMag Err=%s, fStatusKEY=%d, fCCDKEY=%d, "245 "f FilterKEY=%d, fTelescopeKEY=%d, fBandKEY=%d, "246 "f ZenithDistance=%.1f ",262 "fEllipticity=%s, fPosAngle=%s, fApertureRadius=%s, " 263 "fInstrumentalMag=%s, fInstrumentalMagErr=%s, " 264 "fStatusKEY=%d, fCCDKEY=%d, fFilterKEY=%d, " 265 "fTelescopeKEY=%d, fBandKEY=%d, fZenithDistance=%.1f ", 247 266 timestamp.Data(), exposure.Data(), fitsfilekey, 248 267 objectkey, skylevel.Data(), fwhm.Data(), 249 aperturer.Data(), mag.Data(), magerr.Data(), 250 statuskey, ccdkey, filterkey, telkey, bandkey, zd); 268 ellipticity.Data(), posangle.Data(), aperturer.Data(), 269 mag.Data(), magerr.Data(), statuskey, ccdkey, 270 filterkey, telkey, bandkey, zd); 251 271 252 272 /*
Note:
See TracChangeset
for help on using the changeset viewer.