- Timestamp:
- 04/12/07 12:07:38 (18 years ago)
- Location:
- trunk/src
- Files:
-
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/MathUtils.cpp
r996 r1325 100 100 return out; 101 101 } 102 103 void mathutil::hanning(Vector<Float>& out, Vector<Bool>& outmask, 104 const Vector<Float>& in, const Vector<Bool>& mask, 105 Bool relaxed, Bool ignoreOther) { 106 Vector< Vector<Float> > weights(8); 107 Vector<Float> vals(3); 108 vals = 0.0;weights[0] = vals;// FFF 109 vals[0] = 1.0; vals[1] = 0.0; vals[2] = 0.0; weights[1] = vals;// TFF 110 vals[0] = 0.0; vals[1] = 1.0; vals[2] = 0.0; weights[2] = vals;// FTF 111 vals[0] = 1.0/3.0; vals[1] = 2.0/3.0; vals[2] = 0.0; weights[3] = vals;// TTF 112 vals[0] = 0.0; vals[1] = 0.0; vals[2] = 1.0;weights[4] = vals;// FFT 113 vals[0] = 0.5; vals[1] = 0.0; vals[2] = 0.5; weights[5] = vals;// TFT 114 vals[0] = 0.0; vals[1] = 2.0/3.0; vals[2] = 1.0/3.0; weights[6] = vals;// FTT 115 vals[0] = 0.25; vals[1] = 0.5; vals[2] = 0.25; weights[7] = vals;// TTT 116 // Chris' case 117 Vector<Bool> weighted(8); 118 if (relaxed) { 119 weighted = False; 120 weighted[7] = True; 121 122 } else { 123 weighted = True; 124 weighted[0] = False; 125 } 126 127 out.resize(in.nelements()); 128 outmask.resize(mask.nelements()); 129 // make special case for first and last 130 /// ...here 131 // loop from 1..n-2 132 out.resize(in.nelements()); 133 out[0] = in[0];out[out.nelements()-1] = in[in.nelements()-1]; 134 outmask.resize(mask.nelements()); 135 outmask = False; 136 uInt m;Vector<Float>* w; 137 for (uInt i=1; i < out.nelements()-1;++i) { 138 m = mask[i-1] + 2*mask[i] + 4*mask[i+1]; 139 w = &(weights[m]); 140 if (weighted[m]) { 141 out[i] = (*w)[0]*in[i-1] + (*w)[1]*in[i] + (*w)[2]*in[i+1]; 142 outmask[i] = True; 143 } else { // mask it 144 out[i] = in[i];//use arbitrary value 145 outmask[i] = False; 146 } 147 } 148 } -
trunk/src/MathUtils.h
r1033 r1325 50 50 * @param ignoreOther drop every second channel (NYI) 51 51 */ 52 template <class T> 53 void hanning(casa::Vector<T>& out, casa::Vector<casa::Bool>& outmask, 54 const casa::Vector<T>& in, const casa::Vector<casa::Bool>& mask, 52 void hanning(casa::Vector<casa::Float>& out, 53 casa::Vector<casa::Bool>& outmask, 54 const casa::Vector<casa::Float>& in, 55 const casa::Vector<casa::Bool>& mask, 55 56 casa::Bool relaxed=casa::False, 56 57 casa::Bool ignoreOther=casa::False); -
trunk/src/SConscript
r1135 r1325 10 10 for pf in pycpps: cpps.remove(pf) 11 11 12 casalibd = os.path.join(myenv['CASAROOT'],myenv['CASAARCH'],'lib')13 14 12 # location of libcasav.a 15 13 myenv.Prepend( LIBPATH = ['#/build'] ) 16 myenv.Install('#build', os.path.join(casalibd, 'libwcs.a'))17 14 myenv['SHLIBPREFIX']="" #gets rid of lib prefix 18 15 myenv.Append(CCFLAGS=["-DWCSLIB_GETWCSTAB"]) 19 16 # need to create library here to fool scons linker 20 casav = myenv.StaticLibrary(target = "casav", source = os.path.join(casalibd, 'version.o'))21 17 libasap = myenv.StaticLibrary(target = "asap", source = cpps) 22 18 myenv.Prepend( LIBS = ['asap'] ) 23 19 24 20 # Finally create the library for the module 25 so = myenv. SharedLibrary( target = "_asap", source = pycpps)21 so = myenv.LoadableModule( target = "_asap.so", source = pycpps, SHLIBSUFFIX="" ) 26 22 #test = myenv.Program("test", cpps) 27 23 Return("so") -
trunk/src/Scantable.cpp
r1323 r1325 22 22 #include <casa/Arrays/ArrayLogical.h> 23 23 #include <casa/Arrays/ArrayAccessor.h> 24 #include <casa/Arrays/Vector.h> 24 25 #include <casa/Arrays/VectorSTLIterator.h> 25 #include <casa/Arrays/Vector.h>26 26 #include <casa/BasicMath/Math.h> 27 27 #include <casa/BasicSL/Constants.h> … … 42 42 #include <tables/Tables/ExprNode.h> 43 43 #include <tables/Tables/TableRecord.h> 44 #include <casa/Quanta/MVTime.h> 45 #include <casa/Quanta/MVAngle.h> 46 #include <measures/Measures/MeasRef.h> 47 #include <measures/Measures/MeasTable.h> 48 // needed to avoid error in .tcc 49 #include <measures/Measures/MCDirection.h> 50 // 51 #include <measures/Measures/MDirection.h> 44 52 #include <measures/Measures/MFrequency.h> 45 53 #include <measures/Measures/MEpoch.h> 46 #include <measures/Measures/MeasTable.h>47 #include <measures/Measures/MeasRef.h>48 54 #include <measures/TableMeasures/TableMeasRefDesc.h> 49 55 #include <measures/TableMeasures/TableMeasValueDesc.h> … … 51 57 #include <measures/TableMeasures/ScalarMeasColumn.h> 52 58 #include <coordinates/Coordinates/CoordinateUtil.h> 53 #include <casa/Quanta/MVTime.h>54 #include <casa/Quanta/MVAngle.h>55 59 56 60 #include "Scantable.h"
Note:
See TracChangeset
for help on using the changeset viewer.