Ignore:
Timestamp:
07/27/07 02:00:22 (17 years ago)
Author:
TakTsutsumi
Message:

merged from NRAO version of ASAP 2.1 with ALMA specific modifications

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/alma/src/STFiller.cpp

    r1188 r1387  
    2626
    2727#include <atnf/PKSIO/PKSreader.h>
     28#include <casa/System/ProgressMeter.h>
     29
    2830
    2931#include "STDefs.h"
     
    117119                                  header_->freqref,
    118120                                  header_->utc, header_->reffreq,
    119                                   header_->bandwidth);
     121                                  header_->bandwidth,
     122                                  header_->fluxunit);
    120123
    121124  if (status) {
     
    135138  // Determine Telescope and set brightness unit
    136139
     140
    137141  Bool throwIt = False;
    138142  Instrument inst = STAttr::convertInstrument(header_->antennaname, throwIt);
    139   header_->fluxunit = "Jy";
     143  //header_->fluxunit = "Jy";
    140144  if (inst==ATMOPRA || inst==TIDBINBILLA) {
    141145     header_->fluxunit = "K";
     
    184188  reader_->select(beams, ifs, start, end, ref, True, haveXPol_[0], False);
    185189  table_->setHeader(*header_);
     190  //For MS, add the location of POINTING of the input MS so one get
     191  //pointing data from there, if necessary.
     192  //Also find nrow in MS
     193  nInDataRow = 0;
     194  if (format == "MS2") {
     195    Path datapath(inName);
     196    String ptTabPath = datapath.absoluteName();
     197    Table inMS(ptTabPath);
     198    nInDataRow = inMS.nrow();
     199    ptTabPath.append("/POINTING");
     200    table_->table().rwKeywordSet().define("POINTING", ptTabPath);
     201    if ((header_->antennaname).matches("GBT")) {
     202      String GOTabPath = datapath.absoluteName();
     203      GOTabPath.append("/GBT_GO");
     204      table_->table().rwKeywordSet().define("GBT_GO", GOTabPath);
     205    }
     206  }
     207     
    186208}
    187209
     
    209231  Complex         xCalFctr;
    210232  Vector<Complex> xPol;
     233  Double min = 0.0;
     234  Double max = nInDataRow;
     235  ProgressMeter fillpm(min, max, "Data importing progress");
     236  int n = 0;
    211237  while ( status == 0 ) {
    212238    status = reader_->read(scanNo, cycleNo, mjd, interval, fieldName,
     
    220246                          spectra, flagtra, xCalFctr, xPol);
    221247    if ( status != 0 ) break;
     248    n += 1;
     249   
    222250    Regex filterrx(".*[SL|PA]$");
    223251    Regex obsrx("^AT.+");
     
    250278    RecordFieldPtr<String> srcnCol(rec, "SRCNAME");
    251279    RecordFieldPtr<Int> srctCol(rec, "SRCTYPE");
     280    RecordFieldPtr<String> fieldnCol(rec, "FIELDNAME");
     281    *fieldnCol = fieldName;
    252282    // try to auto-identify if it is on or off.
    253283    Regex rx(".*[e|w|_R]$");
     
    340370      row.put(table_->table().nrow()-1, rec);
    341371    }
     372    fillpm._update(n);
    342373  }
    343374  if (status > 0) {
     
    345376    throw(AipsError("Reading error occured, data possibly corrupted."));
    346377  }
     378  fillpm.done();
    347379  return status;
    348380}
Note: See TracChangeset for help on using the changeset viewer.