Changeset 687 in Sophya for trunk/SophyaExt/FitsIOServer/fitsioserver.cc
- Timestamp:
- Dec 15, 1999, 3:40:39 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/fitsioserver.cc
r681 r687 389 389 //DBG cout << " found " << npixels << " pixels" << endl; 390 390 //DBG cout << " expected " << sph.NbPixels() << endl; 391 if (nside <= 0 ) 391 if (nside <= 0 ) 392 392 { 393 393 cout<<" FITSIOSERVER: no resolution parameter on fits file "<<endl; … … 406 406 // } 407 407 } 408 // cout << " fin relecture debut transfert" << endl; 409 for (int j = 0; j < sph.NbPixels(); j++) sph(j)= (float)r_4tab_[j]; 408 for (int j = 0; j < sph.NbPixels(); j++) 409 { 410 sph(j)= (float)r_4tab_[j]; 411 } 410 412 } 411 413 void FitsIoServer::load(SphereGorski<double>& sph, char flnm[], int hdunum) … … 1396 1398 if (naxis >=2) nelements*=naxes[1]; 1397 1399 if (naxis == 3) nelements*=naxes[2]; 1398 int anynull ;1399 r_8 dnullval= 0.;1400 r_4 fnullval= 0.;1400 int anynull=0; 1401 r_8 dnullval=DOUBLENULLVALUE; 1402 r_4 fnullval=FLOATNULLVALUE; 1401 1403 int_4 inullval=0; 1402 1404 // on laisse a fits le soin de convertir le type du tableau lu vers … … 1428 1430 &anynull, &status); 1429 1431 //SHV: remove useless print... 1430 //for (int kk=0; kk<nelements; kk++) cout << r_4tab_[kk] << endl; 1432 // for (int kk=0; kk<nelements; kk++) cout << r_4tab_[kk] << endl; 1433 cout << " anynull= " << anynull << endl; 1431 1434 if( status ) printerror( status ); 1432 1435 break; … … 1572 1575 //cout << " width : " << width << endl; 1573 1576 fits_read_key_lng(fptr, "LASTPIX", &lastpix, comment, &status); 1574 if( status ) printerror( status," mot cle LASTPIX" ); 1577 int IsLASTPIX=1; 1578 if( status ) 1579 { 1580 IsLASTPIX=0; 1581 printerror( status," mot cle LASTPIX" ); 1582 } 1575 1583 1576 1584 long nelements= nrows*repeat; 1577 if (nelements!=lastpix+1)1578 {1579 cout << " erreur sur longueur du vecteur " << endl;1580 cout << " nelements= " << nelements << " lastpix+1=" << lastpix+1 << endl;1581 }1582 1585 npixels=nelements; 1586 if (IsLASTPIX == 1) 1587 { 1588 if (nelements!=lastpix+1) 1589 { 1590 cout << " probleme sur longueur du vecteur " << endl; 1591 cout << " nb elements prevu = " << nelements << " lastpix+1=" << lastpix+1 << endl; 1592 npixels=lastpix+1; 1593 } 1594 } 1583 1595 int anynull; 1584 r_8 dnullval= 0.;1585 r_4 fnullval= 0.;1596 r_8 dnullval=DOUBLENULLVALUE; 1597 r_4 fnullval=FLOATNULLVALUE; 1586 1598 int_4 inullval=0; 1587 1599 // on laisse a fits le soin de convertir le type du tableau lu vers … … 1598 1610 if (r_8tab_ != NULL) { delete [] r_8tab_; r_8tab_ = NULL; } 1599 1611 r_8tab_=new r_8[ npixels]; 1600 fits_read_col(fptr, TDOUBLE, 1, 1, 1, n elements, &dnullval,1612 fits_read_col(fptr, TDOUBLE, 1, 1, 1, npixels, &dnullval, 1601 1613 r_8tab_, 1602 1614 &anynull, &status); … … 1611 1623 } 1612 1624 if (r_4tab_ != NULL) { delete [] r_4tab_; r_4tab_ = NULL; } 1613 r_4tab_=new r_4[n elements];1614 fits_read_col(fptr, TFLOAT, 1, 1, 1, n elements, &fnullval,1625 r_4tab_=new r_4[npixels]; 1626 fits_read_col(fptr, TFLOAT, 1, 1, 1, npixels, &fnullval, 1615 1627 r_4tab_, &anynull, &status); 1616 1628 if( status ) printerror( status,"probleme dans lecture du tableau de floats" ); … … 1625 1637 } 1626 1638 if (i_4tab_ != NULL) { delete [] i_4tab_; i_4tab_ = NULL; } 1627 i_4tab_=new int_4[n elements];1628 fits_read_col(fptr, TLONG, 1, 1, 1, n elements, &inullval,1639 i_4tab_=new int_4[npixels]; 1640 fits_read_col(fptr, TLONG, 1, 1, 1, npixels, &inullval, 1629 1641 i_4tab_, &anynull, &status); 1630 1642 //fits_read_img(fptr, TINT, 1, nelements, &inullval, i_4tab_,
Note:
See TracChangeset
for help on using the changeset viewer.