Ignore:
Timestamp:
07/29/10 19:13:46 (14 years ago)
Author:
Kana Sugimoto
Message:

New Development: Yes

JIRA Issue: No (test merging alma branch)

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s):

Description:


Location:
branches/mergetest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/mergetest

  • branches/mergetest/src/STWriter.cpp

    r1688 r1779  
    4242#include <atnf/PKSIO/PKSMS2writer.h>
    4343#include <atnf/PKSIO/PKSSDwriter.h>
     44#include <atnf/PKSIO/SrcType.h>
    4445
    4546#include <tables/Tables/Table.h>
     
    154155    havexpol(ifs[i]) = nPol(ifs[i]) > 2;
    155156  }
    156   Vector<String> obstypes(2);
    157   obstypes(0) = "TR";//on
    158   obstypes(1) = "RF TR";//off
     157//   Vector<String> obstypes(2);
     158//   obstypes(0) = "TR";//on
     159//   obstypes(1) = "RF TR";//off
    159160  const Table table = inst->table();
    160161
     
    182183    while (!beamit.pastEnd() ) {
    183184      Table btable = beamit.table();
     185      //MDirection::ScalarColumn dirCol(btable, "DIRECTION");
     186      //pksrec.direction = dirCol(0).getAngle("rad").getValue();
    184187      TableIterator cycit(btable, "CYCLENO");
    185188      ROArrayColumn<Double> srateCol(btable, "SCANRATE");
     
    188191      Vector<Float> srateflt(sratedbl.nelements());
    189192      convertArray(srateflt, sratedbl);
    190       pksrec.scanRate = srateflt;
     193      //pksrec.scanRate = srateflt;
     194      pksrec.scanRate = sratedbl;
    191195      ROArrayColumn<Double> spmCol(btable, "SRCPROPERMOTION");
    192196      spmCol.get(0, pksrec.srcPM);
     
    200204      while (!cycit.pastEnd() ) {
    201205        Table ctable = cycit.table();
    202         TableIterator ifit(ctable, "IFNO");
     206        TableIterator ifit(ctable, "IFNO", TableIterator::Ascending, TableIterator::HeapSort);
    203207        MDirection::ScalarColumn dirCol(ctable, "DIRECTION");
    204208        pksrec.direction = dirCol(0).getAngle("rad").getValue();
     
    213217          uInt nchan = specCol(0).nelements();
    214218          Double crval,crpix;
     219          //Vector<Double> restfreq;
    215220          Float tmp0,tmp1,tmp2,tmp3,tmp4;
    216           String stmp0,stmp1;
     221          String tcalt;
     222          Vector<String> stmp0, stmp1;
    217223          inst->frequencies().getEntry(crpix,crval, pksrec.freqInc,
    218224                                     rec.asuInt("FREQ_ID"));
     
    239245          pksrec.fieldName = rec.asString("FIELDNAME");
    240246          pksrec.srcName   = rec.asString("SRCNAME");
    241           pksrec.obsType   = obstypes[rec.asInt("SRCTYPE")];
     247          //pksrec.obsType   = obstypes[rec.asInt("SRCTYPE")];
     248          pksrec.obsType = getObsTypes( rec.asInt("SRCTYPE") ) ;
    242249          pksrec.bandwidth = nchan * abs(pksrec.freqInc);
    243250          pksrec.azimuth   = rec.asFloat("AZIMUTH");
     
    253260          pksrec.baseSub   = 0.0f;
    254261          pksrec.xCalFctr  = 0.0;
     262          pksrec.flagrow = rec.asuInt("FLAGROW");
    255263
    256264          status = writer_->write(pksrec);
     
    348356}
    349357
    350 }
     358// get obsType string from SRCTYPE value
     359String STWriter::getObsTypes( Int srctype )
     360{
     361  String obsType ;
     362  switch( srctype ) {
     363  case Int(SrcType::PSON):
     364    obsType = "PSON" ;
     365    break ;
     366  case Int(SrcType::PSOFF):
     367    obsType = "PSOFF" ;
     368    break ;
     369  case Int(SrcType::NOD):
     370    obsType = "NOD" ;
     371    break ;
     372  case Int(SrcType::FSON):
     373    obsType = "FSON" ;
     374    break ;
     375  case Int(SrcType::FSOFF):
     376    obsType = "FSOFF" ;
     377    break ;
     378  case Int(SrcType::SKY):
     379    obsType = "SKY" ;
     380    break ;
     381  case Int(SrcType::HOT):
     382    obsType = "HOT" ;
     383    break ;
     384  case Int(SrcType::WARM):
     385    obsType = "WARM" ;
     386    break ;
     387  case Int(SrcType::COLD):
     388    obsType = "COLD" ;
     389    break ;
     390  case Int(SrcType::PONCAL):
     391    obsType = "PSON:CALON" ;
     392    break ;
     393  case Int(SrcType::POFFCAL):
     394    obsType = "PSOFF:CALON" ;
     395    break ;
     396  case Int(SrcType::NODCAL):
     397    obsType = "NOD:CALON" ;
     398    break ;
     399  case Int(SrcType::FONCAL):
     400    obsType = "FSON:CALON" ;
     401    break ;
     402  case Int(SrcType::FOFFCAL):
     403    obsType = "FSOFF:CALOFF" ;
     404    break ;
     405  case Int(SrcType::FSLO):
     406    obsType = "FSLO" ;
     407    break ;
     408  case Int(SrcType::FLOOFF):
     409    obsType = "FS:LOWER:OFF" ;
     410    break ;
     411  case Int(SrcType::FLOSKY):
     412    obsType = "FS:LOWER:SKY" ;
     413    break ;
     414  case Int(SrcType::FLOHOT):
     415    obsType = "FS:LOWER:HOT" ;
     416    break ;
     417  case Int(SrcType::FLOWARM):
     418    obsType = "FS:LOWER:WARM" ;
     419    break ;
     420  case Int(SrcType::FLOCOLD):
     421    obsType = "FS:LOWER:COLD" ;
     422    break ;
     423  case Int(SrcType::FSHI):
     424    obsType = "FSHI" ;
     425    break ;
     426  case Int(SrcType::FHIOFF):
     427    obsType = "FS:HIGHER:OFF" ;
     428    break ;
     429  case Int(SrcType::FHISKY):
     430    obsType = "FS:HIGHER:SKY" ;
     431    break ;
     432  case Int(SrcType::FHIHOT):
     433    obsType = "FS:HIGHER:HOT" ;
     434    break ;
     435  case Int(SrcType::FHIWARM):
     436    obsType = "FS:HIGHER:WARM" ;
     437    break ;
     438  case Int(SrcType::FHICOLD):
     439    obsType = "FS:HIGHER:COLD" ;
     440    break ;
     441  default:
     442    obsType = "NOTYPE" ;
     443  }
     444
     445  return obsType ;
     446}
     447
     448}
Note: See TracChangeset for help on using the changeset viewer.