Changeset 867 in Sophya for trunk/SophyaExt
- Timestamp:
- Apr 10, 2000, 5:49:18 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/fitsfile.cc
r861 r867 241 241 void FitsFile::GetBinTabFCol(double* valeurs,int nentries, int NoCol) const 242 242 { 243 cout << "entree getbintablefcol double" << endl;244 243 int status= 0; 245 244 int DTYPE; … … 254 253 int anull; 255 254 float dnull= 0.; 256 cout << " avant lecture colonne, nels= " << nels << endl;257 255 fits_read_col(fptr_,TDOUBLE,NoCol+1,1,1,nels,&dnull,valeurs, 258 256 &anull,&status); 259 cout << " colonne lue" << endl;260 257 if( status ) printerror( status,"erreur lecture de colonne" ); 261 258 } … … 263 260 void FitsFile::GetBinTabFCol(float* valeurs,int nentries, int NoCol) const 264 261 { 265 cout << "entree getbintablefcol float" << endl;266 262 int status= 0; 267 263 int DTYPE; … … 282 278 void FitsFile::GetBinTabFCol(int* valeurs,int nentries, int NoCol) const 283 279 { 284 cout << "entree getbintablefcol int" << endl;285 280 int status= 0; 286 281 int DTYPE; … … 298 293 &anull,&status); 299 294 if( status ) printerror( status,"erreur lecture de colonne" ); 300 cout << " tableau d'entiers relu: " << endl;301 for (int ijk=0; ijk<nels;ijk++) cout << valeurs[ijk] << endl;302 295 } 303 296 void FitsFile::GetBinTabFCol(char** valeurs, int nentries, int NoCol) const 304 297 { 305 cout << "entree getbintablefcol string" << endl;306 298 int status= 0; 307 299 int DTYPE; … … 312 304 throw IOExc("FitsFile::GetBinTabFCol, tentative de lecture non float"); 313 305 } 314 cout << " repeat= " << repeat << " width= " << width << endl;315 306 long nels=nentries; 316 307 // no checking for undefined pixels … … 319 310 long frow=1; 320 311 long felem=1; 321 cout << " nb elements a lire" << nels << endl;322 cout << " taille element tableau " << strlen(valeurs[0]) << endl;323 cout << " numero de colonne a lire: " << NoCol+1 << endl;324 312 fits_read_col(fptr_,TSTRING,NoCol+1,frow,felem,nels,cnull,valeurs, 325 313 &anull,&status); 326 314 if( status ) printerror( status,"erreur lecture de colonne" ); 327 cout << " fin lecture chaines" << endl;328 315 } 329 316 int FitsFile::NbColsFromFits() const … … 458 445 taille_des_chaines_.push_back(width); 459 446 rept/=width; 460 cout << " j'ai lu taille_des_chaines= " << width << " rept= " << rept << endl;461 447 break; 462 448 default : … … 466 452 // nentries = max(nentries, nrows_*rept); 467 453 repeat_.push_back(rept); 468 cout << " getparam: repeat= " << repeat_[ii] << endl;469 454 } 470 455 // get number of keywords … … 525 510 } 526 511 } 527 cout << " fin lecture du dvlist : " << endl; 528 dvl_.Print(); 512 // dvl_.Print(); 529 513 } 530 514 void FitsFile::makeHeaderBntblOnFits( char* fieldType, char** Noms, int nentries, int tfields, DVList &dvl, char* extname, vector<int> taille_des_chaines) const 531 515 { 532 cout << " entree put_column_bntbl " << endl;533 516 int status = 0; 534 517 long nrows; 535 cout << " nombre de types: " << strlen(fieldType) << endl;536 518 if (strlen(fieldType) != tfields) 537 519 { … … 574 556 else strcpy(format,"1024"); 575 557 } 576 cout << " en ecriture fits : nrows= " << nrows << endl;577 cout << " fitsfile : format= " << format << endl;578 558 strncat(format,&fieldType[k],1); 579 559 if (fieldType[k] == 'A') … … 581 561 strcat(format,largeur); 582 562 } 583 cout << " fitsfile : format= " << format << endl;584 563 ttype[k]= new char[FLEN_VALUE]; 585 564 strcpy(ttype[k],Noms[k]); … … 596 575 // so the NULL pointer is given for the tunit parameters. 597 576 nrows=0; 598 cout << " en ecriture fits : nrows avant create = " << nrows << endl;599 577 fits_create_tbl(fptr_,BINARY_TBL,nrows,tfields,ttype,tform, 600 578 NULL,extn,&status); … … 612 590 // 613 591 // get names and values from the join DVList object 614 cout << " dvlist en ecriture..." << endl; 615 dvl.Print(); 592 // dvl.Print(); 616 593 DVList::ValList::const_iterator it; 617 594 for(it = dvl.Begin(); it != dvl.End(); it++) … … 621 598 strncpy(keyname,(*it).first.substr(0,64).c_str(),10); 622 599 char comment[FLEN_COMMENT]; 623 cout << " keyname: " << keyname << " keytype: " << keytype << endl;624 600 switch (keytype) 625 601 { … … 629 605 strcpy(comment,"I entier"); 630 606 fits_write_key(fptr_,TINT,keyname,&ival,comment,&status); 631 cout << " keyname " << keyname << " = " << ival << " ecrit " << endl;632 607 break; 633 608 } … … 637 612 strcpy(comment,"D double"); 638 613 fits_write_key(fptr_,TDOUBLE,keyname,&dval,comment,&status); 639 cout << " keyname " << keyname << " = " << dval << " ecrit " << endl;640 614 break; 641 615 } … … 646 620 strcpy(comment,"S character string"); 647 621 fits_write_key(fptr_,TSTRING,keyname,&strval,comment,&status); 648 cout << " keyname " << keyname << " = " << strval << " ecrit " << endl;649 622 break; 650 623 } … … 653 626 } 654 627 655 cout << " fitsfile: le dvlist est ecrit" << endl;656 628 } 657 629 … … 663 635 if( status ) printerror(status,"putColToFits: le movabs a foire"); 664 636 fits_get_hdu_type(fptr_, &hdutype, &status); 665 if(hdutype != ASCII_TBL && hdutype != BINARY_TBL)666 {667 cout << " hdunum= " << hdunum_ << " hdutype= " << hdutype << endl;668 //throw IOExc("FitsFile::putColToFits, this HDU is not an ASCII table nor a binary table");669 }637 if(hdutype != ASCII_TBL && hdutype != BINARY_TBL) 638 { 639 cout << " hdunum= " << hdunum_ << " hdutype= " << hdutype << endl; 640 throw IOExc("FitsFile::putColToFits, this HDU is not an ASCII table nor a binary table"); 641 } 670 642 // if(hdutype == ASCII_TBL && nocol>0) 671 643 // {
Note:
See TracChangeset
for help on using the changeset viewer.