Ignore:
Timestamp:
02/06/03 11:59:10 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtemp/MVPObject.cc

    r1680 r1745  
    113113// HHMMsDDT, where RA is given in hours and minutes and Declination is
    114114// given by degrees DD and tenths of degrees T. "s" may be "+" or
    115 // "-"
    116 //
    117 void MVPObject::SetObjectByName(char* object)
     115// "-", eg. "1959+650"
     116//
     117void MVPObject::SetObjectByName(const char *object)
    118118{
    119119  fObjectName=object;
    120120  fGotName=kTRUE;
    121121 
    122 //   cout<<"OBJ:"<<object<<endl;
    123 
    124   unsigned int delim=0;
    125   for (unsigned int i=0; i<strlen(object); i++)
    126     if ((object[i]=='+')||(object[i]=='-'))
    127       delim=i;
    128  
    129   char ra[6];
    130   char de[6];
    131  
    132   unsigned int i;
    133   for (i=0;  i<=delim; i++)
    134     ra[i]=object[i];
    135   ra[i-1]=0;
    136 
    137   for (i=delim+1;  i<strlen(object); i++)
    138     de[i-delim-1]=object[i];
    139   de[i-delim-1]=0;
    140 
    141   Float_t RA, Dec;
    142 
    143   sscanf(ra,"%f",&RA);
    144   sscanf(de,"%f",&Dec);
    145 
    146 //   cout<<"OBJd:"<<Dec<<endl; //220
    147 //   cout<<"OBJr:"<<RA<<endl; //1959
    148 
    149   if (object[delim]=='-') Dec*=-1;
    150 
    151   fRA=(Double_t)( fgHrsToRad*  ((Int_t)(RA/100) + ( RA-(Int_t)(RA/100)*100)/60        ));
    152   fDec=(Double_t)( fgDegToRad* ((Int_t)(Dec/10) + (Dec-(Int_t)(Dec/10)*10 )/10        ));
    153 
    154  //  fRA=(Double_t)( fgHrsToRad*  ((Int_t)(RA/100)   + ((RA / 100)-(Int_t)(RA/100))/60   ));
    155 //   fDec=(Double_t)( fgDegToRad* ((Int_t)(Dec/10)  + ((Dec / 10)-(Int_t)(Dec/100))/10 ));
    156 
    157 //     cout<<"OBJd:"<<fDec/fgDegToRad<<endl;
    158 //     cout<<"OBJr:"<<fRA/fgHrsToRad<<endl;
     122  Int_t ra, dec;
     123  sscanf(object, "%d%d", &ra, &dec);
     124
     125  fRA  = fgHrsToRad * (0.01*ra + (r%100)/60.);
     126  fDec = fgDegToRad * 0.1 * dec;
    159127
    160128  fGotRA=kTRUE;
Note: See TracChangeset for help on using the changeset viewer.