Changeset 3167 in Sophya for trunk/SophyaExt
- Timestamp:
- Feb 2, 2007, 6:46:47 PM (19 years ago)
- Location:
- trunk/SophyaExt/FitsIOServer
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/fbtntintf.cc
r3166 r3167 167 167 printerror(sta); 168 168 ColName.push_back(colname); 169 if(fits_get_coltype (FitsPtr,icol+1,&typecode,NULL,NULL,&sta))169 if(fits_get_coltypell(FitsPtr,icol+1,&typecode,NULL,NULL,&sta)) 170 170 printerror(sta); 171 171 if(typecode!=TSTRING && typecode!=TCOMPLEX && typecode!=TDBLCOMPLEX) -
trunk/SophyaExt/FitsIOServer/fitsarrhand.h
r2907 r3167 50 50 if (is.CurrentHDUType() != IMAGE_HDU) return 0; 51 51 T x = 0; 52 longnaxes[BASEARRAY_MAXNDIMS];52 LONGLONG naxes[BASEARRAY_MAXNDIMS]; 53 53 int naxis=BASEARRAY_MAXNDIMS; 54 54 int imgtyp = is.GetImageHDUInfo(naxis, naxes); … … 68 68 if ( dobj == NULL) 69 69 throw NullPtrError("FitsArrayHandler<T>::Write() dobj=NULL "); 70 longnaxes[BASEARRAY_MAXNDIMS] = {0,0,0,0,0};70 LONGLONG naxes[BASEARRAY_MAXNDIMS] = {0,0,0,0,0}; 71 71 for(int_4 id=0; id<dobj->NbDimensions(); id++) 72 72 naxes[id] = dobj->Size(id); … … 83 83 virtual void Read(FitsInOutFile& is) 84 84 { 85 longnaxes[BASEARRAY_MAXNDIMS];85 LONGLONG naxes[BASEARRAY_MAXNDIMS]; 86 86 int naxis=BASEARRAY_MAXNDIMS; 87 87 is.GetImageHDUInfo(naxis, naxes); -
trunk/SophyaExt/FitsIOServer/fitsblkrw.h
r2846 r3167 17 17 //! Write image HDU data to a fits file 18 18 static void WriteImageData(FitsInOutFile& fios, const T * d, size_t sz, 19 long* fpixel=NULL)19 LONGLONG * fpixel=NULL) 20 20 { 21 21 int status = 0; 22 longfpix[5] = {1,1,1,1,1};22 LONGLONG fpix[5] = {1,1,1,1,1}; 23 23 if (fpixel == NULL) fpixel = fpix; 24 24 T * ncd = const_cast<T *>(d); 25 fits_write_pix (fios.FitsPtr(), FitsTypes::DataType(d[0]), fpixel,25 fits_write_pixll(fios.FitsPtr(), FitsTypes::DataType(d[0]), fpixel, 26 26 sz, ncd, &status); 27 27 if ( status ) { … … 37 37 //! Read image HDU data from a fits file 38 38 static void ReadImageData(FitsInOutFile& fios, T * d, size_t sz, 39 long* fpixel=NULL)39 LONGLONG * fpixel=NULL) 40 40 { 41 41 int status = 0; 42 longfpix[5] = {1,1,1,1,1};42 LONGLONG fpix[5] = {1,1,1,1,1}; 43 43 if (fpixel == NULL) fpixel = fpix; 44 44 int anynul = 0; 45 fits_read_pix (fios.FitsPtr(), FitsTypes::DataType(d[0]), fpixel,45 fits_read_pixll(fios.FitsPtr(), FitsTypes::DataType(d[0]), fpixel, 46 46 sz, NULL, d, &anynul, &status); 47 47 if ( status ) { … … 66 66 \param sz : number of data elements to be written 67 67 */ 68 static void WriteColumnData(FitsInOutFile& fios, int colnum, longfirstrow,69 longfirstelem, const T * d, size_t sz)68 static void WriteColumnData(FitsInOutFile& fios, int colnum, LONGLONG firstrow, 69 LONGLONG firstelem, const T * d, size_t sz) 70 70 { 71 71 int status = 0; … … 93 93 \param sz : number of data elements to be read 94 94 */ 95 static void ReadColumnData(FitsInOutFile& fios, int colnum, longfirstrow,96 longfirstelem, T * d, size_t sz)95 static void ReadColumnData(FitsInOutFile& fios, int colnum, LONGLONG firstrow, 96 LONGLONG firstelem, T * d, size_t sz) 97 97 { 98 98 int status = 0; … … 119 119 //! Write image HDU with string data type not supported (throws exception) 120 120 static void WriteImageData(FitsInOutFile& fios, const std::string * d, size_t sz, 121 long* fpixel=NULL)121 LONGLONG * fpixel=NULL) 122 122 { 123 123 throw FitsIOException( … … 126 126 //! Read image HDU with string data type not supported (throws exception) 127 127 static void ReadImageData(FitsInOutFile& fios, std::string * d, size_t sz, 128 long* fpixel=NULL)128 LONGLONG * fpixel=NULL) 129 129 { 130 130 throw FitsIOException( … … 133 133 134 134 //! Write character string data to binary/ascii HDU data in a fits file. 135 static void WriteColumnData(FitsInOutFile& fios, int colnum, longfirstrow,136 longfirstelem, const std::string * d, size_t sz)135 static void WriteColumnData(FitsInOutFile& fios, int colnum, LONGLONG firstrow, 136 LONGLONG firstelem, const std::string * d, size_t sz) 137 137 { 138 138 int status = 0; … … 163 163 164 164 //! Read character string data to binary/ascii HDU data in a fits file. 165 static void ReadColumnData(FitsInOutFile& fios, int colnum, longfirstrow,166 longfirstelem, std::string * d, size_t sz)165 static void ReadColumnData(FitsInOutFile& fios, int colnum, LONGLONG firstrow, 166 LONGLONG firstelem, std::string * d, size_t sz) 167 167 { 168 168 int status = 0; -
trunk/SophyaExt/FitsIOServer/fitsgenedata.cc
r3063 r3167 139 139 140 140 //--- Nb de lignes et de colonnes 141 vector<string> colnames; vector<int> coltypes; vector< long> repcnt, width;141 vector<string> colnames; vector<int> coltypes; vector<LONGLONG> repcnt, width; 142 142 is.GetColInfo(colnames,coltypes,repcnt,width); 143 143 long ncol = colnames.size(); 144 144 if(ncol<=0) 145 145 throw FitsIOException("FitsHandler<GeneralFitData>::Read() bad number of table columns"); 146 longnbrows = is.GetNbRows();146 int_8 nbrows = is.GetNbRows(); 147 147 if(nbrows<=0) 148 148 throw FitsIOException("FitsHandler<GeneralFitData>::Read() number of rows is zero, no reading"); -
trunk/SophyaExt/FitsIOServer/fitshdtable.cc
r3069 r3167 200 200 vector<string> colnames; 201 201 vector<int> coltypes; 202 vector< long> repcnt, width;203 vector< long> colpos;202 vector<LONGLONG> repcnt, width; 203 vector<sa_size_t> colpos; 204 204 is.GetColInfo(colnames, coltypes, repcnt, width); 205 longnbrows = is.GetNbRows();205 int_8 nbrows = is.GetNbRows(); 206 206 207 207 if (dobj == NULL) { // On cree la table si besoin -
trunk/SophyaExt/FitsIOServer/fitshisterr.cc
r3148 r3167 112 112 vector<string> colnames; 113 113 vector<int> coltypes; 114 vector< long> repcnt, width;114 vector<LONGLONG> repcnt, width; 115 115 is.GetColInfo(colnames,coltypes,repcnt,width); 116 116 long ncol = colnames.size(); … … 265 265 266 266 //--- Nb de lignes et de colonnes 267 vector<string> colnames; vector<int> coltypes; vector< long> repcnt, width;267 vector<string> colnames; vector<int> coltypes; vector<LONGLONG> repcnt, width; 268 268 is.GetColInfo(colnames,coltypes,repcnt,width); 269 269 long ncol = colnames.size(); -
trunk/SophyaExt/FitsIOServer/fitshistos.cc
r3123 r3167 150 150 vector<string> colnames; 151 151 vector<int> coltypes; 152 vector< long> repcnt, width;152 vector<LONGLONG> repcnt, width; 153 153 is.GetColInfo(colnames,coltypes,repcnt,width); 154 154 long ncol = colnames.size(); … … 393 393 394 394 //--- Nb de lignes et de colonnes 395 vector<string> colnames; vector<int> coltypes; vector< long> repcnt, width;395 vector<string> colnames; vector<int> coltypes; vector<LONGLONG> repcnt, width; 396 396 is.GetColInfo(colnames,coltypes,repcnt,width); 397 397 long ncol = colnames.size(); -
trunk/SophyaExt/FitsIOServer/fitsinoutfile.cc
r3069 r3167 337 337 if (CurrentHDU() != 1) return false; 338 338 int naxis = 2; 339 longnaxes[2];339 LONGLONG naxes[2]; 340 340 GetImageHDUInfo(naxis, naxes); 341 341 if ((naxis == 0) && (NbHDUs() > 1)) { … … 347 347 348 348 /*-- Methode --*/ 349 void FitsInOutFile::CreateImageHDU(int bitpix, int naxis, long* naxes)350 { 351 int status = 0; 352 fits_create_img (fptr_, bitpix, naxis, naxes, &status);349 void FitsInOutFile::CreateImageHDU(int bitpix, int naxis, LONGLONG* naxes) 350 { 351 int status = 0; 352 fits_create_imgll(fptr_, bitpix, naxis, naxes, &status); 353 353 FitsCheckStatus(status,"FitsInOutFile::CreateImageHDU() Error: "); 354 354 return; … … 361 361 Rc : return the image type (bitpix) 362 362 */ 363 int FitsInOutFile::GetImageHDUInfo(int& naxis, long* naxes) const363 int FitsInOutFile::GetImageHDUInfo(int& naxis, LONGLONG* naxes) const 364 364 { 365 365 int status = 0; 366 366 int maxdim = naxis; 367 367 int bitpix = 0; 368 fits_get_img_param (fptr_, maxdim, &bitpix, &naxis, naxes, &status);368 fits_get_img_paramll(fptr_, maxdim, &bitpix, &naxis, naxes, &status); 369 369 FitsCheckStatus(status, "FitsInOutFile::GetImageHDUInfo() Error: "); 370 370 return bitpix; … … 372 372 373 373 /*-- Methode --*/ 374 longFitsInOutFile::GetNbRows() const375 { 376 int status = 0; 377 longnbrow = 0;378 fits_get_num_rows (FitsPtr() , &nbrow, &status);374 LONGLONG FitsInOutFile::GetNbRows() const 375 { 376 int status = 0; 377 LONGLONG nbrow = 0; 378 fits_get_num_rowsll(FitsPtr() , &nbrow, &status); 379 379 FitsCheckStatus(status, "FitsInOutFile::GetNbRows() Error: " ); 380 380 return nbrow; … … 466 466 long FitsInOutFile::GetColInfo(vector<string> & colnames, 467 467 vector<int> & coltypes, 468 vector< long> & repcnt,469 vector< long> & width)468 vector<LONGLONG> & repcnt, 469 vector<LONGLONG> & width) 470 470 { 471 471 … … 478 478 479 479 int colnum, typecode; 480 long repeat, colw;480 LONGLONG repeat, colw; // $CHECK$ LONGLONG ??? 481 481 int ncols = 0; 482 482 char colname[128]; // longueur max d'un nom de colonne … … 493 493 } 494 494 int sta2 = 0; 495 fits_get_coltype (FitsPtr(), colnum, &typecode, &repeat, &colw, &sta2);495 fits_get_coltypell(FitsPtr(), colnum, &typecode, &repeat, &colw, &sta2); // $CHECK$ LONGLONG ???fits_get_coltypell 496 496 FitsCheckStatus(sta2, "FitsInOutFile::GetColInfo() Error(2): "); 497 497 … … 608 608 CheckFitsPtr(FitsPtr()); 609 609 char keyname[FLEN_KEYWORD], comm[FLEN_COMMENT], sval[FLEN_VALUE]; 610 longlval;610 LONGLONG lval; 611 611 double dval; 612 612 string s; … … 621 621 case MuTyV::MTVInteger : 622 622 lval = mtv.GetIntPart(); 623 fits_write_key(FitsPtr(), TLONG , keyname, &lval, comm, &status);623 fits_write_key(FitsPtr(), TLONGLONG, keyname, &lval, comm, &status); 624 624 break; 625 625 case MuTyV::MTVFloat : -
trunk/SophyaExt/FitsIOServer/fitsinoutfile.h
r3047 r3167 117 117 //---- IMAGE_HDU manipulation methods 118 118 //! Creates a new HDU of type image (see fits_create_img) 119 void CreateImageHDU(int bitpix, int naxis, long* naxes);119 void CreateImageHDU(int bitpix, int naxis, LONGLONG* naxes); 120 120 //! Get information about the current image HDU. - return the image type TBYTE,TINT ... 121 int GetImageHDUInfo(int& naxis, long* naxes) const;121 int GetImageHDUInfo(int& naxis, LONGLONG* naxes) const; 122 122 123 123 //---- BINARY_TBL or ASCII_TBL 124 124 //! Return number of rows in a table HDU 125 longGetNbRows() const;125 LONGLONG GetNbRows() const; 126 126 //! Return number of columns in a table HDU 127 127 int GetNbCols() const; … … 139 139 long GetColInfo(vector<string> & colnames, 140 140 vector<int> & coltypes, 141 vector< long> & repcnt,142 vector< long> & width);141 vector<LONGLONG> & repcnt, 142 vector<LONGLONG> & width); 143 143 144 144 //! Defines the extension name for the next table creation -
trunk/SophyaExt/FitsIOServer/fitslocalmap.cc
r3047 r3167 87 87 if (clsnm != "LocalMap") return 0; 88 88 89 longnaxes[2];89 LONGLONG naxes[2]; 90 90 int naxis=2; 91 91 int imgtyp = is.GetImageHDUInfo(naxis, naxes); -
trunk/SophyaExt/FitsIOServer/fitsmanager.cc
r2932 r3167 194 194 int hdutyp = is.CurrentHDUType(); 195 195 if (hdutyp == IMAGE_HDU) { 196 longnaxes[5] = {0,0,0,0,0};196 LONGLONG naxes[5] = {0,0,0,0,0}; 197 197 int naxis=5; 198 198 int imgtyp = is.GetImageHDUInfo(naxis, naxes); … … 207 207 vector<string> colnames; 208 208 vector<int> coltypes; 209 vector<long> repcnt; 210 vector<long> width; 209 vector<LONGLONG> repcnt, width; 211 210 int ncols = is.GetColInfo(colnames, coltypes, repcnt, width); 212 211 if (hdutyp == BINARY_TBL) os << ">> BINARY_TBL : NRows= " << is.GetNbRows(); -
trunk/SophyaExt/FitsIOServer/fitsspherehealpix.cc
r3047 r3167 98 98 vector<string> colnames; 99 99 vector<int> coltypes; 100 vector<long> repcnt; 101 vector<long> width; 100 vector<LONGLONG> repcnt, width; 102 101 long ncols = is.GetColInfo(colnames, coltypes, repcnt, width); 103 102 if (ncols < 1) return 0; -
trunk/SophyaExt/FitsIOServer/fitsspherethetaphi.cc
r2974 r3167 90 90 vector<string> colnames; 91 91 vector<int> coltypes; 92 vector<long> repcnt; 93 vector<long> width; 92 vector<LONGLONG> repcnt, width; 94 93 long ncols = is.GetColInfo(colnames, coltypes, repcnt, width); 95 94 if (ncols < 1) return 0; -
trunk/SophyaExt/FitsIOServer/fitsswapper.h
r3069 r3167 62 62 { 63 63 /* fios->MoveAbsToHDU(fhdu); On suppose qu'on est sur le bon HDU - Reza 30/12/2005 */ 64 longrow = rowos;64 LONGLONG row = rowos; 65 65 if (osw) row = oswp; 66 66 if (dtp != NULL) … … 73 73 virtual void ReadFromSwap(int_8 idx, int_8 swp, T* d, size_t sz) 74 74 { 75 longnrows = fios.GetNbRows();75 int_8 nrows = fios.GetNbRows(); 76 76 size_t szi = sz; 77 77 if ((swp+sz-1) > nrows) sz = nrows-swp+1; … … 94 94 FitsInOutFile fios; 95 95 int fcol; 96 longrowos;96 LONGLONG rowos; 97 97 BaseDataTable* dtp; 98 98 };
Note:
See TracChangeset
for help on using the changeset viewer.