Changeset 3123 in Sophya for trunk/SophyaExt/FitsIOServer/fitshistos.cc
- Timestamp:
- Jan 10, 2007, 12:53:57 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/FitsIOServer/fitshistos.cc
r3059 r3123 9 9 #include "histos.h" 10 10 #include "hisprof.h" 11 #include "histerr.h"12 11 #include "histos2.h" 13 12 … … 16 15 17 16 18 //////////////////////////////////////////////////////////////// ///////////19 ///////////////////////// Histo , HProf , HistoErr////////////////////////20 //////////////////////////////////////////////////////////////// ///////////17 //////////////////////////////////////////////////////////////// 18 ///////////////////////// Histo , HProf //////////////////////// 19 //////////////////////////////////////////////////////////////// 21 20 22 21 DECL_TEMP_SPEC /* equivalent a template <> , pour SGI-CC en particulier */ … … 27 26 string clsnm = is.KeyValue(key); 28 27 if ( (clsnm == "SOPHYA::Histo") 29 || (clsnm == "SOPHYA::HProf") 30 || (clsnm == "SOPHYA::HistoErr") ) return 2; 28 || (clsnm == "SOPHYA::HProf") ) return 2; 31 29 return 0; 32 30 } … … 50 48 Histo* h = dynamic_cast< Histo *> (dobj); 51 49 HProf* hp = dynamic_cast< HProf *> (dobj); 52 HistoErr* he = dynamic_cast< HistoErr *> (dobj);53 50 54 51 //--- Les noms de colonnes … … 66 63 } 67 64 // Le nombre d'entrees dans le bin 68 if(h e!=NULL || hp!=NULL) {65 if(hp!=NULL) { 69 66 if(tbltyp==ASCII_TBL) tform.push_back("D15.8"); else tform.push_back("D"); 70 67 colnames.push_back("nb"); … … 83 80 if(h->mErr2) FitsBlockRW<r_8>::WriteColumnData(os,2,1,1,h->mErr2,n); 84 81 if(hp!=NULL) FitsBlockRW<r_8>::WriteColumnData(os,3,1,1,hp->mSumW,n); 85 if(he!=NULL) FitsBlockRW<r_8>::WriteColumnData(os,3,1,1,he->mNData,n);86 82 } 87 83 … … 91 87 mtv = "SOPHYA::Histo"; 92 88 if(hp) mtv = "SOPHYA::HProf"; 93 else if(he) mtv = "SOPHYA::HistoErr";94 89 os.WriteKey("SOPCLSNM",mtv," SOPHYA class name"); 95 90 96 91 mtv = "Histo"; 97 92 if(hp) mtv = "HProf"; 98 else if(he) mtv = "HistoErr";99 93 os.WriteKey("CONTENT",mtv," name of SOPHYA object"); 100 94 … … 142 136 } 143 137 144 if(he) {145 mtv = he->mCorrel;146 os.WriteKey("NCORREL",mtv," number of Correl calls");147 }148 149 138 return; 150 139 } … … 185 174 if(clsnm == "SOPHYA::Histo") dobj = new Histo; 186 175 else if(clsnm == "SOPHYA::HProf") dobj = new HProf; 187 else if(clsnm == "SOPHYA::HistoErr") dobj = new HistoErr;188 176 } 189 177 … … 191 179 Histo* h = dynamic_cast< Histo *> (dobj); 192 180 HProf* hp = dynamic_cast< HProf *> (dobj); 193 HistoErr* he = dynamic_cast< HistoErr *> (dobj);194 181 195 182 //--- Allocation pour histo 196 if(he && (clsnm=="SOPHYA::HistoErr")) { 197 if(ncol<3) 198 throw FitsIOException("FitsHandler<Histo>::Read() wrong number of columns for HistoErr"); 199 he->CreateOrResize(xmin,xmax,nbin); 200 } else if(hp&& (clsnm=="SOPHYA::HProf")) { 183 if(hp&& (clsnm=="SOPHYA::HProf")) { 201 184 if(ncol<3) 202 185 throw FitsIOException("FitsHandler<Histo>::Read() wrong number of columns for HProf"); … … 225 208 } 226 209 227 if(he) he->mCorrel = dvl.GetI("NCORREL",0);228 229 210 //--- remplissage de l'histo 230 211 FitsBlockRW<r_8>::ReadColumnData(is,1,1,1,h->mData,nbin); 231 212 if(h->mErr2) FitsBlockRW<r_8>::ReadColumnData(is,2,1,1,h->mErr2,nbin); 232 213 if(hp) FitsBlockRW<r_8>::ReadColumnData(is,3,1,1,hp->mSumW,nbin); 233 if(he) FitsBlockRW<r_8>::ReadColumnData(is,3,1,1,he->mNData,nbin);234 214 235 215 return;
Note:
See TracChangeset
for help on using the changeset viewer.