Changeset 4521


Ignore:
Timestamp:
08/06/04 10:13:59 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r4520 r4521  
    2121
    2222
     23 2004/08/05: Thomas Bretz
     24
     25   * mastro/MAstroCatalog.[h,cc]:
     26     - changed return type of AddObject to Bool_t
     27     - changed Reading member function to use AddObject
     28
     29
     30
    2331 2004/08/05: Robert Wagner
    2432
     
    2634     - Added MAstroCatalog::AddObject, functionality to insert single
    2735       objects manually; needed for mtemp/mmpi/MSourceDirections
     36
    2837
    2938
  • trunk/MagicSoft/Mars/Makefile.conf.general

    r4020 r4521  
    1818#   export MARSLIBS="-lX11 -lXpm -L/usr/X11R6/lib"
    1919#
    20 DEFINES  = -DMARSVER=\"\<cvs\>\" -D__MARS__ -DROOTVER=\"$(ROOTVER)\" $(ARCHDEF) $(MARSDEFINES)
     20DEFINES  = -DMARSVER=\"0.8.5\" -D__MARS__ -DROOTVER=\"$(ROOTVER)\" $(ARCHDEF) $(MARSDEFINES)
    2121
    2222CXXFLAGS = $(ROOTCFLAGS) $(INCLUDES) $(OPTIM) $(DEBUG) $(DEFINES)
  • trunk/MagicSoft/Mars/NEWS

    r4516 r4521  
    66
    77
    8  *** Version <cvs>
     8 *** Version 0.8.5 (2004/08/06)
    99 
    1010   - new Signal Extractors: MExtractFixedWindowSpline
     
    3333
    3434   - Added mean values to MPedPhotCam
     35
     36   - Added Makefile for Darwin (this OS is NOT officially supported!)
    3537
    3638
  • trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc

    r4517 r4521  
    287287Int_t MAstroCatalog::ReadXephem(TString catalog)
    288288{
    289     SetBit(kHasChanged);
    290 
    291289    gLog << inf << "Reading Xephem catalog: " << catalog << endl;
    292290
     
    354352        dec0 *= TMath::Pi()/180;
    355353
    356         MVector3 *star=new MVector3;
    357         star->SetRaDec(ra0, dec0, mag);
    358         star->SetName(name);
    359 
    360         if (star->Angle(fRaDec)*TMath::RadToDeg()>fRadiusFOV)
    361         {
    362             delete star;
    363             continue;
    364         }
    365 
    366         fList.Add(star);
    367         add++;
     354        if (AddObject(ra0, dec0, mag, name))
     355            add++;
    368356    }
    369357    gLog << inf << "Read " << add << " out of " << cnt << " (Total max mag=" << maxmag << ")" << endl;
     
    380368Int_t MAstroCatalog::ReadNGC2000(TString catalog)
    381369{
    382     SetBit(kHasChanged);
    383 
    384370    gLog << inf << "Reading NGC2000 catalog: " << catalog << endl;
    385371
     
    429415        const Double_t dec = MAstro::Dms2Rad(decd, decm, 0, decs);
    430416
    431         MVector3 *star=new MVector3;
    432         star->SetRaDec(ra, dec, mag);
    433         star->SetName(row(0, 8));
    434         if (star->Angle(fRaDec)*TMath::RadToDeg()>fRadiusFOV)
    435         {
    436             delete star;
    437             continue;
    438         }
    439 
    440         fList.Add(star);
    441         add++;
     417        if (AddObject(ra, dec, mag, row(0,8)))
     418            add++;
    442419    }
    443420
     
    455432Int_t MAstroCatalog::ReadBSC(TString catalog)
    456433{
    457     SetBit(kHasChanged);
    458 
    459434    gLog << inf << "Reading Bright Star Catalog (BSC5) catalog: " << catalog << endl;
    460435
     
    506481        const Double_t dec = MAstro::Dms2Rad(decd, decm, decs, decsgn);
    507482
    508         MVector3 *star=new MVector3;
    509         star->SetRaDec(ra, dec, mag);
    510         star->SetName(row(4,9));
    511         if (star->Angle(fRaDec)*TMath::RadToDeg()>fRadiusFOV)
    512         {
    513             delete star;
    514             continue;
    515         }
    516 
    517         fList.Add(star);
    518         add++;
     483        if (AddObject(ra, dec, mag, row(4,9)))
     484            add++;
    519485    }
    520486
     
    538504Int_t MAstroCatalog::ReadHeasarcPPM(TString catalog, TString outname)
    539505{
    540     SetBit(kHasChanged);
    541 
    542506    gLog << inf << "Reading Heasarc PPM catalog: " << catalog << endl;
    543507
     
    620584        const Double_t de0 = MAstro::Dms2Rad(d, m, s, sgn);
    621585
    622         MVector3 *star=new MVector3;
    623         star->SetRaDec(ra0, de0, mag);
    624         star->SetName(name);
    625         if (star->Angle(fRaDec)*TMath::RadToDeg()>fRadiusFOV)
    626         {
    627             delete star;
    628             continue;
    629         }
    630 
    631         fList.Add(star);
     586        if (!AddObject(ra0, de0, mag, name))
     587            continue;
     588
    632589        add++;
    633590
    634591        if (fout)
    635             star->WriteBinary(*fout);
     592            ((MVector3*)fList.Last())->WriteBinary(*fout);
    636593    }
    637594
     
    698655// --------------------------------------------------------------------------
    699656//
    700 // Add an object to the star catalog manually.
    701 //
    702 Int_t MAstroCatalog::AddObject(Float_t ra, Float_t dec, Float_t mag, TString name)
    703 {
    704     SetBit(kHasChanged);
    705 
    706     MVector3 *star = new MVector3();
     657// Add an object to the star catalog manually. Return true if the object
     658// was added and false otherwise (criteria is the FOV)
     659//
     660Bool_t MAstroCatalog::AddObject(Float_t ra, Float_t dec, Float_t mag, TString name)
     661{
     662    MVector3 *star = new MVector3;
    707663    star->SetRaDec(ra, dec, mag);
    708664    star->SetName(name);
    709665
    710     if (star->Angle(fRaDec)*TMath::RadToDeg()<=fRadiusFOV) {
    711       fList.Add(star);
    712     } else {
    713       delete(star);
    714     }
    715    
     666    if (star->Angle(fRaDec)*TMath::RadToDeg()>fRadiusFOV)
     667    {
     668        delete star;
     669        return 0;
     670    }
     671
     672    SetBit(kHasChanged);
     673    fList.AddLast(star);
    716674    return 1;
    717675}
  • trunk/MagicSoft/Mars/mastro/MAstroCatalog.h

    r4518 r4521  
    175175    Int_t ReadHeasarcPPM(TString catalog = "heasarc_ppm.tdat", TString fout="");
    176176    Int_t ReadCompressed(TString catalog);
    177     Int_t AddObject(Float_t ra, Float_t dec, Float_t mag, TString name="");
     177    Bool_t AddObject(Float_t ra, Float_t dec, Float_t mag, TString name="");
    178178
    179179    void Print(Option_t *o="") const { fList.Print(); } // Print all stars
Note: See TracChangeset for help on using the changeset viewer.