Changeset 2568 for trunk/MagicSoft/Cosy


Ignore:
Timestamp:
11/25/03 18:25:49 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Cosy
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/Changelog

    r2518 r2568  
    11                                                                  -*-*- END -*-*-
     2 2003/11/25 - Thomas Bretz (La Palma)
     3
     4  * slog:
     5    - added this small script to analyze log-files
     6   
     7   * bending_magic.txt:
     8     - changed to new values comming from new fit
     9       with the new algorithm
     10       
     11   * cosy.cc:
     12     - removed old style InitGUI stuff
     13     - removed TROOT instance
     14     - changed to support gcc 3.3
     15     - added come log-output
     16     - undeclared HAVE_CAMERA
     17
     18   * stars.txt:
     19     - added some magnitudes
     20     - removed Mars
     21     
     22   * main/MBending.cc:
     23     - exchanged order: moved NPAE and CA behind AN and AW
     24     - replaced the approximation for AN/AW by the correct algorithm.
     25       For Magic (1.5deg) the small angle approximation is wrong
     26     - added some DEBUG option
     27     
     28   * tpoint/gui.C:
     29     - small changes
     30
     31
     32
    233 2003/11/17 - Thomas Bretz (La Palma)
    334 
  • trunk/MagicSoft/Cosy/bending_magic.txt

    r2280 r2568  
    1 MAGIC1 2003/07/16 16:15:09.783074
     1MAGIC1 2003/11/23 0:46:12.880585
    22S   00   000000   000000  0000000
    3  IA     501.79683 -1
    4  IE     -9.0710418 -1
    5  CA     0 -1
    6  NPAE   0.14889374 -1
    7  AN     0 -1
    8  AW     -1.5600339 -1
    9  NRX    0 -1
    10  NRY    0 -1
    11  CRX    0 -1
    12  CRY    0 -1
    13  ECES   0 -1
    14  ACES   0 -1
    15  ECEC   0 -1
    16  ACEC   0 -1
     3     IA      501.6639   0.034618314
     4     IE    -9.0592286   0.020049537
     5   FLOP             0             0
     6     AN             0             0
     7     AW    -1.5593339   0.022280707
     8   NPAE   0.073756927   0.039384952
     9     CA             0             0
     10     TF             0             0
     11     TX             0             0
     12   ECES             0             0
     13   ACES             0             0
     14   ECEC             0             0
     15   ACEC             0             0
     16    NRX             0             0
     17    NRY             0             0
     18    CRX             0             0
     19    CRY             0             0
     20 MAGIC1             0             0
     21 MAGIC2             0             0
    1722END
  • trunk/MagicSoft/Cosy/cosy.cc

    r2384 r2568  
    1 #include <iomanip.h>
    2 #include <fstream.h>
    3 #include <iostream.h>
     1#include <iostream>
     2#include <iomanip>
     3#include <fstream>
    44
    5 #include <TROOT.h>
    65#include <TSystem.h>
    76#include <TApplication.h>
     
    1615
    1716//#define EXPERT
    18 #define HAVE_CAMERA
     17//#define HAVE_CAMERA
    1918
    2019#define clog(txt) \
     
    2625    }
    2726
    28 TROOT root("Cosy", "Magic Control System");
    29 
    3027/* ---------------------------------------------------------------------- */
    31 //extern void InitGui();
    32 //VoidFuncPtr_t initfuncs[] = { InitGui, 0 };
    33 
    3428int main(int argc, char **argv)
    3529{
     
    5751    }
    5852
     53    cout << "Open Logfile: " << name << endl;
     54
    5955    MLog *l = new MLog(name, kTRUE);
    6056    MLog &lout = *l;
    6157
    62     clog("Starting Cosy at " << time.GetTimeStr() << " ...");
     58    clog("Starting Cosy at " << time << " ...");
    6359
    6460    //
     
    6763    clog("- Initialising Root environment.");
    6864
    69     TApplication* app = new TApplication("App", &argc, argv);
     65    // FIXME: Fails deleteing something in TGClient::fWlist
     66    TApplication *app=new TApplication("App", &argc, argv);
    7067
    7168    //
     
    125122    clog("- Stopping cosy.");
    126123    cosy->Stop();
    127     clog("- cosy stopped.");
     124
     125    time.Now();
     126    clog(time << ": MCosy stopped.");
    128127
    129128    delete cosy;
    130129
    131     clog("- Terminating Program.");
     130    time.Now();
     131    clog("Terminating cosy at " << time);
    132132
    133133    delete l;
  • trunk/MagicSoft/Cosy/main/MBending.cc

    r2518 r2568  
    6161#include <fstream.h>
    6262#include <iomanip.h>
     63#include <TVector3.h>
    6364
    6465#include <TMinuit.h>
     
    6970
    7071#undef DEBUG
    71 #define DEBUG(txt) txt
    72 //#define DEBUG(txt)
     72//#define DEBUG(txt) txt
     73#define DEBUG(txt)
    7374
    7475const Int_t MBending::fNumPar=19;
     
    8384    fCoeff[ 1] = &fIe;      fName[ 1] = "IE";
    8485    fCoeff[ 2] = &fFlop;    fName[ 2] = "FLOP";
    85     fCoeff[ 3] = &fNpae;    fName[ 3] = "NPAE";
    86     fCoeff[ 4] = &fCa;      fName[ 4] = "CA";
    87     fCoeff[ 5] = &fAn;      fName[ 5] = "AN";
    88     fCoeff[ 6] = &fAw;      fName[ 6] = "AW";
     86    fCoeff[ 3] = &fAn;      fName[ 3] = "AN";
     87    fCoeff[ 4] = &fAw;      fName[ 4] = "AW";
     88    fCoeff[ 5] = &fNpae;    fName[ 5] = "NPAE";
     89    fCoeff[ 6] = &fCa;      fName[ 6] = "CA";
    8990    fCoeff[ 7] = &fTf;      fName[ 7] = "TF";
    9091    fCoeff[ 8] = &fTx;      fName[ 8] = "TX";
     
    103104    fDescr[ 1] =  "Index Error Zenith Distance";
    104105    fDescr[ 2] =  "Vertical Sag";
    105     fDescr[ 3] =  "Az-El Nonperpendicularity";
    106     fDescr[ 4] =  "Left-Right Collimation Error";
    107     fDescr[ 5] =  "Azimuth Axis Misalignment (N-S)";
    108     fDescr[ 6] =  "Azimuth Axis Misalignment (E-W)";
     106    fDescr[ 3] =  "Azimuth Axis Misalignment (N-S)";
     107    fDescr[ 4] =  "Azimuth Axis Misalignment (E-W)";
     108    fDescr[ 5] =  "Az-El Nonperpendicularity";
     109    fDescr[ 6] =  "Left-Right Collimation Error";
    109110    fDescr[ 7] =  "Tube fluxture (sin)";
    110111    fDescr[ 8] =  "Tube fluxture (tan)";
     
    291292
    292293    DEBUG(cout << setprecision(16));
    293     DEBUG(cout << "Bend8: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     294    DEBUG(cout << "Bend7: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
    294295
    295296    const AltAz CRX(-fCrx*sin(p.Az()-p.Alt()),  fCrx*cos(p.Az()-p.Alt())/cos(p.Alt()));
     
    298299    p += CRY;
    299300
    300     DEBUG(cout << "Bend7: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     301    DEBUG(cout << "Bend6: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
    301302
    302303    const AltAz NRX(fNrx*sin(p.Alt()), -fNrx);
     
    305306    p += NRY;
    306307
    307     DEBUG(cout << "Bend6: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     308    DEBUG(cout << "Bend5: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
    308309
    309310    const AltAz CES(-fEces*sin(p.Alt()), -fAces*sin(p.Az()));
     
    312313    p += CEC;
    313314
    314     DEBUG(cout << "Bend5: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     315    DEBUG(cout << "Bend4: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
    315316
    316317    const AltAz TX(Sign(fTx/tan(p.Alt()), p.Alt()), 0);
     
    319320    p += TF;
    320321
    321     DEBUG(cout << "Bend4: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
    322 
     322
     323    DEBUG(cout << "Bend3: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     324
     325    /*
     326     //New Corrections for NPAE and CA:
     327     TVector3 v(1.,1.,1.); // Vector in cartesian coordinates
     328
     329     //Set Azimuth and Elevation
     330     v.SetPhi(p.Az());
     331     v.SetTheta(TMath::Pi()/2-p.Alt());
     332     //Rotation Vectors:
     333     TVector3 vNpae(             cos(p.Az()),              sin(p.Az()),             0);
     334     TVector3   vCa( -cos(p.Az())*cos(p.Alt()), -sin(p.Az())*cos(p.Alt()), sin(p.Alt()));
     335     //Rotate around the vectors vNpae and vCa
     336     v.Rotate(fNpae, vNpae);
     337     v.Rotate(fCa,     vCa);
     338
     339     p.Az(v.Phi());
     340     p.Alt(TMath::Pi()/2-v.Theta());
     341     */
     342
     343    //Old correction terms for Npae and Ca:
     344    const AltAz CA(0, -fCa/cos(p.Alt()));
     345    p += CA;
     346
     347    const AltAz NPAE(0, -fNpae*tan(p.Alt()));
     348    p += NPAE;
     349
     350    DEBUG(cout << "Bend2: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     351
     352    // New Corrections for AW and AN:
     353    TVector3 v2(1.,1.,1.); // Vector in cartesian coordinates
     354    // Set Azimuth and Elevation
     355    v2.SetPhi(p.Az());
     356    v2.SetTheta(TMath::Pi()/2-p.Alt());
     357    // Rotate around the x- and y-axis
     358    v2.RotateX(fAw);
     359    v2.RotateY(fAn);
     360    // Get Azimuth and Elevation
     361    p.Az(v2.Phi());
     362    p.Alt(TMath::Pi()/2-v2.Theta());
     363
     364    /*
     365    // Old correction terms for An and Aw:
    323366    cout << fAw << " " << cos(p.Az()) << " " << tan(p.Alt()) << endl;
    324367    cout << fAw* cos(p.Az())*tan(p.Alt())*180/3.1415 << endl;
     
    328371    p += AW;
    329372    p += AN;
    330 
    331     DEBUG(cout << "Bend3: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
    332 
    333     const AltAz CA(0, -fCa/cos(p.Alt()));
    334     p += CA;
    335 
    336     DEBUG(cout << "Bend2: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
    337 
    338     const AltAz NPAE(0, -fNpae*tan(p.Alt()));
    339     p += NPAE;
     373    */
     374
     375
     376
    340377
    341378    DEBUG(cout << "Bend1: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     
    381418    DEBUG(cout << "Back1: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
    382419
     420    /*
     421     //Old correction terms for An and Aw:
     422     const AltAz AN(-fAn*cos(p.Az()), -fAn*sin(p.Az())*tan(p.Alt()));
     423     const AltAz AW( fAw*sin(p.Az()), -fAw*cos(p.Az())*tan(p.Alt()));
     424     p -= AN;
     425     p -= AW;
     426     */
     427
     428    // New Corrections for AN and AW:
     429    TVector3 v(1.,1.,1.); // Vector in cartesian coordinates
     430    // Set Azimuth and Elevation
     431    v.SetPhi(p.Az());
     432    v.SetTheta(TMath::Pi()/2-p.Alt());
     433    // Rotate around the x- and y-axis
     434    v.RotateY(-fAn);
     435    v.RotateX(-fAw);
     436    // Get Azimuth and Elevation
     437    p.Az(v.Phi());
     438    p.Alt(TMath::Pi()/2-v.Theta());
     439
     440
     441    DEBUG(cout << "Back2: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     442
     443    //Old Correction terms for Npae and Ca:
    383444    const AltAz NPAE(0, -fNpae*tan(p.Alt()));
    384445    p -= NPAE;
    385446
    386     DEBUG(cout << "Back2: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
    387 
    388447    const AltAz CA(0, -fCa/cos(p.Alt()));
    389448    p -= CA;
    390449
     450    /*
     451     //New Correction term for Npae and Ca:
     452     TVector3 v2(1.,1.,1.); // Vector in cartesian coordinates
     453     //Set Azimuth and Elevation
     454     v2.SetPhi(p.Az());
     455     v2.SetTheta(TMath::Pi()/2-p.Alt());
     456     //Rotation Vectors:
     457     TVector3 vNpae(             cos(p.Az()),              sin(p.Az()),             0);
     458     TVector3   vCa( -cos(p.Az())*cos(p.Alt()), -sin(p.Az())*cos(p.Alt()), sin(p.Alt()));
     459     //Rotate around the vectors vCa and vNpae
     460     v2.Rotate(-fCa,     vCa);
     461     v2.Rotate(-fNpae, vNpae);
     462
     463     p.Az(v2.Phi());
     464     p.Alt(TMath::Pi()/2-v2.Theta());
     465    */
     466
    391467    DEBUG(cout << "Back3: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
    392 
    393     cout << fAw << " " << cos(p.Az()) << " " << tan(p.Alt()) << endl;
    394     cout << fAw* cos(p.Az())*tan(p.Alt())*180/3.1415 << endl;
    395 
    396     const AltAz AN(-fAn*cos(p.Az()), -fAn*sin(p.Az())*tan(p.Alt()));
    397     const AltAz AW( fAw*sin(p.Az()), -fAw*cos(p.Az())*tan(p.Alt()));
    398     p -= AN;
    399     p -= AW;
    400 
    401     DEBUG(cout << "Back4: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
    402468
    403469    const AltAz TF(Sign(fTf*cos(p.Alt()), p.Alt()), 0);
     
    406472    //p -= TX;
    407473
    408     DEBUG(cout << "Back5: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     474    DEBUG(cout << "Back4: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
    409475
    410476    const AltAz CEC(-fEcec*cos(p.Alt()), -fAcec*cos(p.Az()));
     
    413479    p -= CES;
    414480
    415     DEBUG(cout << "Back6: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     481    DEBUG(cout << "Back5: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
    416482
    417483    const AltAz NRY(fNry*cos(p.Alt()), -fNry*tan(p.Alt()));
     
    420486    p -= NRX;
    421487
    422     DEBUG(cout << "Back7: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     488    DEBUG(cout << "Back6: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
    423489
    424490    const AltAz CRY(-fCry*cos(p.Az()-p.Alt()), -fCry*sin(p.Az()-p.Alt())/cos(p.Alt()));
     
    427493    p -= CRX;
    428494
    429     DEBUG(cout << "Back8: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
     495    DEBUG(cout << "Back7: " << 90-p.Alt()*180/TMath::Pi() << " " << p.Az()*180/TMath::Pi() << endl);
    430496
    431497    return p;
  • trunk/MagicSoft/Cosy/stars.txt

    r2518 r2568  
    1 14 28 33   42 40 21  1ES1426+428
    2 20 00 00   65 08 55  1ES1959+650
    3 12 29 07   02 03 09  3C273
    4 12 56 11  -05 47 22  3C279
     114 28 33   42 40 21  1ES1426+428 (16.45)
     220 00 00   65 08 55  1ES1959+650 (12.8)
     312 29 07   02 03 09  3C273 (12.86)
     412 56 11  -05 47 22  3C279 (17.75)
    5512 54 02   55 57 35  Alioth (1.77)
    6600 08 24   29 05 26  Alpheratz (2.06)
     
    9914 15 40   19 10 57  Arcturus (-0.04)
    101013 47 33   49 18 48  Benetnasch (1.86)
    11 22 02 43   42 16 40  BL-Lac
     1122 02 43   42 16 40  BL-Lac (14.5)
    121200 09 11   59 08 59  Caph (2.27)
    13 12 59 49   27 58 50  Coma Cluster
     1312 59 49   27 58 50  Coma Cluster (10.70)
    141405 34 32   22 00 52  Crab
    15 20 32 26   40 57 28  Cygnus-X3
     1520 32 26   40 57 28  Cygnus-X3 
    161621 45 41   31 43 09  Dark Patch 2
    171720 41 26   45 16 49  Deneb (1.25)
     
    202018 24 10  -34 23 05  Kaus Australis (1.85)
    212105 34 32   22 00 52  M1 (8.4)
    22 22 22 08  -13 51 08  Mars
    232213 23 56   54 55 31  Mizar A (2.23)
    242311 04 26   38 12 36  Markarian-421
  • trunk/MagicSoft/Cosy/tpoint/gui.C

    r2407 r2568  
    647647        const Int_t size = fOriginal.GetSize();
    648648
    649         ifstream fin("../tpoint_new.txt");
     649        ifstream fin("tpoint.txt");
    650650
    651651        while (fin && fin.get()!='\n');
     
    654654        if (!fin)
    655655        {
    656             cout << "File not found!" << endl;
     656            cout << "File 'tpoint.txt' not found!" << endl;
    657657            return;
    658658        }
Note: See TracChangeset for help on using the changeset viewer.