Changeset 3772 in Sophya for trunk/SophyaExt
- Timestamp:
- May 9, 2010, 12:07:49 AM (15 years ago)
- Location:
- trunk/SophyaExt/FitsIOServer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/fabtcolread.cc
r3660 r3772 1925 1925 } 1926 1926 1927 /*! Read 3D image into a TVector<int_4> */ 1928 LONGLONG FitsImg3DRd::Read(LONGLONG j, LONGLONG k, TVector<int_4>& data) 1929 { 1930 if(j<0 || k<0 || j>=Naxis[1] || k>=Naxis[2]) 1931 throw NotAvailableOperation("FitsImg3DRd::Read(TVector<int_4>): bad j/k number\n"); 1932 int sta=0; 1933 if(data.Size() != Naxis[0]) data.ReSize(Naxis[0]); 1934 int T = (sizeof(long)==4) ? TLONG: TINT; 1935 LONGLONG deb = Naxis[0]*(j+Naxis[1]*k)+1, nel = Naxis[0]; 1936 fits_read_img(GetFitsPtr(),T,deb,nel,&NulVal,data.Data(),NULL,&sta); 1937 if(sta) { 1938 FitsOpenFile::printerror(sta); 1939 throw 1940 NotAvailableOperation("FitsImg3DRd::Read(TVector<int_4>): Error Reading Fits file\n"); 1941 } 1942 return Naxis[0]; 1943 } 1944 1945 /*! Read 3D image into a TVector<float> */ 1946 LONGLONG FitsImg3DRd::Read(LONGLONG j, LONGLONG k, TVector<float>& data) 1947 { 1948 if(j<0 || k<0 || j>=Naxis[1] || k>=Naxis[2]) 1949 throw NotAvailableOperation("FitsImg3DRd::Read(TVector<float>): bad j/k number\n"); 1950 int sta=0; 1951 if(data.Size() != Naxis[0]) data.ReSize(Naxis[0]); 1952 LONGLONG deb = Naxis[0]*(j+Naxis[1]*k)+1, nel = Naxis[0]; 1953 fits_read_img(GetFitsPtr(),TFLOAT,deb,nel,&NulVal,data.Data(),NULL,&sta); 1954 if(sta) { 1955 FitsOpenFile::printerror(sta); 1956 throw 1957 NotAvailableOperation("FitsImg3DRd::Read(TVector<float>): Error Reading Fits file\n"); 1958 } 1959 return Naxis[0]; 1960 } 1961 1962 /*! Read 3D image into a TVector<double> */ 1963 LONGLONG FitsImg3DRd::Read(LONGLONG j, LONGLONG k, TVector<double>& data) 1964 { 1965 if(j<0 || k<0 || j>=Naxis[1] || k>=Naxis[2]) 1966 throw NotAvailableOperation("FitsImg3DRd::Read(TVector<double>): bad j/k number\n"); 1967 int sta=0; 1968 if(data.Size() != Naxis[0]) data.ReSize(Naxis[0]); 1969 LONGLONG deb = Naxis[0]*(j+Naxis[1]*k)+1, nel = Naxis[0]; 1970 fits_read_img(GetFitsPtr(),TDOUBLE,deb,nel,&NulVal,data.Data(),NULL,&sta); 1971 if(sta) { 1972 FitsOpenFile::printerror(sta); 1973 throw 1974 NotAvailableOperation("FitsImg3DRd::Read(TVector<double>): Error Reading Fits file\n"); 1975 } 1976 return Naxis[0]; 1977 } 1978 1927 1979 /*! Read 3D image pixel i,j,k with i=[0,Naxis1[ , j=[0,Naxis2[ , k=[0,Naxis3[ */ 1928 1980 double FitsImg3DRd::Read(LONGLONG i, LONGLONG j, LONGLONG k) -
trunk/SophyaExt/FitsIOServer/fabtcolread.h
r3660 r3772 369 369 LONGLONG Read(TArray<float>& data); 370 370 LONGLONG Read(TArray<double>& data); 371 372 LONGLONG Read(LONGLONG j, LONGLONG k, TVector<int_4>& data); 373 LONGLONG Read(LONGLONG j, LONGLONG k, TVector<float>& data); 374 LONGLONG Read(LONGLONG j, LONGLONG k, TVector<double>& data); 375 371 376 double Read(LONGLONG i, LONGLONG j, LONGLONG k); 372 377
Note:
See TracChangeset
for help on using the changeset viewer.