Changeset 1325 for trunk/src


Ignore:
Timestamp:
04/12/07 12:07:38 (18 years ago)
Author:
mar637
Message:

Changes to use casacore instead of casa_asap/aips++\nAdded atnf PKSIO library snapshot to external and linking against this local copy

Location:
trunk/src
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/MathUtils.cpp

    r996 r1325  
    100100  return out;
    101101}
     102
     103void 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  
    5050 * @param ignoreOther drop every second channel (NYI)
    5151 */
    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,
     52void 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,
    5556             casa::Bool relaxed=casa::False,
    5657             casa::Bool ignoreOther=casa::False);
  • trunk/src/SConscript

    r1135 r1325  
    1010for pf in pycpps: cpps.remove(pf)
    1111
    12 casalibd = os.path.join(myenv['CASAROOT'],myenv['CASAARCH'],'lib')
    13 
    1412# location of libcasav.a
    1513myenv.Prepend( LIBPATH = ['#/build'] )
    16 myenv.Install('#build', os.path.join(casalibd, 'libwcs.a'))
    1714myenv['SHLIBPREFIX']=""   #gets rid of lib prefix
    18 
     15myenv.Append(CCFLAGS=["-DWCSLIB_GETWCSTAB"])
    1916# need to create library here to fool  scons linker
    20 casav = myenv.StaticLibrary(target = "casav", source = os.path.join(casalibd, 'version.o'))
    2117libasap =  myenv.StaticLibrary(target = "asap", source = cpps)
    2218myenv.Prepend( LIBS =  ['asap'] )
    2319
    2420# Finally create the library for the module
    25 so = myenv.SharedLibrary( target = "_asap", source = pycpps )
     21so = myenv.LoadableModule( target = "_asap.so", source = pycpps, SHLIBSUFFIX="" )
    2622#test = myenv.Program("test", cpps)
    2723Return("so")
  • trunk/src/Scantable.cpp

    r1323 r1325  
    2222#include <casa/Arrays/ArrayLogical.h>
    2323#include <casa/Arrays/ArrayAccessor.h>
     24#include <casa/Arrays/Vector.h>
    2425#include <casa/Arrays/VectorSTLIterator.h>
    25 #include <casa/Arrays/Vector.h>
    2626#include <casa/BasicMath/Math.h>
    2727#include <casa/BasicSL/Constants.h>
     
    4242#include <tables/Tables/ExprNode.h>
    4343#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>
    4452#include <measures/Measures/MFrequency.h>
    4553#include <measures/Measures/MEpoch.h>
    46 #include <measures/Measures/MeasTable.h>
    47 #include <measures/Measures/MeasRef.h>
    4854#include <measures/TableMeasures/TableMeasRefDesc.h>
    4955#include <measures/TableMeasures/TableMeasValueDesc.h>
     
    5157#include <measures/TableMeasures/ScalarMeasColumn.h>
    5258#include <coordinates/Coordinates/CoordinateUtil.h>
    53 #include <casa/Quanta/MVTime.h>
    54 #include <casa/Quanta/MVAngle.h>
    5559
    5660#include "Scantable.h"
Note: See TracChangeset for help on using the changeset viewer.