Changeset 3188 in Sophya for trunk/SophyaExt/FitsIOServer


Ignore:
Timestamp:
Mar 17, 2007, 10:22:03 PM (19 years ago)
Author:
cmv
Message:

ajout des acces elements par elements cmv 9/03/2007

Location:
trunk/SophyaExt/FitsIOServer
Files:
2 edited

Legend:

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

    r3128 r3188  
    11451145 delete [] arr;
    11461146 return Naxis[0]*Naxis[1];
    1147  }
     1147}
    11481148
    11491149/*! Read image into a TMatrix<int_4> */
     
    11681168 delete [] arr;
    11691169 return Naxis[0]*Naxis[1];
    1170  }
     1170}
    11711171
    11721172/*! Read image into a TMatrix<int_8> */
     
    11901190 delete [] arr;
    11911191 return Naxis[0]*Naxis[1];
    1192  }
     1192}
    11931193
    11941194/*! Read image into a TMatrix<float> */
     
    12121212 delete [] arr;
    12131213 return Naxis[0]*Naxis[1];
    1214  }
     1214}
    12151215
    12161216/*! Read image into a TMatrix<double> */
     
    12341234 delete [] arr;
    12351235 return Naxis[0]*Naxis[1];
    1236  }
     1236}
     1237
     1238/*! Read image pixel numcol,numrow with numcol=[0,Naxis1[ and numrow=[0,Naxis2[ */
     1239double FitsImg2DRd::Read(LONGLONG numcol, LONGLONG numrow)
     1240{
     1241 int sta=0;
     1242 if(numcol<0 || numrow<0 || numcol>=Naxis[0] || numrow>=Naxis[1])
     1243   throw
     1244     NotAvailableOperation("FitsImg2DRd::Read(col,row): bad col/row number\n");
     1245
     1246   LONGLONG deb = numrow*Naxis[0] + numcol + 1;
     1247   double val = 0.;
     1248   fits_read_img(GetFitsPtr(),TDOUBLE,deb,1,&NulVal,&val,NULL,&sta);
     1249
     1250   if(sta) {
     1251     FitsOpenFile::printerror(sta);
     1252     throw
     1253       NotAvailableOperation("FitsImg2DRd::Read(col,num): Error Reading Fits file\n");
     1254   }
     1255
     1256   return val;
     1257}
    12371258
    12381259///////////////////////////////////////////////////////////////////
     
    14691490 delete [] arr;
    14701491 return Naxis[0]*Naxis[1]*Naxis[2];
    1471  }
     1492}
    14721493
    14731494/*! Read 3D image into a TArray<int_4> */
     
    14921513 delete [] arr;
    14931514 return Naxis[0]*Naxis[1]*Naxis[2];
    1494  }
     1515}
    14951516
    14961517/*! Read 3D image into a TArray<int_8> */
     
    15141535 delete [] arr;
    15151536 return Naxis[0]*Naxis[1]*Naxis[2];
    1516  }
     1537}
    15171538
    15181539/*! Read 3D image into a TArray<float> */
     
    15361557 delete [] arr;
    15371558 return Naxis[0]*Naxis[1]*Naxis[2];
    1538  }
     1559}
    15391560
    15401561/*! Read 3D image into a TArray<double> */
     
    15581579 delete [] arr;
    15591580 return Naxis[0]*Naxis[1]*Naxis[2];
    1560  }
     1581}
     1582
     1583/*! Read 3D image pixel i,j,k with i=[0,Naxis1[ , j=[0,Naxis2[ , k=[0,Naxis3[ */
     1584double FitsImg3DRd::Read(LONGLONG i, LONGLONG j, LONGLONG k)
     1585{
     1586 int sta=0;
     1587 if(i<0 || j<0 || k<0 || i>=Naxis[0] || j>=Naxis[1] || k>=Naxis[2])
     1588   throw
     1589     NotAvailableOperation("FitsImg3DRd::Read(i,j,k): bad i/j/k number\n");
     1590
     1591   LONGLONG deb = Naxis[0]*(j+Naxis[1]*k)+i+1;
     1592   double val = 0.;
     1593   fits_read_img(GetFitsPtr(),TDOUBLE,deb,1,&NulVal,&val,NULL,&sta);
     1594
     1595   if(sta) {
     1596     FitsOpenFile::printerror(sta);
     1597     throw
     1598       NotAvailableOperation("FitsImg3DRd::Read(i,j,k): Error Reading Fits file\n");
     1599   }
     1600
     1601   return val;
     1602}
    15611603
    15621604///////////////////////////////////////////////////////////////////
  • trunk/SophyaExt/FitsIOServer/fabtcolread.h

    r3128 r3188  
    200200  LONGLONG Read(TMatrix<float>& data);
    201201  LONGLONG Read(TMatrix<double>& data);
     202  double   Read(LONGLONG numcol, LONGLONG numrow);
    202203
    203204  //! Set debug level
     
    264265  LONGLONG Read(TArray<float>& data);
    265266  LONGLONG Read(TArray<double>& data);
     267  double   Read(LONGLONG i, LONGLONG j, LONGLONG k);
    266268
    267269  //! Set debug level
Note: See TracChangeset for help on using the changeset viewer.