Changeset 3537


Ignore:
Timestamp:
03/17/04 17:17:14 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3536 r3537  
    1919                                                 -*-*- END OF LINE -*-*-
    2020
     21 2004/03/17: Thomas Bretz
     22
     23   * mastro/MAstroCatalog.[h,cc]:
     24     - some simplifications and changes
     25
     26   * mastro/MAstroCatalog.[h,cc]:
     27     - some simplifications and changes
     28
     29   * mastro/MAstroSky2Local.[h,cc]:
     30     - rotation matrix from sky to local coordinates
     31     - added
     32
     33   * mastro/Makefile, mastro/AstroLinkDef.h:
     34     - MAstroSky2Local added
     35
     36   * mraw/MRawEvtPixelIter.cc:
     37     - GetIdxMaxLoGainSample(const Byte_t lofirst) const
     38       accelerated and fixed (the first slice was compared to itself
     39       and the last slice was not taken into account)
     40
     41
     42
    2143 2004/03/17: Antonio Stamerra
    2244
    2345   * macros/datatrigcheck.C
    2446     - added macro for time and trigger data-checking
     47
    2548
    2649
     
    3659
    3760
     61
    3862 2004/03/17: Wolfgang Wittek
    3963
     
    4569 2004/03/16: Markus Gaug
    4670 
    47   * mhist/MHCamera.[h,cc]
    48     - added function RadialProfile which returns a TProfile of the
    49       value along the radius from the camera center
     71   * mhist/MHCamera.[h,cc]
     72     - added function RadialProfile which returns a TProfile of the
     73       value along the radius from the camera center
     74
    5075
    5176
    5277 2004/03/16: Oscar Blanch Bigas
    5378
    54   * mimage/MConcentration.[h,cc]
    55     - new class for Concentration stuff.
    56     - It computes and stores Concentration 1-8
    57 
    58   * mimage/MNewImagePar.[h,cc]
    59     - New Concentration stuff is moved to MConcentration.
    60 
    61   * mimage/MHillasCalc.[h,cc], Makefile, ImageLinkDef.h
    62     - Modifications needed to support and compile new
    63       MConcentration class.
     79   * mimage/MConcentration.[h,cc]
     80     - new class for Concentration stuff.
     81     - It computes and stores Concentration 1-8
     82
     83   * mimage/MNewImagePar.[h,cc]
     84     - New Concentration stuff is moved to MConcentration.
     85
     86   * mimage/MHillasCalc.[h,cc], Makefile, ImageLinkDef.h
     87     - Modifications needed to support and compile new
     88       MConcentration class.
     89
     90
    6491
    6592 2004/03/16: Thomas Bretz
     
    190217     - added MStatusArray
    191218
    192    * mraw/MRawEvtPixelIter.cc:
    193      - GetIdxMaxLoGainSample(const Byte_t lofirst) const
    194        accelerated and fixed (the first slice was compared to itself
    195        and the last slice was not taken into account)
    196 
    197219   * mhits/MHCamera.[h,cc], mgui/MHexagon.[h,cc]:
    198220     - improved drawing MHCamera with 'same' option
  • trunk/MagicSoft/Mars/mastro/AstroLinkDef.h

    r3402 r3537  
    77#pragma link C++ class MVector3+;
    88
     9#pragma link C++ class MAstro+;
     10#pragma link C++ class MAstroSky2Local+;
     11#pragma link C++ class MAstroCatalog+;
     12//#pragma link C++ class MAstroCamera+;
    913
    10 #pragma link C++ class MAstro+;
    11 #pragma link C++ class MAstroCatalog+;
    1214#pragma link C++ class MObservatory+;
    1315
  • trunk/MagicSoft/Mars/mastro/MAstro.cc

    r3371 r3537  
    3131#include "MAstro.h"
    3232
     33#include <iostream>
     34
    3335#include <TVector3.h> // TVector3
    3436
    3537#include "MTime.h"    // MTime::GetGmst
    3638
     39using namespace std;
     40
    3741ClassImp(MAstro);
    3842
    3943Double_t MAstro::Trunc(Double_t val)
    4044{
    41     /* dint(A) - truncate to nearest whole number towards zero (double) */
     45    // dint(A) - truncate to nearest whole number towards zero (double)
    4246    return val<0 ? TMath::Ceil(val) : TMath::Floor(val);
    4347}
     
    4549Double_t MAstro::Round(Double_t val)
    4650{
    47     /* dnint(A) - round to nearest whole number (double) */
     51    // dnint(A) - round to nearest whole number (double)
    4852    return val<0 ? TMath::Ceil(val-0.5) : TMath::Floor(val+0.5);
    4953}
     
    5761Double_t MAstro::Dms2Rad(Int_t deg, UInt_t min, Double_t sec, Char_t sgn)
    5862{
    59     /* pi/(180*3600):  arcseconds to radians */
     63    // pi/(180*3600):  arcseconds to radians
    6064    //#define DAS2R 4.8481368110953599358991410235794797595635330237270e-6
    6165    return Hms2Sec(deg, min, sec, sgn)*TMath::Pi()/(180*3600)/**DAS2R*/;
     
    6468Double_t MAstro::Hms2Rad(Int_t hor, UInt_t min, Double_t sec, Char_t sgn)
    6569{
    66     /* pi/(12*3600):  seconds of time to radians */
     70    // pi/(12*3600):  seconds of time to radians
    6771//#define DS2R 7.2722052166430399038487115353692196393452995355905e-5
    6872    return Hms2Sec(hor, min, sec, sgn)*TMath::Pi()/(12*3600)/**DS2R*/;
  • trunk/MagicSoft/Mars/mastro/MAstroCamera.cc

    r3525 r3537  
    4949
    5050#include "MTime.h"
     51#include "MAstroSky2Local.h"
    5152#include "../mhist/MHCamera.h"
    5253#include "MObservatory.h"
     
    9798}
    9899
    99 Int_t MAstroCamera::Convert(const TRotation &rot, TVector2 &v, Int_t type)
    100 {
    101     MVector3 w;
    102 
    103     switch (type)
    104     {
    105     case 1:
    106         w.SetRaDec(v.X(), v.Y(), 1);
    107         w = w.GetZdAz(*fTime, *fObservatory);
    108         break;
    109     case 2:
    110         w.SetZdAz(v.Y(), v.X(), 1);
    111         break;
    112     default:
    113         return kFALSE;
    114     }
    115 
    116     w *= rot;
    117 
     100Int_t MAstroCamera::ConvertToPad(const TVector3 &w, TVector2 &v)
     101{
    118102    const TVector3 spot = fMirror0->GetReflection(w, fGeom->GetCameraDist())*1000;
    119103
     
    129113        */
    130114
     115
    131116    v.Set(spot(0), spot(1));
    132117
     
    135120}
    136121
    137 void MAstroCamera::DrawNet(const TRotation &rot)
    138 {
    139     TVector2 radec(fRaDec.Phi(), TMath::Pi()/2-fRaDec.Theta());
    140     MAstroCatalog::DrawNet(radec, rot, 1);
    141 
    142     const TVector3 zdaz0 = fRaDec.GetZdAz(*fTime, *fObservatory);
     122void MAstroCamera::DrawNet(const TRotation &trans)
     123{
     124    const TRotation rot(MAstroSky2Local(*fTime, *fObservatory));
     125
     126    TVector2 radec(fRaDec.Phi(), fRaDec.Theta());
     127    MAstroCatalog::DrawNet(radec, trans*rot, 2);
     128
     129    const TVector3 zdaz0 = MAstroSky2Local(*fTime, *fObservatory)*fRaDec;
    143130    TVector2 zdaz(zdaz0.Phi(), zdaz0.Theta());
    144     MAstroCatalog::DrawNet(zdaz, rot, 2);
     131    MAstroCatalog::DrawNet(zdaz, trans, 1);
    145132}
    146133
     
    185172    const Bool_t usecam  = opt.Contains("c", TString::kIgnoreCase);
    186173
    187     const Float_t rho = fObservatory->RotationAngle(fRaDec.Phi(), TMath::Pi()/2-fRaDec.Theta(), *fTime);
     174    MAstroSky2Local rot(*fTime, *fObservatory);
     175
     176    const Float_t rho = rot.RotationAngle(fRaDec.Phi(), TMath::Pi()/2-fRaDec.Theta());
    188177
    189178    TString str = fTime->GetSqlDateTime();
     
    232221    }
    233222
    234     const TVector3 zdaz0 = fRaDec.GetZdAz(*fTime, *fObservatory);
    235 
    236     TRotation rot;
    237     rot.RotateZ(-zdaz0.Phi());
    238     rot.RotateY(-zdaz0.Theta());
    239     rot.RotateZ(-TMath::Pi()/2); // align coordinate system
    240 
    241     DrawNet(rot);
     223    TVector3 zdaz0 = fRaDec;
     224    zdaz0 *= rot;
     225
     226    cout << zdaz0.Phi()*TMath::RadToDeg() << " " << zdaz0.Theta()*TMath::RadToDeg() << endl;
     227
     228    TVector3 test = zdaz0;
     229    test *= rot.Inverse();
     230
     231    cout << test.Phi()*TMath::RadToDeg()/15 << " " << test.Theta()*TMath::RadToDeg() << endl;
     232
     233    TRotation rot2;
     234    rot2.RotateZ(-zdaz0.Phi());
     235    rot2.RotateY(-zdaz0.Theta());
     236    rot2.RotateZ(-TMath::Pi()/2); // align coordinate system
     237
     238    DrawNet(rot2);
    242239
    243240    MVector3 *radec;
     
    248245        const Double_t mag = radec->Magnitude();
    249246
    250         TVector3 star = radec->GetZdAz(*fTime, *fObservatory);
    251 
     247        TVector3 star(*radec);
     248
     249        // Calculate local coordinates
     250        star *= rot;
    252251        // Rotate Star into telescope system
    253         star *= rot;
     252        star *= rot2;
    254253
    255254        TVector3 mean;
  • trunk/MagicSoft/Mars/mastro/MAstroCamera.h

    r3457 r3537  
    2121    MGeomMirror  *fMirror0;     //!
    2222
    23     Int_t  Convert(const TRotation &rot, TVector2 &v, Int_t type);
     23    Int_t  ConvertToPad(const TVector3 &w, TVector2 &v);
    2424    void   AddPrimitives(Option_t *o);
    2525    void   SetRangePad() { }
  • trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc

    r3525 r3537  
    5252#include "MTime.h"
    5353#include "MAstro.h"
     54#include "MAstroSky2Local.h"
    5455#include "MObservatory.h"
    5556
     
    5960using namespace std;
    6061
     62class MRotation : public TRotation
     63{
     64public:
     65    MRotation(Double_t gmst, const MObservatory &obs) : TRotation(1, 0, 0, 0, -1, 0, 0, 0, 1)
     66    {
     67        RotateZ(gmst + obs.GetElong());
     68        RotateY(obs.GetPhi()-TMath::Pi()/2);
     69        RotateZ(TMath::Pi());
     70    }
     71    MRotation(const MTime &t, const MObservatory &obs) : TRotation(1, 0, 0, 0, -1, 0, 0, 0, 1)
     72    {
     73        RotateZ(t.GetGmst() + obs.GetElong());
     74        RotateY(obs.GetPhi()-TMath::Pi()/2);
     75        RotateZ(TMath::Pi());
     76    }
     77};
     78
     79/*
    6180MVector3 MVector3::GetZdAz(const MObservatory &obs, Double_t gmst) const
    6281{
     
    6483        return MVector3();
    6584
    66     const Double_t alpha = gmst + obs.GetElong();
    67 
    68     MVector3 zdaz;
    69     zdaz.SetZdAz(Theta(), alpha-Phi(), Mag());
    70     zdaz.RotateY(obs.GetPhi()-TMath::Pi()/2);
    71 
    72     return zdaz;
    73 
    74     /*
     85    MVector3 v(*this);
     86    v *= MAstroSky2Local(gmst, obs);
     87
     88    return v;
     89
     90     // ------ Using vectors -------
     91     // v(1) = -v(1);                     //  phi -->      -phi
     92     // v.RotateZ(gmst + obs.GetElong()); // -phi --> alpha-phi
     93     // v.RotateY(obs.GetPhi()-TMath::Pi()/2);
     94     // v.RotateZ(TMath::Pi());
     95
    7596     // ------ The same using slalib, tested in the drive system -------
    76      const Double_t alpha = slaGmst(mjd) + obs.GetElong();
    77      Double_t el;
    78      slaDe2h(fAlpha-ra, dec, obs.GetPhi(), &az, &el);
    79      zd = TMath::Pi()/2-el;
    80      return;
    81      */
     97     // const Double_t alpha = slaGmst(mjd) + obs.GetElong();
     98     // Double_t el;
     99     // slaDe2h(fAlpha-ra, dec, obs.GetPhi(), &az, &el);
     100     // zd = TMath::Pi()/2-el;
    82101}
    83102
     
    92111        return MVector3();
    93112
    94     const Double_t alpha = gmst + obs.GetElong();
    95 
    96113    MVector3 v(*this);
    97     v.RotateY(TMath::Pi()/2-obs.GetPhi());
    98 
    99     MVector3 rd;
    100     rd.SetRaDec(alpha-v.Phi(), TMath::Pi()/2-v.Theta(), Mag());
    101     return rd;
    102 
    103     /*
     114    v *= MAstroSky2Local(gmst, obs).Inverse();
     115
     116    return v;
     117
     118     // ------ Using vectors -------
     119     // v.RotateZ(-TMath::Pi());
     120     // v.RotateY(TMath::Pi()/2-obs.GetPhi());
     121     // v.RotateZ(-gmst - obs.GetElong()); // alpha-phi --> -phi
     122     // v(1) = -v(1);                      //      -phi -->  phi
     123
    104124     // ------ The same using slalib, tested in the drive system -------
    105      const Double_t alpha = slaGmst(mjd) + obs.GetElong();
    106      Double_t el;
    107      slaDe2h(fAlpha-ra, dec, obs.GetPhi(), &az, &el);
    108      zd = TMath::Pi()/2-el;
    109      return;
    110      */
     125     // const Double_t alpha = slaGmst(mjd) + obs.GetElong();
     126     // Double_t el;
     127     // slaDe2h(fAlpha-ra, dec, obs.GetPhi(), &az, &el);
     128     // zd = TMath::Pi()/2-el;
    111129}
    112130
     
    115133    return GetRaDec(obs, time.GetGmst());
    116134}
    117 
     135*/
    118136MAstroCatalog::MAstroCatalog() : fLimMag(99), fRadiusFOV(99), fToolTip(0), fObservatory(0), fTime(0)
    119137{
     
    386404}
    387405
    388 Int_t MAstroCatalog::Convert(const TRotation &rot, TVector2 &v, Int_t type)
    389 {
    390     MVector3 w;
    391 
    392     switch (type)
    393     {
    394     case 1:
    395         w.SetRaDec(v.X()-fRaDec.Phi(), v.Y(), 1);
    396         break;
    397 
    398     case 2:
    399         if (!fTime || !fObservatory)
    400             return kFALSE;
    401         w.SetZdAz(v.Y(), v.X(), 1);
    402         w = w.GetRaDec(*fTime, *fObservatory);
    403         w.RotateZ(-fRaDec.Phi());
    404         break;
    405 
    406     default:
    407         return kFALSE;
    408     }
    409 
    410     w *= rot;
     406void MAstroCatalog::Paint(Option_t *o)
     407{
     408//    if (!gPad->IsBatch())
     409//        gVirtualX->ClearWindow();
     410
     411    if (TestBit(kHasChanged))
     412        DrawPrimitives(o);
     413}
     414
     415void MAstroCatalog::DrawStar(Double_t x, Double_t y, const TVector3 &v, Bool_t transparent, const char *txt)
     416{
     417    const Double_t ra  = v.Phi()*TMath::RadToDeg()/15;
     418    const Double_t dec = (TMath::Pi()/2-v.Theta())*TMath::RadToDeg();
     419
     420    TString str = v.GetName();
     421    str += Form(":  Ra=%.2fh", ra);
     422    str += Form("  Dec=%.1fd", dec);
     423    str += Form("  Mag=%.1f", -2.5*log10(v.Mag()));
     424    if (txt)
     425        str += Form("  (%s)", txt);
     426
     427    // draw star on the camera display
     428    TMarker *tip=new TMarker(x, y, transparent ? kDot : kFullDotLarge);;
     429    tip->SetMarkerColor(kBlack);
     430    tip->SetBit(kCanDelete);
     431    tip->SetBit(kCannotPick);
     432    AddMap(tip, new TString(str));
     433}
     434
     435void MAstroCatalog::Update()
     436{
     437    if (gPad && TestBit(kMustCleanup))
     438    {
     439        SetBit(kHasChanged);
     440        gPad->Modified();
     441    }
     442}
     443
     444void MAstroCatalog::SetTime(const MTime &time)
     445{
     446    if (fTime)
     447        delete fTime;
     448    fTime=(MTime*)time.Clone();
     449}
     450
     451void MAstroCatalog::SetObservatory(const MObservatory &obs)
     452{
     453    if (fObservatory)
     454        delete fObservatory;
     455    fObservatory=(MObservatory*)obs.Clone();
     456}
     457
     458Int_t MAstroCatalog::ConvertToPad(const TVector3 &w0, TVector2 &v)
     459{
     460    TVector3 w(w0);
    411461
    412462    // Stretch such, that the X-component is alwas the same. Now
     
    427477}
    428478
     479Int_t MAstroCatalog::Convert(const TRotation &rot, TVector2 &v)
     480{
     481    MVector3 w;
     482    w.SetMagThetaPhi(1, v.Y(), v.X());
     483    w *= rot;
     484
     485    return ConvertToPad(w, v);
     486}
     487
    429488Bool_t MAstroCatalog::DrawLine(const TVector2 &v, Double_t dx, Double_t dy, const TRotation &rot, Int_t type)
    430489{
     
    434493    TVector2 v1 = v+add;
    435494
    436     const Int_t rc0 = Convert(rot, v0, type);
    437     const Int_t rc1 = Convert(rot, v1, type);
     495    const Int_t rc0 = Convert(rot, v0);
     496    const Int_t rc1 = Convert(rot, v1);
     497
    438498    // Both are kFALSE or both are kERROR
    439499    if ((rc0|rc1)==kFALSE || (rc0&rc1)==kERROR)
     
    449509    const TVector2 deg = v*TMath::RadToDeg();
    450510    TString txt = type==1 ?
    451         Form("Ra=%.1fh  Dec=%.1fd", fmod(deg.X()/15+48, 24),  fmod(deg.Y()+270,180)-90) :
     511        Form("Ra=%.1fh  Dec=%.1fd", fmod(deg.X()/15+48, 24),  fmod(90-deg.Y()+270,180)-90) :
    452512        Form("Zd=%.1fd  Az=%.1fd",  fmod(deg.Y()+270,180)-90, fmod(deg.X()+720, 360));
    453513
     
    461521}
    462522
     523
    463524void MAstroCatalog::Draw(const TVector2 &v0, const TRotation &rot, TArrayI &dx, TArrayI &dy, Int_t stepx, Int_t stepy, Int_t type)
    464525{
    465526    const TVector2 v1 = v0 + TVector2(dx[0]*TMath::DegToRad(), dy[0]*TMath::DegToRad());
    466 
    467     //    if (TMath::Abs(v1.Y())>TMath::Pi()/2)
    468     //        return;
    469 
    470     //    const Int_t v0x = (int)(v0.X()*TMath::RadToDeg());
    471     //    const Int_t v0y = (int)(v0.Y()*TMath::RadToDeg());
    472527
    473528    Int_t idx[] = {1, 1, 1, 1};
     
    501556        {
    502557            // Calculate new position
    503             //dx[0] = (d[0]+dirs[i][0]+540-v0x)%360-180+v0x;
    504             //dy[0] = (d[1]+dirs[i][1]+270-v0y)%180- 90+v0y;
    505558            dx[0] = d[0]+dirs[i][0];
    506559            dy[0] = d[1]+dirs[i][1];
     560
     561            //cout << dx[0] << " " << dy[0] << endl;
    507562
    508563            // Draw corresponding line and iterate through grid
     
    510565                Draw(v0, rot, dx, dy, stepx, stepy, type);
    511566
    512             dx[0]=d[0]; dy[0]=d[1];
     567            dx[0]=d[0];
     568            dy[0]=d[1];
    513569        }
    514570}
     
    516572void MAstroCatalog::DrawNet(const TVector2 &v0, const TRotation &rot, Int_t type)
    517573{
    518     //const Double_t step = TMath::DegToRad();
    519 
    520574    TArrayI dx(1);
    521575    TArrayI dy(1);
     
    527581    // calculate stepsizes based on visible FOV
    528582    Int_t stepx=1;
    529     if (fabs(v.Y())>90-fRadiusFOV || fabs(v.Y())<fRadiusFOV)
     583
     584    if (fabs(90-v.Y())>90-fRadiusFOV || fabs(90-v.Y())<fRadiusFOV)
    530585        stepx = 180/10;
    531586    else
     
    534589        const Float_t m = log(fRadiusFOV/180.)/log(90./fRadiusFOV-1);
    535590        const Float_t t = log(180.)-m*log(fRadiusFOV);
    536         const Int_t n = (Int_t)(exp(m*log(90-fabs(v.Y()))+t)+0.5);
    537         stepx = n<4 ? 1 : n/4;
     591        const Int_t n = (Int_t)(exp(m*log(90-fabs(90-v.Y()))+t)+0.5);
     592        stepx = n<6 ? 1 : n/6;
    538593    }
    539594
     
    556611    // draw...
    557612    v *= TMath::DegToRad();
     613
    558614    Draw(v, rot, dx, dy, stepx, stepy, type);
    559615}
    560616
    561 void MAstroCatalog::Paint(Option_t *o)
    562 {
    563 //    if (!gPad->IsBatch())
    564 //        gVirtualX->ClearWindow();
    565 
    566     if (TestBit(kHasChanged))
    567         DrawPrimitives(o);
    568 }
    569 
    570 void MAstroCatalog::DrawStar(Double_t x, Double_t y, const TVector3 &v, Bool_t transparent, const char *txt)
    571 {
    572     const Double_t ra  = v.Phi()*TMath::RadToDeg()/15;
    573     const Double_t dec = (TMath::Pi()/2-v.Theta())*TMath::RadToDeg();
    574 
    575     TString str = v.GetName();
    576     str += Form(":  Ra=%.1fh", ra);
    577     str += Form("  Dec=%.1fd", dec);
    578     str += Form("  Mag=%.1f", -2.5*log10(v.Mag()));
    579     if (txt)
    580         str += Form("  (%s)", txt);
    581 
    582     // draw star on the camera display
    583     TMarker *tip=new TMarker(x, y, transparent ? kDot : kFullDotLarge);;
    584     tip->SetMarkerColor(kBlack);
    585     tip->SetBit(kCanDelete);
    586     tip->SetBit(kCannotPick);
    587     AddMap(tip, new TString(str));
    588 }
    589 
    590 void MAstroCatalog::Update()
    591 {
    592     if (gPad && TestBit(kMustCleanup))
    593     {
    594         SetBit(kHasChanged);
    595         gPad->Modified();
    596     }
    597 }
    598 
    599 void MAstroCatalog::SetTime(const MTime &time)
    600 {
    601     if (fTime)
    602         delete fTime;
    603     fTime=(MTime*)time.Clone();
    604 }
    605 
    606 void MAstroCatalog::SetObservatory(const MObservatory &obs)
    607 {
    608     if (fObservatory)
    609         delete fObservatory;
    610     fObservatory=(MObservatory*)obs.Clone();
    611 }
    612 
    613617void MAstroCatalog::AddPrimitives(Option_t *o)
    614618{
    615     const Double_t ra  = fRaDec.Phi();
    616     const Double_t dec = TMath::Pi()/2-fRaDec.Theta();
    617 
    618619    // Precalc Sin/Cos...
    619620    TRotation trans;
    620     trans.Rotate(dec, TVector3(0, 1, 0));
    621 
    622     const TVector3 zdaz0 = fRaDec.GetZdAz(*fTime, *fObservatory);
    623     TVector2 zdaz(zdaz0.Phi(), zdaz0.Theta());
    624     MAstroCatalog::DrawNet(zdaz, trans, 2);
    625 
    626     TVector2 radec(ra, dec);
    627     MAstroCatalog::DrawNet(radec, trans, 1);
     621    trans.RotateZ(-fRaDec.Phi());
     622    trans.Rotate(TMath::Pi()/2-fRaDec.Theta(), TVector3(0, 1, 0));
     623
     624    if (fTime && fObservatory)
     625    {
     626        const TRotation rot(MAstroSky2Local(*fTime, *fObservatory));
     627        const TVector3 zdaz0 = rot*fRaDec;
     628        const TVector2 zdaz(zdaz0.Phi(), zdaz0.Theta());
     629        DrawNet(zdaz, trans*rot.Inverse(), 2);
     630    }
     631
     632    const TVector2 radec(fRaDec.Phi(), fRaDec.Theta());
     633    DrawNet(radec, trans, 1);
    628634
    629635    TIter Next(&fList);
     
    632638    {
    633639        // FIXME: Check Magnitude!
    634         TVector2 s(v->Phi(), TMath::Pi()/2-v->Theta());
    635         if (Convert(trans, s, 1)==kTRUE)
    636             DrawStar(s.X(), s.Y(), *v, kFALSE);
     640        TVector2 s(v->Phi(), v->Theta());
     641        if (Convert(trans, s)==kTRUE)
     642            DrawStar(s.X(), TMath::Pi()/2-s.Y(), *v, kFALSE);
    637643    }
    638644}
  • trunk/MagicSoft/Mars/mastro/MAstroCatalog.h

    r3525 r3537  
    6262
    6363    const char *GetName() const { return fName; }
    64 
     64/*
    6565    MVector3 GetZdAz(const MObservatory &obs, Double_t gmst) const;
    6666    MVector3 GetZdAz(const MTime &time, MObservatory &obs) const;
    6767    MVector3 GetRaDec(const MObservatory &obs, Double_t gmst) const;
    6868    MVector3 GetRaDec(const MTime &time, MObservatory &obs) const;
    69 
     69  */
    7070    ClassDef(MVector3, 1)
    7171};
     
    106106    MTime        *fTime;        // Possible observation time
    107107
    108     virtual Int_t  Convert(const TRotation &rot, TVector2 &v, Int_t type=0);
     108    virtual Int_t  ConvertToPad(const TVector3 &w, TVector2 &v);
     109    virtual Int_t  Convert(const TRotation &rot, TVector2 &v);
    109110    virtual Bool_t DrawLine(const TVector2 &v0, Double_t dx, Double_t dy, const TRotation &rot, Int_t type);
    110111    virtual void   AddPrimitives(Option_t *o);
  • trunk/MagicSoft/Mars/mastro/MAstroSky2Local.cc

    r3535 r3537  
    5454//
    5555//   v *= MAstroSky2Local(time, obs).Inverse();
     56//
     57// Reminder: This tranformation only does a simple coordinate
     58//           transformation. It completely ignores all other atrometric
     59//           effects, like nutation, abberation, precission, ...
    5660//
    5761////////////////////////////////////////////////////////////////////////////
  • trunk/MagicSoft/Mars/mastro/Makefile

    r3402 r3537  
    2222#  connect the include files defined in the config.mk file
    2323#
    24 INCLUDES =  -I. -I../mbase
     24INCLUDES =  -I. -I../mbase -I../mgeom
    2525
    26 # mgui (MCamEvent):         MExtractSignalCam
    27 # mgeom(MGeomCam):          MArrivalTime
    28 # mtools(MCubicSpline):     MArrivalTime
    29 # mraw (MRawEvtData):       MExtractSignal
    30 # manalysis (MPedestalCam): MExtractSignal
     26# mgeom (MAstroCamera): MGeomCam, MGeomMirror
    3127
    3228#------------------------------------------------------------------------------
     
    3531
    3632SRCFILES = MAstro.cc \
     33           MAstroSky2Local.cc \
    3734           MAstroCatalog.cc \
    3835           MObservatory.cc
     36#           MAstroCamera.cc \
    3937
    4038SRCS    = $(SRCFILES)
  • trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc

    r3495 r3537  
    239239    return -1; // means: not found
    240240 
    241   Byte_t *ptr = fLoGainPos+lofirst;
    242   Byte_t *max = ptr;
    243   const Byte_t *end = fLoGainPos + fNumLoGainSamples;
     241  Byte_t *max = fLoGainPos+lofirst;
     242  Byte_t *ptr = max+1;
     243
     244  const Byte_t *end = fLoGainPos + fNumLoGainSamples + 1;
    244245 
    245246  do if (*ptr>*max) max = ptr;
Note: See TracChangeset for help on using the changeset viewer.