Changeset 1176 in Sophya
- Timestamp:
- Sep 4, 2000, 11:17:21 AM (25 years ago)
- Location:
- trunk/SophyaExt/FitsIOServer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/fitsspherehealpix.cc
r1174 r1176 1 1 #include "pexceptions.h" 2 2 #include "fitsspherehealpix.h" 3 3 #include "tarray.h" 4 #include "fitstarray.h" 4 5 5 6 … … 198 199 } 199 200 201 template <class T> 202 void FITS_SphereHEALPix<T>::Mollweide_picture_projection(char filename[]) 203 { 204 int ni = 300; 205 int nj = 600; 206 TMatrix<float> map(ni, nj); 207 208 int i,j; 209 for(i=0; i < ni; i++) 210 { 211 double yd = (i+0.5)/ni-0.5; 212 double facteur=2.*Pi/sin(acos(yd*2)); 213 double theta = (0.5-yd)*Pi; 214 for(j=0; j < nj; j++) 215 { 216 double xa = (j+0.5)/nj-0.5; 217 double phi = xa*facteur+Pi; 218 float th=float(theta); 219 float ff=float(phi); 220 if (phi<2*Pi && phi>= 0) 221 { 222 map(i,j) = (float)dobj_->PixValSph(th, ff); 223 } 224 } 225 } 226 FitsOutFile fout(filename); 227 fout.firstImageOnPrimaryHeader(); 228 FITS_TArray<r_4> fta(map); 229 fta.Write(fout); 230 231 } 232 template <class T> 233 void FITS_SphereHEALPix<T>::sinus_picture_projection(char filename[]) 234 { 235 int ni = 300; 236 int nj = 600; 237 TMatrix<float> map(ni, nj); 238 239 int i,j; 240 for(i=0; i < ni; i++) 241 { 242 double yd = (i+0.5)/ni-0.5; 243 double theta = (0.5-yd)*Pi; 244 double facteur=1./sin(theta); 245 for(j=0; j < nj; j++) 246 { 247 double xa = (j+0.5)/nj-0.5; 248 double phi = 2.*Pi*xa*facteur+Pi; 249 float th=float(theta); 250 float ff=float(phi); 251 if (phi<2*Pi && phi>= 0) 252 { 253 map(i,j) = (float)dobj_->PixValSph(th, ff); 254 } 255 } 256 } 257 FitsOutFile fout(filename); 258 fout.firstImageOnPrimaryHeader(); 259 FITS_TArray<r_4> fta(map); 260 fta.Write(fout); 261 262 263 } 264 200 265 201 266 #ifdef __CXX_PRAGMA_TEMPLATES__ -
trunk/SophyaExt/FitsIOServer/fitsspherehealpix.h
r1174 r1176 29 29 virtual void SetDataObj(AnyDataObj & o); 30 30 31 void Mollweide_picture_projection(char flnm[]); 32 void sinus_picture_projection(char flnm[]); 33 34 31 35 inline operator SphereHEALPix<T>() { return(*dobj_); } 32 36
Note:
See TracChangeset
for help on using the changeset viewer.