Changeset 1255


Ignore:
Timestamp:
09/11/06 13:59:54 (18 years ago)
Author:
mar637
Message:

Fix for Ticket #78 - auto_quotient was not handling the case where no closest in tiem was found. Added 0.5s width around min(delta_t)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/Release2.1.0b/src/STMath.cpp

    r1227 r1255  
    350350  TableRow row(tout);
    351351  ROScalarColumn<Double> offtimeCol(offs, "TIME");
    352 
    353352  ArrayColumn<Float> outspecCol(tout, "SPECTRA");
    354353  ROArrayColumn<Float> outtsysCol(tout, "TSYS");
     
    359358    ROScalarColumn<Double> offtimeCol(offs, "TIME");
    360359    Double mindeltat = min(abs(offtimeCol.getColumn() - ontime));
    361     Table sel = offs( abs(offs.col("TIME")-ontime) <= mindeltat
     360    // Timestamp may vary within a cycle ???!!!
     361    // increase this by 0.5 sec in case of rounding errors...
     362    // There might be a better way to do this.
     363    mindeltat += 0.5;
     364    Table sel = offs( abs(offs.col("TIME")-ontime) <= (mindeltat+0.5)
    362365                       && offs.col("BEAMNO") == Int(rec.asuInt("BEAMNO"))
    363366                       && offs.col("IFNO") == Int(rec.asuInt("IFNO"))
    364367                       && offs.col("POLNO") == Int(rec.asuInt("POLNO")) );
    365368
     369    if ( sel.nrow() < 1 )  {
     370      throw(AipsError("No closest in time found... This could be a rounding "
     371                      "issue. Try quotient instead."));
     372    }
    366373    TableRow offrow(sel);
    367374    const TableRecord& offrec = offrow.get(0);//should only be one row
Note: See TracChangeset for help on using the changeset viewer.