Changeset 308


Ignore:
Timestamp:
01/27/05 21:48:53 (19 years ago)
Author:
kil064
Message:

use function 'near' in function SDFreqTable:addFrequency

to test for pre-exitsing entgries

fix error with refPix being Int instead of double in SDFreqTable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDContainer.cc

    r215 r308  
    3535#include <casa/Arrays/Matrix.h>
    3636#include <casa/Arrays/ArrayAccessor.h>
     37#include <casa/BasicMath/Math.h>
    3738#include <casa/Quanta/MVTime.h>
     39
    3840
    3941#include "SDDefs.h"
     
    355357}
    356358
    357 Int SDFrequencyTable::addFrequency(Int refPix, Double refVal, Double inc) {
     359Int SDFrequencyTable::addFrequency(Double refPix, Double refVal, Double inc) {
    358360  Int idx = -1;
    359361  Bool addit = False;
    360362  if (length() > 0) {
    361363    for (uInt i=0; i< length();++i) {
    362       if ( refVal == refVal_[i] ) { // probably check with tolerance
    363         if ( refPix == refPix_[i] )
    364           if ( inc == increment_[i] )
     364      if ( near(refVal,refVal_[i]) ) {
     365        if (near(refPix,refPix_[i]) )
     366          if ( near(inc,increment_[i]) )
    365367            idx = Int(i);
    366368      }
Note: See TracChangeset for help on using the changeset viewer.