Changeset 1954 in Sophya for trunk/SophyaLib/SkyMap/HEALPixUtils.cc
- Timestamp:
- Mar 28, 2002, 2:10:57 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SkyMap/HEALPixUtils.cc
r1392 r1954 175 175 176 176 if( nside<1 || nside>ns_max ) { 177 cout << "nside out of range" << endl; 178 exit(0); 177 char buff[64]; 178 sprintf(buff,"HEALPix::nest2ring nside(=%d) out of range ", nside); 179 throw RangeCheckError(PExcLongMessage(buff)); 179 180 } 180 181 npix = 12 * nside* nside; 181 182 if( ipnest<0 || ipnest>npix-1 ) { 182 cout << "ipnest out of range" << endl; 183 exit(0); 183 char buff[64]; 184 sprintf(buff,"HEALPix::nest2ring ipnest(=%d) out of range ", ipnest); 185 throw RangeCheckError(PExcLongMessage(buff)); 184 186 } 185 187 … … 261 263 262 264 if( nside<1 || nside>ns_max ) { 263 cout << "nside out of range" << endl; 264 exit(0); 265 char buff[64]; 266 sprintf(buff,"HEALPix::ring2nest nside(=%d) out of range ", nside); 267 throw RangeCheckError(PExcLongMessage(buff)); 265 268 } 266 269 npix = 12 * nside*nside; 267 270 if( ipring<0 || ipring>npix-1 ) { 268 cout << "ipring out of range" << endl; 269 exit(0); 271 char buff[64]; 272 sprintf(buff,"HEALPix::ring2nest ipring(=%d) out of range ", ipring); 273 throw RangeCheckError(PExcLongMessage(buff)); 270 274 } 271 275 … … 364 368 365 369 if( nside<1 || nside>ns_max ) { 366 cout << "nside out of range" << endl; 367 exit(0); 370 char buff[64]; 371 sprintf(buff,"HEALPix::ang2pix_ring nside(=%d) out of range ", nside); 372 throw RangeCheckError(PExcLongMessage(buff)); 368 373 } 369 374 370 375 if( theta<0. || theta>Pi) { 371 cout << "theta out of range" << endl; 372 exit(0); 376 char buff[64]; 377 sprintf(buff,"HEALPix::ang2pix_ring theta(=%g) out of range ", theta); 378 throw RangeCheckError(PExcLongMessage(buff)); 373 379 } 374 380 … … 447 453 448 454 if( nside<1 || nside>ns_max ) { 449 cout << "nside out of range" << endl; 450 exit(0); 455 char buff[64]; 456 sprintf(buff,"HEALPix:::ang2pix_nest nside(=%d) out of range ", nside); 457 throw RangeCheckError(PExcLongMessage(buff)); 451 458 } 452 459 if( theta<0 || theta>Pi ) { 453 cout << "theta out of range" << endl; 454 exit(0); 460 char buff[64]; 461 sprintf(buff,"HEALPix:::ang2pix_nest theta(=%g) out of range ", theta); 462 throw RangeCheckError(PExcLongMessage(buff)); 455 463 } 456 464 z = cos(theta); … … 531 539 532 540 if( nside<1 || nside>ns_max ) { 533 cout << "nside out of range" << endl; 534 exit(0); 541 char buff[64]; 542 sprintf(buff,"HEALPix::pix2ang_ring nside(=%d) out of range ", nside); 543 throw RangeCheckError(PExcLongMessage(buff)); 535 544 } 536 545 npix = 12*nside*nside; // ! total number of points 537 546 if( ipix<0 || ipix>npix-1 ) { 538 cout << "ipix out of range" << endl; 539 exit(0); 547 char buff[64]; 548 sprintf(buff,"HEALPix::pix2ang_ring ipix(=%d) out of range ", ipix); 549 throw RangeCheckError(PExcLongMessage(buff)); 540 550 } 541 551 … … 609 619 610 620 if( nside<1 || nside>ns_max ) { 611 cout << "nside out of range" << endl; 612 exit(0); 621 char buff[64]; 622 sprintf(buff,"HEALPix::pix2ang_nest nside(=%d) out of range ", nside); 623 throw RangeCheckError(PExcLongMessage(buff)); 613 624 } 614 625 npix = 12 * nside*nside; 615 626 if( ipix<0 || ipix>npix-1 ) { 616 cout << "ipix out of range" << endl; 617 exit(0); 627 char buff[64]; 628 sprintf(buff,"HEALPix::pix2ang_nest ipix(=%d) out of range ", ipix); 629 throw RangeCheckError(PExcLongMessage(buff)); 618 630 } 619 631
Note:
See TracChangeset
for help on using the changeset viewer.