Changeset 423 in Sophya for trunk/Poubelle/archTOI.old/templocator.cc
- Timestamp:
- Sep 23, 1999, 4:26:26 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Poubelle/archTOI.old/templocator.cc
r419 r423 4 4 #include "aa_hadec.h" 5 5 } 6 7 #include "fitsio.h" 8 #include "plgalcross.h" 6 9 7 10 #ifndef M_PI … … 14 17 { 15 18 lon = lat = ts = 0; 19 ra = dec = -99999; 20 xSampleNum = -99999; 21 fitsfile* fptr; 22 int status=0; 23 fits_open_file(&fptr, "samplenum_gal_cross.fits", READONLY, &status); 24 int simple, bitpix, naxis; 25 long naxes; 26 long pcount, gcount; 27 int extend; 28 fits_read_imghdr(fptr, 1, &simple, &bitpix, &naxis, &naxes, &pcount, &gcount, &extend, &status); 29 nGalCross = naxes; 30 crossings = new long[nGalCross]; 31 int anynul; 32 fits_read_img_lng(fptr, 0, 1, nGalCross, 0, crossings, &anynul, &status); 33 fits_close_file(fptr, &status); 34 fits_report_error(stderr, status); /* print out any error messages */ 35 } 36 37 38 void TempLocator::setEarthPos(double lon, double lat) { 39 if (this->lon == lon && this->lat == lat) return; 40 this->lon = lon; 41 this->lat = lat; 42 ra = dec = -99999; xSampleNum = -99999; 16 43 } 17 44 18 void TempLocator::setEarthPos(double lon, double lat) { 19 this->lon = lon; 20 this->lat = lat; 45 void TempLocator::setTSid(double ts) { 46 if (this->ts == ts) return; 47 this->ts = ts; 48 ra = dec = -99999; xSampleNum = -99999; 21 49 } 22 void TempLocator::setTSid(double ts) { 23 this->ts = ts; 50 51 void TempLocator::ComputeZenith() { 52 double ha; 53 aa_hadec (lat * M_PI/180, .5 * M_PI, 0, &ha, &dec); 54 ra = - (ha * 180. / M_PI / 15) + (ts/3600.); 55 dec = dec * 180. / M_PI; 24 56 } 25 57 26 58 double TempLocator::getAlphaZenith() { 27 double ha, dec; 28 aa_hadec (lat * M_PI/180, .5 * M_PI, 0, &ha, &dec); 29 double ra = - (ha * 180. / M_PI / 15) + (ts/3600.); 30 //dec = dec * 180. / M_PI; 59 if (ra < -100) ComputeZenith(); 31 60 return ra; 32 61 } 33 62 34 63 double TempLocator::getDeltaZenith() { 35 double ha, dec; 36 aa_hadec (lat * M_PI/180, .5 * M_PI, 0, &ha, &dec); 37 //double ra = - (ha * 180. / M_PI / 15) + (ts/3600.); 38 dec = dec * 180. / M_PI; 64 if (dec < -100) ComputeZenith(); 39 65 return dec; 40 66 } 41 67 68 void TempLocator::findGeomFromGC(int sampleNum) // pour le bolo qui voit les xing 69 { 70 if (sampleNum == xSampleNum) return; 71 if (dec < -100) ComputeZenith(); 72 73 azimBolGC = -9999; 74 75 // On trouve les croisements juste avant et juste apres notre sampleNum 76 int icross; 77 for (icross=0; icross<nGalCross; icross++) { 78 if (crossings[icross] > sampleNum) break; 79 } 80 if (icross == 0 || icross >= nGalCross) return; 81 82 83 } 42 84 85 86 // ; 87 // ; /\ 4 2 88 // ; elevation || positive scanning, clockwise 89 // ; || 6 1 5 ----------> 90 // ; || == positive azimut 91 // ; || x 3 92 // |----| = 0.78 deg / cos(elev) 93 // bol 1 = 41° elevation 94
Note:
See TracChangeset
for help on using the changeset viewer.