Changeset 1752 in Sophya


Ignore:
Timestamp:
Nov 13, 2001, 3:35:05 PM (24 years ago)
Author:
lemeur
Message:

interface avec spheres theta-phi

Location:
trunk/SophyaExt/FitsIOServer
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/FitsIOServer/fitsfile.cc

    r1703 r1752  
    839839      //          status = 0;
    840840      //        }
    841       if (nentries != nrows_*repeat)
    842         {
    843           cout << " found " << nentries << " pixels, expected:  " << nrows_*repeat << endl;
    844           throw PException(" FitsFile:::GetBinTabFCol ");
    845         }
     841      //   if (nentries != nrows_*repeat)
     842      //        {
     843      //          cout << " found " << nentries << " pixels, expected:  " << nrows_*repeat << endl;
     844          //      throw PException(" FitsFile:::GetBinTabFCol ");
     845      //        }
    846846      fits_read_col(fptr_,TDOUBLE,NoCol+1,1,1,nels,&dnull,valeurs,
    847847                            &anull,&status);
     
    878878      //          status = 0;
    879879      //        }
    880       if (nentries != nrows_*repeat)
    881         {
    882           cout << " found " << nentries << " pixels, expected:  " << nrows_*repeat << endl;
    883           throw PException(" FitsFile:::GetBinTabFCol ");
    884         }
     880      //  if (nentries != nrows_*repeat)
     881      //        {
     882      //          cout << " found " << nentries << " pixels, expected:  " << nrows_*repeat << endl;
     883          //      throw PException(" FitsFile:::GetBinTabFCol ");
     884      //        }
    885885      fits_read_col(fptr_,TFLOAT,NoCol+1,1,1,nels,&fnull,valeurs,
    886886                            &anull,&status);
     
    899899      long repeat,width;
    900900      fits_get_coltype(fptr_, NoCol+1,&DTYPE,&repeat,&width,&status);
    901       if( DTYPE != TLONG &&  DTYPE != TINT &&  DTYPE != TSHORT )
    902         {
    903           throw IOExc("FitsFile::GetBinTabFCol, tentative de lecture non entier");
     901      cout << " en lecture fits trouve le type " << DTYPE << endl;
     902      if( DTYPE != TLONG &&  DTYPE != TINT)
     903        {
     904          throw IOExc("FitsFile::GetBinTabFCol, probleme de lecture d'entiers");
    904905        }
    905906      long nels=nentries;
     
    913914      //          status = 0;
    914915      //        }
    915       if (nentries != nrows_*repeat)
    916         {
    917           cout << " found " << nentries << " pixels, expected:  " << nrows_*repeat << endl;
    918           throw PException(" FitsFile:::GetBinTabFCol ");
    919         }
     916      // if (nentries != nrows_*repeat)
     917      //        {
     918      //          cout << " found " << nentries << " pixels, expected:  " << nrows_*repeat << endl;
     919          //      throw PException(" FitsFile:::GetBinTabFCol ");
     920      //        }
     921
     922
     923
     924      // voir commentaire dans putColToFits()
    920925      fits_read_col(fptr_,TINT,NoCol+1,1,1,nels,&inull,valeurs,
    921926                            &anull,&status);
     
    942947      int    anull;
    943948      char* cnull= "";
    944       if (nentries != nrows_*repeat/width)
    945         {
    946           cout << " found " << nentries << " pixels, expected:  " << nrows_*repeat/width << endl;
    947           throw PException(" FitsFile:::GetBinTabFCol ");
    948         }
     949      // if (nentries != nrows_*repeat/width)
     950      //        {
     951      //          cout << " found " << nentries << " pixels, expected:  " << nrows_*repeat/width << endl;
     952          //      throw PException(" FitsFile:::GetBinTabFCol ");
     953      //        }
    949954      long frow=1;
    950955      long felem=1;
     
    16231628  //  for (int toto=0; toto < 10; toto++) cout << donnees[toto] << endl;
    16241629  fits_write_col(fptr_,TDOUBLE,nocol+1,1,1,nentries, donnees ,&status);
    1625   if( status )  printerror( status,"erreur ecriture du fichier fits" );
     1630  if( status )  printerror( status,"erreur ecriture col. double, dans fichier fits" );
    16261631}
    16271632
     
    16561661    }
    16571662  fits_write_col(fptr_,TFLOAT,nocol+1,1,1,nentries, donnees ,&status);
    1658   if( status )  printerror( status,"erreur ecriture du fichier fits" );
     1663  if( status )  printerror( status,"erreur ecriture col. floats, dans fichier fits" );
    16591664}
    16601665
     
    16831688  long repeat, width;
    16841689  fits_get_coltype(fptr_, nocol+1, &code, &repeat,&width, &status);
    1685   if( code != TLONG &&  code != TINT &&  code != TSHORT )
    1686     {
    1687       cout << " WARNING : types don't match (PutColToFits) : on fits file= " << code << " (FITS code), to be written= INT " << endl;
     1690   
     1691
     1692// la logique voudrait qu'on distingue TLONG et TINT. Mais si j'ecris
     1693// et relis immediatement quelque chose en TLONG l'experience montre
     1694// que ca foire. Donc, je fais tout en TINT, d'ailleurs cfitsio n'a pas
     1695// (apparemment) d'entiers de longueur superieure a 32 bits.
     1696// En fait, je n'y comprend rien. A suivre (GLM).
     1697  if (code == TINT || code == TLONG )
     1698    {
     1699      cout << " j'ecris des TINT" << endl;
     1700      fits_write_col(fptr_,TINT,nocol+1,1,1,nentries, donnees ,&status);
     1701    }
     1702  else if (code == TSHORT)
     1703    {
     1704      cout << " j'ecris des TSHORT " << endl;
     1705      fits_write_col(fptr_,TSHORT,nocol+1,1,1,nentries, donnees ,&status);
     1706    }
     1707  else
     1708    {
     1709      cout << " WARNING : types don't match (PutColToFits) : on fits file= " << code << " (FITS code), to be written= integers " << endl;
    16881710    }
    1689   fits_write_col(fptr_,TINT,nocol+1,1,1,nentries, donnees ,&status);
    1690   if( status )  printerror( status," ecriture du fichier fits" );
     1711  if( status )  printerror( status,"erreur ecriture col. entiers, dans fichier fits" );
    16911712}
    16921713
     
    17191740    }
    17201741  fits_write_col(fptr_,TSTRING,nocol+1,1,1,nentries, donnees ,&status);
    1721   if( status )  printerror( status,"erreur ecriture du fichier fits" );
     1742  if( status )  printerror( status,"erreur ecriture col. chars, dans fichier fits" );
    17221743}
    17231744
  • trunk/SophyaExt/FitsIOServer/fitsspherehealpix.h

    r1353 r1752  
    3030void Mollweide_picture_projection(char flnm[]);
    3131void sinus_picture_projection(char flnm[]);
    32  void ReWriteFromFitsToFits(FitsInFile& headerin, FitsOutFile& os);
    33 
     32//void ReWriteFromFitsToFits(FitsInFile& headerin, FitsOutFile& os);
    3433
    3534inline operator SphereHEALPix<T>() { return(*dobj_); }
Note: See TracChangeset for help on using the changeset viewer.