Changeset 244


Ignore:
Timestamp:
01/21/05 13:27:47 (20 years ago)
Author:
kil064
Message:

Add arg 'preserve' to quotient method to preserve continuum (or not)

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMath.cc

    r234 r244  
    422422     }
    423423
    424 // Compute quotient
    425 
    426      MaskedArray<Float> tmp = (mOn-*pMOff);
    427      Array<Float> out(tmp.getArray());
    428      out /= *pMOff;
    429      out *= tSysOffArr;
    430 
    431 //     MaskedArray<Float> tmp2 = (tSysOnArr * mOn / *pMOff) - tSysOffArr;
    432 
    433 
    434 // Fill container for this row
     424// Get container
    435425
    436426     SDContainer sc = on->getSDContainer(i);
    437 //
    438      putDataInSDC(sc, out, tmp.getMask());
     427
     428// Compute and put quotient into container
     429
     430     if (preserveContinuum) {     
     431        MaskedArray<Float> tmp = (tSysOffArr * mOn / *pMOff) - tSysOffArr;
     432        putDataInSDC(sc, tmp.getArray(), tmp.getMask());
     433     } else {
     434        MaskedArray<Float> tmp = (tSysOffArr * mOn / *pMOff) - tSysOnArr;
     435        putDataInSDC(sc, tmp.getArray(), tmp.getMask());
     436     }
    439437     sc.putTsys(tSysOffArr);
    440438     sc.scanid = i;
  • trunk/src/SDMathWrapper.cc

    r235 r244  
    3939
    4040SDMemTableWrapper SDMathWrapper::quotient(const SDMemTableWrapper& on,
    41                                           const SDMemTableWrapper& off)
     41                                          const SDMemTableWrapper& off,
     42                                          Bool preserveContinuum)
    4243{
    4344    SDMath sdm;
    44     return SDMemTableWrapper(sdm.quotient(on.getCP(), off.getCP()));
     45    return SDMemTableWrapper(sdm.quotient(on.getCP(), off.getCP(), preserveContinuum));
    4546}
    4647
  • trunk/src/SDMathWrapper.h

    r235 r244  
    4545// Quotient
    4646  SDMemTableWrapper quotient(const SDMemTableWrapper& on,
    47                              const SDMemTableWrapper& off);
     47                             const SDMemTableWrapper& off,
     48                             casa::Bool preserveContinuum);
    4849
    4950// Simple binary operations
Note: See TracChangeset for help on using the changeset viewer.