Changeset 4521 for trunk/MagicSoft/Mars/mastro
- Timestamp:
- 08/06/04 10:13:59 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mastro
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc
r4517 r4521 287 287 Int_t MAstroCatalog::ReadXephem(TString catalog) 288 288 { 289 SetBit(kHasChanged);290 291 289 gLog << inf << "Reading Xephem catalog: " << catalog << endl; 292 290 … … 354 352 dec0 *= TMath::Pi()/180; 355 353 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++; 368 356 } 369 357 gLog << inf << "Read " << add << " out of " << cnt << " (Total max mag=" << maxmag << ")" << endl; … … 380 368 Int_t MAstroCatalog::ReadNGC2000(TString catalog) 381 369 { 382 SetBit(kHasChanged);383 384 370 gLog << inf << "Reading NGC2000 catalog: " << catalog << endl; 385 371 … … 429 415 const Double_t dec = MAstro::Dms2Rad(decd, decm, 0, decs); 430 416 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++; 442 419 } 443 420 … … 455 432 Int_t MAstroCatalog::ReadBSC(TString catalog) 456 433 { 457 SetBit(kHasChanged);458 459 434 gLog << inf << "Reading Bright Star Catalog (BSC5) catalog: " << catalog << endl; 460 435 … … 506 481 const Double_t dec = MAstro::Dms2Rad(decd, decm, decs, decsgn); 507 482 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++; 519 485 } 520 486 … … 538 504 Int_t MAstroCatalog::ReadHeasarcPPM(TString catalog, TString outname) 539 505 { 540 SetBit(kHasChanged);541 542 506 gLog << inf << "Reading Heasarc PPM catalog: " << catalog << endl; 543 507 … … 620 584 const Double_t de0 = MAstro::Dms2Rad(d, m, s, sgn); 621 585 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 632 589 add++; 633 590 634 591 if (fout) 635 star->WriteBinary(*fout);592 ((MVector3*)fList.Last())->WriteBinary(*fout); 636 593 } 637 594 … … 698 655 // -------------------------------------------------------------------------- 699 656 // 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 // 660 Bool_t MAstroCatalog::AddObject(Float_t ra, Float_t dec, Float_t mag, TString name) 661 { 662 MVector3 *star = new MVector3; 707 663 star->SetRaDec(ra, dec, mag); 708 664 star->SetName(name); 709 665 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); 716 674 return 1; 717 675 } -
trunk/MagicSoft/Mars/mastro/MAstroCatalog.h
r4518 r4521 175 175 Int_t ReadHeasarcPPM(TString catalog = "heasarc_ppm.tdat", TString fout=""); 176 176 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=""); 178 178 179 179 void Print(Option_t *o="") const { fList.Print(); } // Print all stars
Note:
See TracChangeset
for help on using the changeset viewer.