Changeset 2836 for trunk


Ignore:
Timestamp:
08/07/13 15:11:19 (11 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: Yes (CAS-5139/TRAC-290)

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s): sbseparator

Description:

sbseparator handles flagged data sets to some extent.

  • separation of row flagged spectra (eigher in a part of or in all datasets) are handled properly.
  • separation of partly channel flagged spectra are handled properly only when identical channels are flagged throughout data sets

TODO:
handle cases when flagged channels vary among datasets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STSideBandSep.cpp

    r2835 r2836  
    547547  cout << "Grid parameter summary: " << endl;
    548548  cout << "- IF = " << sigIfno_ << endl;
    549   cout << "- center = " << scenter << ")\n"
     549  cout << "- center = " << scenter << "\n"
    550550       << "- npix = (" << nx << ", " << ny << ")\n"
    551        << "- cell = (" << scellx << ", " << scelly << endl;
     551       << "- cell = (" << scellx << ", " << scelly << ")" << endl;
    552552#endif
    553553  gridder.grid();
     
    642642    seltab_p->setSelection(sel2);
    643643    CountedPtr<Scantable> avetab_p;
    644     vector<bool> mask;
    645644    if (seltab_p->nrow() > 1) {
     645      // STMath::average also merges FLAGTRA and FLAGROW
    646646      avetab_p = stm.average(vector< CountedPtr<Scantable> >(1, seltab_p),
    647647                             vector<bool>(), "TINTSYS", "NONE");
     
    655655      avetab_p = seltab_p;
    656656    }
     657    // Check FLAGTRA and FLAGROW if there's any valid channel in the spectrum
     658    if (avetab_p->getFlagRow(0) || avetab_p->isAllChannelsFlagged(0)) {
     659#ifdef KS_DEBUG
     660      cout << "Table " << itab << " - All data are flagged. skipping the table."
     661           << endl;
     662#endif
     663      continue;
     664    }
     665    // Interpolate flagged channels of the spectrum.
     666    Vector<Float> tmpSpec = avetab_p->getSpectrum(0);
     667    vector<bool> mask = avetab_p->getMask(0);
     668    mathutil::doZeroOrderInterpolation(tmpSpec, mask);
    657669    spec.reference(specMat.column(nspec));
    658     spec = avetab_p->getSpectrum(0);
     670    spec = tmpSpec;
    659671    tabIdvec.push_back((uInt) itab);
    660672    nspec++;
    661673  } // end of table loop
     674  // Check the number of selected spectra and resize matrix.
    662675  if (nspec != nshift_){
    663676    //shiftSpecmat.resize(nchan_, nspec, true);
     677    specMat.resize(nchan_, nspec, true);
    664678#ifdef KS_DEBUG
    665679      cout << "Could not find corresponding rows in some tables."
     
    801815    throw(AipsError("Internal error. The number of input shifts and spectrum  differs."));
    802816
     817#ifdef KS_DEBUG
    803818  float minval, maxval;
     819#endif
    804820#ifdef KS_DEBUG
    805821  minMax(minval, maxval, specmat);
     
    12081224
    12091225bool STSideBandSep::getLo1FromAsdm(const string asdmname,
    1210                                    const double refval,
    1211                                    const double refpix,
    1212                                    const double increment,
    1213                                    const int nChan)
     1226                                   const double /*refval*/,
     1227                                   const double /*refpix*/,
     1228                                   const double /*increment*/,
     1229                                   const int /*nChan*/)
    12141230{
    12151231  // Check for relevant tables.
Note: See TracChangeset for help on using the changeset viewer.