Changeset 9131 for trunk/MagicSoft/Mars/datacenter
- Timestamp:
- 08/25/08 17:29:28 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter
- Files:
-
- 5 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 /* -
trunk/MagicSoft/Mars/datacenter/scripts/copyscript
r8742 r9131 216 216 #moving the files 217 217 file="" 218 opticalfiles=`find $transdir/optical - name '*.instr'`218 opticalfiles=`find $transdir/optical -regextype posix-egrep -regex '^$transdir/optical/20[0-9][0-9]_[0-1][0-9]_[0-3][0-9]_.*_[RV][_]?[12]?[.]instr$'` 219 219 for opticalfile in $opticalfiles 220 220 do … … 243 243 fi 244 244 ;; 245 3) echo " checkfilloptical=$checkfilloptical - Error: position of one object is missing in the database" >> $scriptlog 2>&1 246 printprocesslog "ERROR filloptical.C failed for $opticalfile because the position of one object is missing in the database" 247 continue 248 ;; 249 *) echo " checkfilloptical=$checkfilloptical - Error -> go on with next file" >> $scriptlog 2>&1 250 printprocesslog "ERROR filloptical.C failed for $opticalfile" 251 continue 252 ;; 245 3) echo " checkfilloptical=$checkfilloptical - ERROR filloptical.C failed for $opticalfile: position of one object is missing in the database" >> $scriptlog 2>&1 246 printprocesslog "ERROR filloptical.C failed for $opticalfile: position of one object is missing in the database" 247 continue ;; 248 4) echo " checkfilloptical=$checkfilloptical - ERROR filloptical.C failed for $opticalfile: telescope line with more or less than 2 arguments" >> $scriptlog 2>&1 249 printprocesslog "ERROR filloptical.C failed for $opticalfile: telescope line with more or less than 2 arguments" 250 continue ;; 251 5) echo " checkfilloptical=$checkfilloptical - ERROR filloptical.C failed for $opticalfile: timestamp line with more or less than 4 arguments" >> $scriptlog 2>&1 252 printprocesslog "ERROR filloptical.C failed for $opticalfile: timestamp line with more or less than 4 arguments" 253 continue ;; 254 6) echo " checkfilloptical=$checkfilloptical - ERROR filloptical.C failed for $opticalfile: object line with more or less than 8 arguments" >> $scriptlog 2>&1 255 printprocesslog "ERROR filloptical.C failed for $opticalfile: object line with more or less than 8 arguments" 256 continue ;; 257 *) echo " checkfilloptical=$checkfilloptical - ERROR filloptical.C failed for $opticalfile -> go on with next file" >> $scriptlog 2>&1 258 printprocesslog "ERROR filloptical.C failed for $opticalfile (returned $checkfilloptical)" 259 continue ;; 253 260 esac 254 261 done -
trunk/MagicSoft/Mars/datacenter/scripts/dbchk
r9128 r9131 161 161 # CHECK 2 162 162 echo "Checking if all sequences in Sequences have a corresponding sequence files" >> $scriptlog 2>&1 163 sequences=`echo SELECT fSequenceFirst FROM Sequences | mymysql`163 sequences=`echo SELECT fSequenceFirst FROM Sequences left join SequenceProcessStatus using (fSequenceFirst,fTelescopeNumber) where not isnull(fSequenceFileWritten) | mymysql` 164 164 for sequence in $sequences 165 165 do -
trunk/MagicSoft/Mars/datacenter/tools/fillobjects.C
r8405 r9131 118 118 119 119 query+=Form(", fObjectName='%s/%s'", (*arr)[0]->GetName(), (*arr)[1]->GetName()); 120 where=Form(" fObjectName='%s/%s'", (*arr)[0]->GetName(), (*arr)[1]->GetName()); 120 121 delete arr; 121 122 122 if (serv.Insert ("Object", query)==kFALSE)123 if (serv.InsertUpdate("Object", query, where)==kFALSE) 123 124 return 2; 124 125 num +=1; -
trunk/MagicSoft/Mars/datacenter/tools/fillobjects2.C
r8405 r9131 118 118 119 119 query+=Form(", fObjectName='%s'", object.Data()); 120 where=Form(" fObjectName='%s'", object.Data()); 120 121 121 if (serv.Insert ("Object", query)==kFALSE)122 if (serv.InsertUpdate("Object", query, where)==kFALSE) 122 123 return 2; 123 124 num +=1;
Note:
See TracChangeset
for help on using the changeset viewer.