Changeset 1321


Ignore:
Timestamp:
03/06/07 14:30:28 (18 years ago)
Author:
mar637
Message:

Hopefully final fix to ticket #78;had to do a sub selection of BEAMNO,IFNO,POLNO fisrt, and also TIME column is MJD, which is in datys not seconds.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STMath.cpp

    r1319 r1321  
    406406    const TableRecord& rec = row.get(i);
    407407    Double ontime = rec.asDouble("TIME");
    408     ROScalarColumn<Double> offtimeCol(offs, "TIME");
     408    Table presel = offs(offs.col("BEAMNO") == Int(rec.asuInt("BEAMNO"))
     409                        && offs.col("IFNO") == Int(rec.asuInt("IFNO"))
     410                        && offs.col("POLNO") == Int(rec.asuInt("POLNO")) );
     411    ROScalarColumn<Double> offtimeCol(presel, "TIME");
     412
    409413    Double mindeltat = min(abs(offtimeCol.getColumn() - ontime));
    410414    // Timestamp may vary within a cycle ???!!!
    411     // increase this by 0.5 sec in case of rounding errors...
     415    // increase this by 0.01 sec in case of rounding errors...
    412416    // There might be a better way to do this.
    413     mindeltat += 0.5;
    414     Table sel = offs( abs(offs.col("TIME")-ontime) <= (mindeltat+0.5)
    415                        && offs.col("BEAMNO") == Int(rec.asuInt("BEAMNO"))
    416                        && offs.col("IFNO") == Int(rec.asuInt("IFNO"))
    417                        && offs.col("POLNO") == Int(rec.asuInt("POLNO")) );
     417    // fix to this fix. TIME is MJD, so 1.0d not 1.0s
     418    mindeltat += 0.01/24./60./60.;
     419    Table sel = presel( abs(presel.col("TIME")-ontime) <= mindeltat);
    418420
    419421    if ( sel.nrow() < 1 )  {
Note: See TracChangeset for help on using the changeset viewer.