Changeset 16 for trunk/src/SDContainer.cc
- Timestamp:
- 06/30/04 11:00:23 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDContainer.cc
r14 r16 38 38 using namespace atnf_sd; 39 39 40 SDContainer::SDContainer(uInt nBeam, uInt nIF, uInt n Chan, uInt nPol)40 SDContainer::SDContainer(uInt nBeam, uInt nIF, uInt nPol, uInt nChan) 41 41 : nBeam_(nBeam), 42 nIF_(nIF), 43 nChan_(nChan), 44 nPol_(nPol), 45 spectrum_(IPosition(4,nBeam,nIF,nChan,nPol)), 46 flags_(IPosition(4,nBeam,nIF,nChan,nPol)), 47 tsys_(IPosition(4,nBeam,nIF,nChan,nPol)) { 42 nIF_(nIF), 43 nPol_(nPol), 44 nChan_(nChan), 45 spectrum_(IPosition(4,nBeam,nIF,nPol,nChan)), 46 flags_(IPosition(4,nBeam,nIF,nPol,nChan)), 47 tsys_(IPosition(4,nBeam,nIF,nPol,nChan)) { 48 uChar x = 0; 49 flags_ = ~x; 50 } 51 52 SDContainer::SDContainer(IPosition shp) 53 : nBeam_(shp(0)), 54 nIF_(shp(1)), 55 nPol_(shp(2)), 56 nChan_(shp(3)), 57 spectrum_(shp), 58 flags_(shp), 59 tsys_(shp) { 48 60 uChar x = 0; 49 61 flags_ = ~x; … … 72 84 73 85 //Vector<Float> pols(nPol); 74 ArrayAccessor<Float, Axis< 0> > j(spec);86 ArrayAccessor<Float, Axis<1> > j(spec); 75 87 IPosition shp0 = spectrum_.shape(); 76 88 IPosition shp1 = spec.shape(); 77 if ( (shp0(2) != shp1( 0)) || (shp0(3) != shp1(1)) ) {89 if ( (shp0(2) != shp1(1)) || (shp0(3) != shp1(0)) ) { 78 90 cerr << "Arrays not conformant" << endl; 79 91 return False; 80 92 } 81 //uInt chani = 0;82 //uInt poli = 0;83 93 // assert dimensions are the same.... 84 94 for (ArrayAccessor<Float, Axis<2> > i(aa1);i != i.end(); ++i) { 85 //pols = spec.row(chani); 86 ArrayAccessor<Float, Axis<1> > jj(j); 95 ArrayAccessor<Float, Axis<0> > jj(j); 87 96 for (ArrayAccessor<Float, Axis<3> > ii(i);ii != ii.end(); ++ii) { 88 //(*ii) = pols[poli];89 97 (*ii) = (*jj); 90 //poli++;91 98 jj++; 92 99 } 93 //poli = 0;94 //chani++;95 100 j++; 96 101 } … … 113 118 aa1.reset(aa1.begin(whichIF)); 114 119 115 ArrayAccessor<uChar, Axis< 0> > j(flag);120 ArrayAccessor<uChar, Axis<1> > j(flag); 116 121 IPosition shp0 = flags_.shape(); 117 122 IPosition shp1 = flag.shape(); 118 if ( (shp0(2) != shp1( 0)) || (shp0(3) != shp1(1)) ) {123 if ( (shp0(2) != shp1(1)) || (shp0(3) != shp1(0)) ) { 119 124 cerr << "Arrays not conformant" << endl; 120 125 return False; … … 123 128 // assert dimensions are the same.... 124 129 for (ArrayAccessor<uChar, Axis<2> > i(aa1);i != i.end(); ++i) { 125 ArrayAccessor<uChar, Axis< 1> > jj(j);130 ArrayAccessor<uChar, Axis<0> > jj(j); 126 131 for (ArrayAccessor<uChar, Axis<3> > ii(i);ii != ii.end(); ++ii) { 127 132 (*ii) = (*jj); … … 130 135 j++; 131 136 } 137 return True; 132 138 } 133 139 … … 139 145 aa1.reset(aa1.begin(whichIF)); 140 146 // assert dimensions are the same.... 141 uInt idx = 0; 142 143 144 for (ArrayAccessor<Float, Axis<2> > i(aa1);i != i.end(); ++i) { 145 idx = 0; 147 for (ArrayAccessor<Float, Axis<3> > i(aa1);i != i.end(); ++i) { 146 148 ArrayAccessor<Float, Axis<0> > j(tsys); 147 for (ArrayAccessor<Float, Axis< 3> > ii(i);ii != ii.end(); ++ii) {149 for (ArrayAccessor<Float, Axis<2> > ii(i);ii != ii.end(); ++ii) { 148 150 (*ii) = (*j); 149 151 j++;
Note: See TracChangeset
for help on using the changeset viewer.