Ignore:
Timestamp:
12/14/06 16:14:35 (18 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r8215 r8236  
    8989    TString query;
    9090    TString select;
    91     Int_t statuskey;
    92     Int_t objectkey;
    93     Int_t fitsfilekey;
     91    TString telescope;
     92    TString telname;
     93    TString ccd;
     94    TString filterband;
     95    TString filter;
     96    TString band;
    9497    Double_t ra=0;
    9598    Double_t dec=0;
     
    99102    TVector3 v;
    100103
     104    cout << fname << endl;
     105
     106    if (fname(TRegexp("20[0-9][0-9]_[0-1][0-9]_[0-3][0-9]_.*_R[_]?[12]?[.]instr", kFALSE)).IsNull())
     107    {
     108        cout << "Found not valid file: " << fname << endl;
     109        return 2;
     110    }
     111
    101112    while (1)
    102113    {
     
    106117            break;
    107118
    108         if (line=="KVA_Celestron_ST8  KVA_Celestron_R" || line.IsNull())
     119        if (line.IsNull())
    109120            continue;
    110121
    111122        TObjArray *arr = line.Tokenize("  ");
     123
     124        if (line=="KVA_Celestron_ST8  KVA_Celestron_R" ||
     125            line=="Tuorla_ST1001E  Tuorla_R")
     126        {
     127            if (arr->GetEntries()!=2)
     128            {
     129                cout << "WARNING: Telescopeline with less or more than 2 arguments found " << endl;
     130                return 2;
     131            }
     132            telescope=(*arr)[0]->GetName();
     133            telname=telescope(0,telescope.First('_'));
     134            ccd=telescope(telescope.Last('_')+1, telescope.Length());
     135            filterband=(*arr)[1]->GetName();
     136            filter=filterband(0,filterband.Last('_'));
     137            band=filterband(filterband.Last('_')+1, filterband.Length());
     138            continue;
     139        }
     140
    112141        if (!line(regexp).IsNull())
    113142        {
     
    131160            {
    132161                cout << "WARNING: Objectline with less or more than 8 arguments found " << endl;
     162                cout << line << endl;
    133163                return 2;
    134164            }
     
    195225            cout << " status   : " << status    << endl << endl;
    196226            */
    197             statuskey = serv.QueryKeyOfName("Status", status.Data());
    198             objectkey = serv.QueryKeyOfName("Object", object.Data());
    199             fitsfilekey = serv.QueryKeyOfName("FitsFile", fitsfile.Data());
     227            Int_t statuskey   = serv.QueryKeyOfName("Status", status.Data());
     228            Int_t objectkey   = serv.QueryKeyOfName("Object", object.Data());
     229            Int_t fitsfilekey = serv.QueryKeyOfName("FitsFile", fitsfile.Data());
     230            Int_t telkey      = serv.QueryKeyOfName("Telescope", telname.Data());
     231            Int_t ccdkey      = serv.QueryKeyOfName("CCD", ccd.Data());
     232            Int_t bandkey     = serv.QueryKeyOfName("Band", band.Data());
     233            Int_t filterkey   = serv.QueryKeyOfName("Filter", filter.Data());
     234
    200235            query=Form("fTimeStamp='%s', fExposure=%s, fFitsFileKEY=%d, "
    201236                       "fObjectKEY=%d, fSkyLevel=%s, fFWHM=%s, "
    202237                       "fApertureRadius=%s, fInstrumentalMag=%s, "
    203                        "fInstrumentalMagErr=%s, fStatusKEY=%d, fZenithDistance=",
     238                       "fInstrumentalMagErr=%s, fStatusKEY=%d, fCCDKEY=%d, "
     239                       "fFilterKEY=%d, fTelescopeKEY=%d, fBandKEY=%d, "
     240                       "fZenithDistance=",
    204241                       timestamp.Data(), exposure.Data(), fitsfilekey,
    205242                       objectkey, skylevel.Data(), fwhm.Data(),
    206243                       aperturer.Data(), mag.Data(), magerr.Data(),
    207                        statuskey);
     244                       statuskey, ccdkey, filterkey, telkey, bandkey);
    208245
    209246            if (ra==0 || dec==0)
     
    219256    }
    220257
    221     cout << fname(TRegexp("20[0-9][0-9]_[0-1][0-9]_[0-3][0-9]_KVA_C_R.*[.]instr", kFALSE))
     258    cout << fname(TRegexp("20[0-9][0-9]_[0-1][0-9]_[0-3][0-9]_.*_R[_]?[12]?[.]instr", kFALSE))
    222259        << ": " << setw(2) << numexp << " exposures, " <<  setw(2) << numstars << " stars" << endl;
    223260
     
    254291        return process(serv, path);
    255292
    256     //fill entries for each runbook file
    257     MDirIter Next(path, "2*_KVA_C_R*.instr", -1);
     293    //fill entries for each optical data file
     294    MDirIter Next(path, "20[0-9][0-9]_[0-1][0-9]_[0-3][0-9]_*_R[_]?[12]?[.]instr", -1);
    258295    while (1)
    259296    {
Note: See TracChangeset for help on using the changeset viewer.