Changeset 673 in Sophya for trunk/SophyaExt/FitsIOServer


Ignore:
Timestamp:
Dec 6, 1999, 6:11:36 PM (26 years ago)
Author:
ansari
Message:

Pb compil sur IRIX64-CC, re-decl for(int ii, ...) FitsIOServer - Reza 6/12/99

File:
1 edited

Legend:

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

    r664 r673  
    169169   ttype= new char*[tfields];
    170170   tform= new char*[tfields];
    171    for( int ii = 0; ii < tfields; ii++)
     171   int ii;
     172   for(ii = 0; ii < tfields; ii++)
    172173     {
    173174       ttype[ii]= new char[FLEN_VALUE];
     
    192193   long repeat,width;
    193194   list<int> column;
    194    for( int ii = 0; ii < tfields; ii++)
     195   for(ii = 0; ii < tfields; ii++)
    195196     {
    196197       fits_binary_tform(tform[ii],&typecode, &repeat, &width, &status);
     
    203204   char **clname;
    204205   clname= new char*[column.size()];
    205    for(int ii = 0; ii < column.size(); ii++)
     206   for(ii = 0; ii < column.size(); ii++)
    206207     clname[ii]= new char[FLEN_VALUE];
    207208
     
    211212     strcpy(clname[index++],ttype[*itr-1]);
    212213
    213    for( int ii = 0; ii < tfields; ii++)
     214   for(ii = 0; ii < tfields; ii++)
    214215     {
    215216       delete [] ttype[ii];
     
    230231   NTuple nt0(column.size(),clname,blk);
    231232
    232    for(int ii = 0; ii < column.size(); ii++)
     233   for(ii = 0; ii < column.size(); ii++)
    233234     delete [] clname[ii];
    234235   delete [] clname;
     
    239240   strcpy(strnull, " ");
    240241   int anynull= 0;
    241    long longnull  = 0;
    242242
    243243   // value to represent undefined array elements
     
    264264   char keyname[LEN_KEYWORD]= "";
    265265   char strval[FLEN_VALUE];
    266    for(int ii = 0; ii < tfields; ii++)
     266   for(ii = 0; ii < tfields; ii++)
    267267     {
    268268       fits_make_keyn("TUNIT",ii+1,keyname,&status);
     
    722722  ttype= new char*[tfields];
    723723  tform= new char*[tfields];
    724   for(int i = 0; i < tfields; i++)
     724  int i;
     725  for(i = 0; i < tfields; i++)
    725726    {
    726727      ttype[i]= new char[FLEN_VALUE];
     
    752753  int firstelem = 1;
    753754
    754   for(int i = 0; i < tfields; i++)
     755  for(i = 0; i < tfields; i++)
    755756    {
    756757      float *dens= new float[nrows];
     
    979980  int siz_x = DpcImg.XSize();
    980981  int siz_y = DpcImg.YSize();
    981   int nbpixels = siz_x*siz_y;
    982982  FITS_tab_typ_ = TFLOAT;
    983983
     
    10281028  int siz_x = DpcImg.XSize();
    10291029  int siz_y = DpcImg.YSize();
    1030   int nbpixels = siz_x*siz_y;
    10311030  FITS_tab_typ_ = TINT;
    10321031
     
    17221721   cout << " image FITS en projection SINUS" << endl;
    17231722  // table will have npixels rows
    1724   for(int j=0; j < npixels; j++) map[j]=0.;
    1725     for(int j=0; j<naxes[1]; j++)
     1723  int i,j;
     1724  for(j=0; j < npixels; j++) map[j]=0.;
     1725
     1726  for(j=0; j<naxes[1]; j++)
    17261727      {
    17271728        double yd = (j+0.5)/naxes[1]-0.5;
    17281729        double theta = (0.5-yd)*Pi;
    17291730        double facteur=1./sin(theta);
    1730         for(int i=0; i<naxes[0]; i++) 
     1731        for(i=0; i<naxes[0]; i++) 
    17311732          {
    17321733            double xa = (i+0.5)/naxes[0]-0.5;
     
    17601761   cout << " image FITS en projection SINUS" << endl;
    17611762  // table will have npixels rows
    1762   for(int j=0; j < npixels; j++) map[j]=0.;
    1763     for(int j=0; j<naxes[1]; j++)
     1763  int i,j;
     1764  for(j=0; j < npixels; j++) map[j]=0.;
     1765  for(j=0; j<naxes[1]; j++)
    17641766      {
    17651767        double yd = (j+0.5)/naxes[1]-0.5;
    17661768        double theta = (0.5-yd)*Pi;
    17671769        double facteur=1./sin(theta);
    1768         for(int i=0; i<naxes[0]; i++) 
     1770        for(i=0; i<naxes[0]; i++) 
    17691771          {
    17701772            double xa = (i+0.5)/naxes[0]-0.5;
     
    17871789// a FITS-file
    17881790void FitsIoServer::Mollweide_picture_projection(SphericalMap<float>& sph, char filename[])
     1791{
     1792  // le code de cete methode duplique celui de la precedente, la seule
     1793  //difference etant le type de sphere en entree. Ces methodes de projection
     1794  // sont provisoires, et ne servent que pour les tests. C est pourquoi je
     1795  // ne me suis pas casse la tete, pour l instant
     1796   
     1797  long naxes[2]={600, 300};
     1798  float* map = new float[ 600*300 ];
     1799  int npixels=  naxes[0]*naxes[1];
     1800
     1801   cout << " image FITS en projection MOLLWEIDE" << endl;
     1802  // table will have npixels rows
     1803   int i,j;
     1804   for(j=0; j < npixels; j++) map[j]=0.;
     1805   for(j=0; j<naxes[1]; j++)
     1806     {
     1807       double yd = (j+0.5)/naxes[1]-0.5;
     1808       double facteur=2.*Pi/sin(acos(yd*2));
     1809       double theta = (0.5-yd)*Pi;
     1810       for(i=0; i<naxes[0]; i++) 
     1811         {
     1812           double xa = (i+0.5)/naxes[0]-0.5;
     1813           double phi =  xa*facteur+Pi;
     1814           float th=float(theta);
     1815           float ff=float(phi);
     1816           if (phi<2*Pi && phi>= 0)
     1817             {
     1818               map[j*naxes[0]+i] = sph.PixValSph(th, ff);
     1819             }
     1820         }
     1821     }
     1822   
     1823   write_picture(naxes, map,  filename);
     1824   delete [] map;
     1825   
     1826}
     1827// projects a SphericalMap<double>, according Mollweide-method, and saves onto
     1828// a FITS-file
     1829void FitsIoServer::Mollweide_picture_projection(SphericalMap<double>& sph, char filename[])
    17891830{
    17901831  // le code de cete methode duplique celui de la precedente, la seule
     
    18221863   
    18231864}
    1824 // projects a SphericalMap<double>, according Mollweide-method, and saves onto
    1825 // a FITS-file
    1826 void FitsIoServer::Mollweide_picture_projection(SphericalMap<double>& sph, char filename[])
    1827 {
    1828   // le code de cete methode duplique celui de la precedente, la seule
    1829   //difference etant le type de sphere en entree. Ces methodes de projection
    1830   // sont provisoires, et ne servent que pour les tests. C est pourquoi je
    1831   // ne me suis pas casse la tete, pour l instant
    1832    
    1833   long naxes[2]={600, 300};
    1834   float* map = new float[ 600*300 ];
    1835   int npixels=  naxes[0]*naxes[1];
    1836 
    1837    cout << " image FITS en projection MOLLWEIDE" << endl;
    1838   // table will have npixels rows
    1839    for(int j=0; j < npixels; j++) map[j]=0.;
    1840    for(int j=0; j<naxes[1]; j++)
    1841      {
    1842        double yd = (j+0.5)/naxes[1]-0.5;
    1843        double facteur=2.*Pi/sin(acos(yd*2));
    1844        double theta = (0.5-yd)*Pi;
    1845        for(int i=0; i<naxes[0]; i++) 
    1846          {
    1847            double xa = (i+0.5)/naxes[0]-0.5;
    1848            double phi =  xa*facteur+Pi;
    1849            float th=float(theta);
    1850            float ff=float(phi);
    1851            if (phi<2*Pi && phi>= 0)
    1852              {
    1853                map[j*naxes[0]+i] = sph.PixValSph(th, ff);
    1854              }
    1855          }
    1856      }
    1857    
    1858    write_picture(naxes, map,  filename);
    1859    delete [] map;
    1860    
    1861 }
    18621865
    18631866
     
    18751878
    18761879  // table will have npixels rows
    1877   for(int j=0; j < npixels; j++) map[j]=0.;
    1878     for(int j=0; j<naxes[1]; j++)
     1880  int i,j;
     1881  for(j=0; j < npixels; j++) map[j]=0.;
     1882    for(j=0; j<naxes[1]; j++)
    18791883      {
    1880         for(int i=0; i<naxes[0]; i++) 
     1884        for(i=0; i<naxes[0]; i++) 
    18811885          {
    18821886                map[j*naxes[0]+i] = lcm(i, j);
     
    19171921
    19181922  // first row in table to write
    1919   long firstrow  = 1;
     1923  //  long firstrow  = 1;  Not referenced
    19201924  // first element in row   
    19211925  long firstelem = 1; 
    1922   int colnum = 1;
     1926  //  int colnum = 1;     Not referenced
    19231927  int nelements=naxes[0]*naxes[1];
    19241928  fits_write_img(fptr, TFLOAT, firstelem, nelements, map, &status);
Note: See TracChangeset for help on using the changeset viewer.