Changeset 3188 in Sophya for trunk/SophyaExt
- Timestamp:
- Mar 17, 2007, 10:22:03 PM (19 years ago)
- Location:
- trunk/SophyaExt/FitsIOServer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/fabtcolread.cc
r3128 r3188 1145 1145 delete [] arr; 1146 1146 return Naxis[0]*Naxis[1]; 1147 1147 } 1148 1148 1149 1149 /*! Read image into a TMatrix<int_4> */ … … 1168 1168 delete [] arr; 1169 1169 return Naxis[0]*Naxis[1]; 1170 1170 } 1171 1171 1172 1172 /*! Read image into a TMatrix<int_8> */ … … 1190 1190 delete [] arr; 1191 1191 return Naxis[0]*Naxis[1]; 1192 1192 } 1193 1193 1194 1194 /*! Read image into a TMatrix<float> */ … … 1212 1212 delete [] arr; 1213 1213 return Naxis[0]*Naxis[1]; 1214 1214 } 1215 1215 1216 1216 /*! Read image into a TMatrix<double> */ … … 1234 1234 delete [] arr; 1235 1235 return Naxis[0]*Naxis[1]; 1236 } 1236 } 1237 1238 /*! Read image pixel numcol,numrow with numcol=[0,Naxis1[ and numrow=[0,Naxis2[ */ 1239 double 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 } 1237 1258 1238 1259 /////////////////////////////////////////////////////////////////// … … 1469 1490 delete [] arr; 1470 1491 return Naxis[0]*Naxis[1]*Naxis[2]; 1471 1492 } 1472 1493 1473 1494 /*! Read 3D image into a TArray<int_4> */ … … 1492 1513 delete [] arr; 1493 1514 return Naxis[0]*Naxis[1]*Naxis[2]; 1494 1515 } 1495 1516 1496 1517 /*! Read 3D image into a TArray<int_8> */ … … 1514 1535 delete [] arr; 1515 1536 return Naxis[0]*Naxis[1]*Naxis[2]; 1516 1537 } 1517 1538 1518 1539 /*! Read 3D image into a TArray<float> */ … … 1536 1557 delete [] arr; 1537 1558 return Naxis[0]*Naxis[1]*Naxis[2]; 1538 1559 } 1539 1560 1540 1561 /*! Read 3D image into a TArray<double> */ … … 1558 1579 delete [] arr; 1559 1580 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[ */ 1584 double 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 } 1561 1603 1562 1604 /////////////////////////////////////////////////////////////////// -
trunk/SophyaExt/FitsIOServer/fabtcolread.h
r3128 r3188 200 200 LONGLONG Read(TMatrix<float>& data); 201 201 LONGLONG Read(TMatrix<double>& data); 202 double Read(LONGLONG numcol, LONGLONG numrow); 202 203 203 204 //! Set debug level … … 264 265 LONGLONG Read(TArray<float>& data); 265 266 LONGLONG Read(TArray<double>& data); 267 double Read(LONGLONG i, LONGLONG j, LONGLONG k); 266 268 267 269 //! Set debug level
Note:
See TracChangeset
for help on using the changeset viewer.