Ignore:
Timestamp:
08/25/08 17:29:28 (16 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/datacenter
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/macros/filloptical.C

    r8996 r9131  
    3838// Returns 2 in case of invalid file or line in file.
    3939// 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
    4043//
    4144///////////////////////////////////////////////////////////////////////////
     
    8487    TString skylevel;
    8588    TString fwhm;
     89    TString ellipticity;
     90    TString posangle;
    8691    TString aperturer;
    8792    TString mag;
     
    130135            if (arr->GetEntries()!=2)
    131136            {
    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;
    134141            }
    135142            telescope=(*arr)[0]->GetName();
     
    146153            if (arr->GetEntries()!=4)
    147154            {
    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;
    150159            }
    151160            numexp+=1;
     
    162171        else
    163172        {
    164             if (arr->GetEntries()!=8)
     173            if (arr->GetEntries()!=10)
    165174            {
    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;
    169179            }
    170180
     
    197207            }
    198208
    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();
    206218            //make sure that no nonsense values enter the db
    207219            if (skylevel.Contains("-"))
    208220                skylevel = "NULL";
     221            if (ellipticity.Contains("-"))
     222                ellipticity = "NULL";
    209223            if (fwhm.Contains("-") || !fwhm.IsFloat())
    210224                fwhm     = "NULL";
     225            if (posangle.EndsWith("-"))
     226                posangle     = "NULL";
    211227            if (!mag.IsFloat())
    212228                mag      = "NULL";
     
    221237            /*
    222238            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;
    232250            */
     251
    233252            Int_t statuskey   = serv.QueryKeyOfName("Status", status.Data());
    234253            Int_t objectkey   = serv.QueryKeyOfName("Object", object.Data());
     
    241260            query=Form("fTimeStamp='%s', fExposure=%s, fFitsFileKEY=%d, "
    242261                       "fObjectKEY=%d, fSkyLevel=%s, fFWHM=%s, "
    243                        "fApertureRadius=%s, fInstrumentalMag=%s, "
    244                        "fInstrumentalMagErr=%s, fStatusKEY=%d, fCCDKEY=%d, "
    245                        "fFilterKEY=%d, fTelescopeKEY=%d, fBandKEY=%d, "
    246                        "fZenithDistance=%.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 ",
    247266                       timestamp.Data(), exposure.Data(), fitsfilekey,
    248267                       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);
    251271
    252272            /*
  • trunk/MagicSoft/Mars/datacenter/scripts/copyscript

    r8742 r9131  
    216216#moving the files
    217217file=""
    218 opticalfiles=`find $transdir/optical -name '*.instr'`
     218opticalfiles=`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$'`
    219219for opticalfile in $opticalfiles
    220220do
     
    243243         fi
    244244         ;;
    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 ;;
    253260   esac
    254261done
  • trunk/MagicSoft/Mars/datacenter/scripts/dbchk

    r9128 r9131  
    161161# CHECK 2
    162162echo "Checking if all sequences in Sequences have a corresponding sequence files" >> $scriptlog 2>&1
    163 sequences=`echo SELECT fSequenceFirst FROM Sequences | mymysql`
     163sequences=`echo SELECT fSequenceFirst FROM Sequences left join SequenceProcessStatus using (fSequenceFirst,fTelescopeNumber) where not isnull(fSequenceFileWritten) | mymysql`
    164164for sequence in $sequences
    165165do
  • trunk/MagicSoft/Mars/datacenter/tools/fillobjects.C

    r8405 r9131  
    118118
    119119        query+=Form(", fObjectName='%s/%s'", (*arr)[0]->GetName(), (*arr)[1]->GetName());
     120        where=Form(" fObjectName='%s/%s'", (*arr)[0]->GetName(), (*arr)[1]->GetName());
    120121        delete arr;
    121122
    122         if (serv.Insert("Object", query)==kFALSE)
     123        if (serv.InsertUpdate("Object", query, where)==kFALSE)
    123124            return 2;
    124125        num +=1;
  • trunk/MagicSoft/Mars/datacenter/tools/fillobjects2.C

    r8405 r9131  
    118118
    119119        query+=Form(", fObjectName='%s'", object.Data());
     120        where=Form(" fObjectName='%s'", object.Data());
    120121
    121         if (serv.Insert("Object", query)==kFALSE)
     122        if (serv.InsertUpdate("Object", query, where)==kFALSE)
    122123            return 2;
    123124        num +=1;
Note: See TracChangeset for help on using the changeset viewer.