Changeset 1530 in Sophya for trunk/ArchTOIPipe
- Timestamp:
- Jun 14, 2001, 7:53:29 PM (24 years ago)
- Location:
- trunk/ArchTOIPipe
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/ProcWSophya/map2toi.cc
r1520 r1530 15 15 Map2TOI::~Map2TOI() 16 16 { 17 } 18 19 //////////////////////////////////////////////////////////////////////// 20 void Map2TOI::Print(ostream & os) 21 { 22 os<<"Map2TOI::Print -- Sphere NLat = "<<mSph.SizeIndex()<<endl 23 24 <<" - Equinoxe="<<mActualYear<<endl 25 26 <<" - TypCoorIn: Gal("<<((mTypCoorIn&TypCoordGal)?1:0) 27 <<") Eq("<<((mTypCoorIn&TypCoordEq)?1:0) 28 <<") Deg("<<((mTypCoorIn&TypCoordDD)?1:0) 29 <<") Hour("<<((mTypCoorIn&TypCoordHD)?1:0) 30 <<") Rad("<<((mTypCoorIn&TypCoordRR)?1:0)<<")"<<endl 31 32 <<" - TypCoorMap: Gal("<<((mTypCoorMap&TypCoordGal)?1:0) 33 <<") Eq("<<((mTypCoorMap&TypCoordEq)?1:0) 34 <<") Deg("<<((mTypCoorMap&TypCoordDD)?1:0) 35 <<") Hour("<<((mTypCoorMap&TypCoordHD)?1:0) 36 <<") Rad("<<((mTypCoorMap&TypCoordRR)?1:0)<<")"<<endl; 17 37 } 18 38 -
trunk/ArchTOIPipe/ProcWSophya/map2toi.h
r1520 r1530 42 42 inline void SetCoorMap(TypAstroCoord mfg=TypCoordGalStd) 43 43 {mTypCoorMap = mfg;} 44 // Print 45 void Print(ostream & os); 44 46 45 47 protected: -
trunk/ArchTOIPipe/ProcWSophya/toi2map.cc
r1520 r1530 12 12 SetCoorIn(); 13 13 SetCoorOut(); 14 SetTestFlag(); 15 SetTestMin(); 16 SetTestMax(); 14 17 15 18 if(mSph->NbPixels()<1) { … … 40 43 { 41 44 if(mWSph && !mWSphInternal) delete mWSph; 45 } 46 47 //////////////////////////////////////////////////////////////////////// 48 void TOI2Map::Print(ostream & os) 49 { 50 os<<"TOI2Map::Print -- Sphere NLat = "<<mSph->SizeIndex()<<endl 51 52 <<" - Equinoxe="<<mActualYear<<endl 53 54 <<" - TypCoorIn: Gal("<<((mTypCoorIn&TypCoordGal)?1:0) 55 <<") Eq("<<((mTypCoorIn&TypCoordEq)?1:0) 56 <<") Deg("<<((mTypCoorIn&TypCoordDD)?1:0) 57 <<") Hour("<<((mTypCoorIn&TypCoordHD)?1:0) 58 <<") Rad("<<((mTypCoorIn&TypCoordRR)?1:0)<<")"<<endl 59 60 <<" - TypCoorOut: Gal("<<((mTypCoorOut&TypCoordGal)?1:0) 61 <<") Eq("<<((mTypCoorOut&TypCoordEq)?1:0) 62 <<") Deg("<<((mTypCoorOut&TypCoordDD)?1:0) 63 <<") Hour("<<((mTypCoorOut&TypCoordHD)?1:0) 64 <<") Rad("<<((mTypCoorOut&TypCoordRR)?1:0)<<")"<<endl 65 66 <<" - Tests: Flag("<<mTFlag<<") bad="<<mBadFlag 67 <<" / Value Min("<<mTMin<<")="<<mValMin 68 <<" , Max("<<mTMax<<")="<<mValMax<<endl; 42 69 } 43 70 … … 92 119 93 120 getData(2,s,bolo,fgbolo); 94 if(bolo<-32767.) continue; // Bidouille (A CORRIGER QUAND FGBOLO DISPO) 121 if(mTFlag && fgbolo&mBadFlag) continue; 122 if(mTMin && bolo<mValMin) continue; 123 if(mTMax && bolo>mValMax) continue; 95 124 96 125 // sphere phi entre [0,2*Pi] en radians … … 115 144 int_4 ipix = mSph->PixIndexSph(theta,phi); 116 145 (*mSph)(ipix) += bolo; 117 ((*mWSph)(ipix)) ++;146 ((*mWSph)(ipix)) += 1; 118 147 mNSnFill++; 119 148 } -
trunk/ArchTOIPipe/ProcWSophya/toi2map.h
r1520 r1530 3 3 #define TOI2MAP_H 4 4 5 #include "toiprocessor.h" 5 6 #include "toiprocessor.h" 6 7 #include "spherehealpix.h" … … 41 42 inline void SetCoorOut(TypAstroCoord mfg=TypCoordGalStd) 42 43 {mTypCoorOut = mfg;} 44 // Test on flag value ? if yes, BAD sample have flag matching mBadFlag 45 inline void SetTestFlag(bool tflg=false, int_8 badflg=0) 46 {mTFlag = tflg; mBadFlag = badflg;} 47 // Test on min value ? if yes, GOOD sample have value >= mValMin 48 // Test on max value ? if yes, GOOD sample have value <= mValMax 49 // Good values are (mValMin <= sample value <= mValMax) 50 // bounds are included 51 inline void SetTestMin(bool tmin=false, r_8 vmin=-1.e30) 52 {mTMin = tmin; mValMin = vmin;} 53 inline void SetTestMax(bool tmax=false, r_8 vmax=+1.e30) 54 {mTMax = tmax; mValMax = vmax;} 55 // Print 56 void Print(ostream & os); 43 57 44 58 protected: … … 46 60 SphereHEALPix<r_8>* mWSph; 47 61 bool mWSphInternal; 62 48 63 TypAstroCoord mTypCoorIn, mTypCoorOut; 49 64 double mActualYear; 65 66 bool mTFlag,mTMin,mTMax; 67 int_8 mBadFlag; 68 r_8 mValMin,mValMax; 50 69 }; 51 70 -
trunk/ArchTOIPipe/TestPipes/tstmap2toi.cc
r1520 r1530 137 137 138 138 FITSTOIWriter wfits(fitsout); 139 wfits.setOutFlags(true);139 //wfits.setOutFlags(true); 140 140 cout << "fits reader and writer created"<<endl; 141 141 … … 153 153 m2toi.SetCoorIn((TypAstroCoord) tcoorin); 154 154 m2toi.SetCoorMap((TypAstroCoord) tcoormap); 155 m2toi.Print(cout); 155 156 156 157 // Definition des tuyaux -
trunk/ArchTOIPipe/TestPipes/tsttoi2map.cc
r1520 r1530 20 20 <<" [-a label_coord1] [-d label_coord2] [-b label_bolomuv]"<<endl 21 21 <<" [-n nlat] [-i c,h] [-o c,h]"<<endl 22 <<" [-m vmin] [-M vmax] [-f flag]"<<endl 22 23 <<" fitsin_point fitsin_bolo fitsphout [fitsphwout]"<<endl 23 24 <<" -p lp : print level (def=0)"<<endl … … 29 30 <<" -b label_bolomuv : label fits for bolo value (def=boloMuV)"<<endl 30 31 <<" -n nlat : nlat for Healpix sphere (def=128)"<<endl 31 <<" -i c,h : coordIn caracteristics (c=G/E h=H/D ) (def=G,D)"<<endl32 <<" -i c,h : coordIn caracteristics (c=G/E h=H/D/R) (def=G,D)"<<endl 32 33 <<" -o c,h : idem -i for coordOut"<<endl 34 <<" -m vmin : samples are good if sample value >= vmin"<<endl 35 <<" -M vmax : samples are good if sample value <= vmax"<<endl 36 <<" -f flag : samples are bad if match flag"<<endl 33 37 <<" fitsin_point : fits file for pointing"<<endl 34 38 <<" fitsin_bolo : fits file for bolo values"<<endl … … 40 44 unsigned long typecoord(char typc,char hd) 41 45 // typc : G=galactiques, E=equatoriales, autres=galactiques 42 // hd : H=heure, D=degre, autres=(heure si typc==E, degre si typc==G)46 // hd : H=heure, D=degre, R=radian, autres=(heure si typc==E, degre si typc==G) 43 47 { 44 48 if(typc!='G' && typc!='E') typc='G'; 45 if(hd!='H' && hd!='D' ) {if(typc=='E') hd='H'; else hd='D';}49 if(hd!='H' && hd!='D' && hd!='R') {if(typc=='E') hd='H'; else hd='D';} 46 50 unsigned long rc=TypCoordUndef; 47 51 if(typc=='G') rc |= TypCoordGal; 48 52 else rc |= TypCoordEq; 49 if(hd=='D') rc |= TypCoordDD; 50 else rc |= TypCoordHD; 53 if(hd=='D') rc |= TypCoordDD; 54 else if(hd=='R') rc |= TypCoordRR; 55 else rc |= TypCoordHD; 51 56 return rc; 52 57 } … … 60 65 int lp = 0, width = 8192; 61 66 int nlat = 128; // npixel = 12 * nlat^2 62 char *label_coord1 = "coord1", *label_coord2 = "coord2", *label_bolomuv = "boloMuV"; 67 bool tflg=false, tmin=false, tmax=false; 68 r_8 vmin=-1.e30, vmax=1.e30; int_8 badflg=0; 69 char *label_coord1 = "coord1", *label_coord2 = "coord2" 70 , *label_bolomuv = "boloMuV"; 63 71 long sdeb,sfin; 64 72 string fitsphwout = ""; 65 73 unsigned long tcoorin=typecoord(), tcoorout=typecoord(); 66 74 int c; char t=' ',h=' '; 67 while((c = getopt(narg,arg,"hp:s:w:a:d:b:n:i:o: ")) != -1) {75 while((c = getopt(narg,arg,"hp:s:w:a:d:b:n:i:o:m:M:f:")) != -1) { 68 76 switch (c) { 69 77 case 's' : … … 103 111 tcoorout=typecoord(t,h); 104 112 break; 113 case 'm' : 114 sscanf(optarg,"%lf",&vmin); 115 tmin = true; 116 break; 117 case 'M' : 118 sscanf(optarg,"%lf",&vmax); 119 tmax = true; 120 break; 121 case 'f' : 122 sscanf(optarg,"%ld",&badflg); 123 tflg = true; 124 break; 105 125 case 'h' : 106 126 default: … … 116 136 if(optind+3<narg) fitsphwout = arg[optind+3]; 117 137 118 {119 unsigned long tg,te,hd,dd;120 138 cout<<">>>> tsttoi2map:"<<endl 121 139 <<"Pipe Window Size "<<width<<endl 122 140 <<"Fits Infile Bolo "<<fitsin_bolo<<endl 123 141 <<" ...label_bolomuv "<<label_bolomuv<<endl; 124 tg = tcoorin&TypCoordGal; te = tcoorin&TypCoordEq;125 hd = tcoorin&TypCoordHD; dd = tcoorin&TypCoordDD;126 142 cout<<"Fits Infile Pointing "<<fitsin_point<<endl 127 143 <<" ...label_coord1 "<<label_coord1<<endl 128 <<" ...label_coord2 "<<label_coord2<<endl 129 <<" ...... Gal="<<tg<<" Eq="<<te<<" hour="<<hd<<" deg="<<dd<<endl; 130 tg = tcoorout&TypCoordGal; te = tcoorout&TypCoordEq; 131 hd = tcoorout&TypCoordHD; dd = tcoorout&TypCoordDD; 144 <<" ...label_coord2 "<<label_coord2<<endl; 132 145 cout<<"Fits Healpix Sphere "<<fitsphout<<endl 133 <<" ...nlat "<<nlat<<endl 134 <<" ...... Gal="<<tg<<" Eq="<<te<<" hour="<<hd<<" deg="<<dd<<endl; 146 <<" ...nlat "<<nlat<<endl; 135 147 cout<<"Fits Healpix Weight Sphere "<<fitsphwout<<endl; 136 }137 148 138 149 SophyaInit(); … … 157 168 SphereHEALPix<r_8>* sph = new SphereHEALPix<r_8>(nlat); 158 169 cout<<"SphereHEALPix: Type de map : "<<sph->TypeOfMap()<<endl 159 <<" Nombre de pixels : "<<sph->NbPixels()<<endl; 170 <<" Nombre de pixels : "<<sph->NbPixels()<<endl 171 <<" Nlat : "<<sph->SizeIndex()<<endl; 160 172 161 173 // Creation de la sphere de poids Healpix … … 163 175 if(fitsphwout.size()>0) { 164 176 wsph = new SphereHEALPix<r_8>; 165 cout<<"SphereHEALPix Weight: Type de map : "<<wsph->TypeOfMap()<<endl 166 <<" Nombre de pixels : "<<wsph->NbPixels()<<endl; 177 cout<<"SphereHEALPix Weight Created"<<endl; 167 178 } 168 179 … … 173 184 toi2m.SetCoorIn((TypAstroCoord) tcoorin); 174 185 toi2m.SetCoorOut((TypAstroCoord) tcoorout); 186 toi2m.SetTestFlag(tflg,badflg); 187 toi2m.SetTestMin(tmin,vmin); 188 toi2m.SetTestMax(tmax,vmax); 189 toi2m.Print(cout); 175 190 176 191 // Definition des tuyaux
Note:
See TracChangeset
for help on using the changeset viewer.