Changeset 2005


Ignore:
Timestamp:
02/23/11 19:19:36 (13 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: Yes (CAS-2817/ASAP-232)

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: added a new function SrcType::getName(int)

Test Programs: sdlist (CASA) or scantable.summary()

Put in Release Notes: No

Module(s): scantable, sdlist, sdplot

Description:

Added a new function SrcType::getName(int srctype) which returns
a source type in string.
The source type of each scan is retuned by Scantable::summary.


Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/external-alma/atnf/PKSIO/SrcType.h

    r1985 r2005  
    3333#ifndef ATNF_SRCTYPE_H
    3434#define ATNF_SRCTYPE_H
     35
     36//# Includes
     37#include <casa/aips.h>
     38#include <casa/BasicSL/String.h>
     39
     40using namespace std ;
     41#include <casa/namespace.h>
    3542
    3643// <sumamry>
     
    6976              CAL      = 92,
    7077              NOTYPE   = 99 } ;
     78
     79  static String getName(const Int srctype)
     80{
     81  String obsType ;
     82  switch( srctype ) {
     83  case Int(SrcType::PSON):
     84    obsType = "PSON" ;
     85    break ;
     86  case Int(SrcType::PSOFF):
     87    obsType = "PSOFF" ;
     88    break ;
     89  case Int(SrcType::NOD):
     90    obsType = "NOD" ;
     91    break ;
     92  case Int(SrcType::FSON):
     93    obsType = "FSON" ;
     94    break ;
     95  case Int(SrcType::FSOFF):
     96    obsType = "FSOFF" ;
     97    break ;
     98  case Int(SrcType::SKY):
     99    obsType = "SKY" ;
     100    break ;
     101  case Int(SrcType::HOT):
     102    obsType = "HOT" ;
     103    break ;
     104  case Int(SrcType::WARM):
     105    obsType = "WARM" ;
     106    break ;
     107  case Int(SrcType::COLD):
     108    obsType = "COLD" ;
     109    break ;
     110  case Int(SrcType::PONCAL):
     111    obsType = "PSON:CALON" ;
     112    break ;
     113  case Int(SrcType::POFFCAL):
     114    obsType = "PSOFF:CALON" ;
     115    break ;
     116  case Int(SrcType::NODCAL):
     117    obsType = "NOD:CALON" ;
     118    break ;
     119  case Int(SrcType::FONCAL):
     120    obsType = "FSON:CALON" ;
     121    break ;
     122  case Int(SrcType::FOFFCAL):
     123    obsType = "FSOFF:CALOFF" ;
     124    break ;
     125  case Int(SrcType::FSLO):
     126    obsType = "FSLO" ;
     127    break ;
     128  case Int(SrcType::FLOOFF):
     129    obsType = "FS:LOWER:OFF" ;
     130    break ;
     131  case Int(SrcType::FLOSKY):
     132    obsType = "FS:LOWER:SKY" ;
     133    break ;
     134  case Int(SrcType::FLOHOT):
     135    obsType = "FS:LOWER:HOT" ;
     136    break ;
     137  case Int(SrcType::FLOWARM):
     138    obsType = "FS:LOWER:WARM" ;
     139    break ;
     140  case Int(SrcType::FLOCOLD):
     141    obsType = "FS:LOWER:COLD" ;
     142    break ;
     143  case Int(SrcType::FSHI):
     144    obsType = "FSHI" ;
     145    break ;
     146  case Int(SrcType::FHIOFF):
     147    obsType = "FS:HIGHER:OFF" ;
     148    break ;
     149  case Int(SrcType::FHISKY):
     150    obsType = "FS:HIGHER:SKY" ;
     151    break ;
     152  case Int(SrcType::FHIHOT):
     153    obsType = "FS:HIGHER:HOT" ;
     154    break ;
     155  case Int(SrcType::FHIWARM):
     156    obsType = "FS:HIGHER:WARM" ;
     157    break ;
     158  case Int(SrcType::FHICOLD):
     159    obsType = "FS:HIGHER:COLD" ;
     160    break ;
     161  default:
     162    obsType = "NOTYPE" ;
     163  }
     164
     165  return obsType ;
     166} ;
     167
    71168} ;
    72169
  • trunk/src/STWriter.cpp

    r2004 r2005  
    387387String STWriter::getObsTypes( Int srctype )
    388388{
    389   String obsType ;
    390   switch( srctype ) {
    391   case Int(SrcType::PSON):
    392     obsType = "PSON" ;
    393     break ;
    394   case Int(SrcType::PSOFF):
    395     obsType = "PSOFF" ;
    396     break ;
    397   case Int(SrcType::NOD):
    398     obsType = "NOD" ;
    399     break ;
    400   case Int(SrcType::FSON):
    401     obsType = "FSON" ;
    402     break ;
    403   case Int(SrcType::FSOFF):
    404     obsType = "FSOFF" ;
    405     break ;
    406   case Int(SrcType::SKY):
    407     obsType = "SKY" ;
    408     break ;
    409   case Int(SrcType::HOT):
    410     obsType = "HOT" ;
    411     break ;
    412   case Int(SrcType::WARM):
    413     obsType = "WARM" ;
    414     break ;
    415   case Int(SrcType::COLD):
    416     obsType = "COLD" ;
    417     break ;
    418   case Int(SrcType::PONCAL):
    419     obsType = "PSON:CALON" ;
    420     break ;
    421   case Int(SrcType::POFFCAL):
    422     obsType = "PSOFF:CALON" ;
    423     break ;
    424   case Int(SrcType::NODCAL):
    425     obsType = "NOD:CALON" ;
    426     break ;
    427   case Int(SrcType::FONCAL):
    428     obsType = "FSON:CALON" ;
    429     break ;
    430   case Int(SrcType::FOFFCAL):
    431     obsType = "FSOFF:CALOFF" ;
    432     break ;
    433   case Int(SrcType::FSLO):
    434     obsType = "FSLO" ;
    435     break ;
    436   case Int(SrcType::FLOOFF):
    437     obsType = "FS:LOWER:OFF" ;
    438     break ;
    439   case Int(SrcType::FLOSKY):
    440     obsType = "FS:LOWER:SKY" ;
    441     break ;
    442   case Int(SrcType::FLOHOT):
    443     obsType = "FS:LOWER:HOT" ;
    444     break ;
    445   case Int(SrcType::FLOWARM):
    446     obsType = "FS:LOWER:WARM" ;
    447     break ;
    448   case Int(SrcType::FLOCOLD):
    449     obsType = "FS:LOWER:COLD" ;
    450     break ;
    451   case Int(SrcType::FSHI):
    452     obsType = "FSHI" ;
    453     break ;
    454   case Int(SrcType::FHIOFF):
    455     obsType = "FS:HIGHER:OFF" ;
    456     break ;
    457   case Int(SrcType::FHISKY):
    458     obsType = "FS:HIGHER:SKY" ;
    459     break ;
    460   case Int(SrcType::FHIHOT):
    461     obsType = "FS:HIGHER:HOT" ;
    462     break ;
    463   case Int(SrcType::FHIWARM):
    464     obsType = "FS:HIGHER:WARM" ;
    465     break ;
    466   case Int(SrcType::FHICOLD):
    467     obsType = "FS:HIGHER:COLD" ;
    468     break ;
    469   default:
    470     obsType = "NOTYPE" ;
    471   }
    472 
    473   return obsType ;
    474 }
    475 
    476 }
     389  return SrcType::getName(srctype) ;
     390}
     391
     392}
  • trunk/src/Scantable.cpp

    r1994 r2005  
    6161#include <coordinates/Coordinates/CoordinateUtil.h>
    6262
     63#include <atnf/PKSIO/SrcType.h>
    6364#include "Scantable.h"
    6465#include "STPolLinear.h"
     
    994995                  + ")";
    995996  oss << setw(5) << "Scan" << setw(15) << "Source"
    996       << setw(10) << "Time" << setw(18) << "Integration" << endl;
     997      << setw(10) << "Time" << setw(18) << "Integration"
     998      << setw(15) << "Source Type" << endl;
    997999  oss << setw(5) << "" << setw(5) << "Beam" << setw(3) << "" << dirtype << endl;
    9981000  oss << setw(10) << "" << setw(3) << "IF" << setw(3) << ""
     
    10201022    }
    10211023    oss << setw(3) << std::right << nint  << setw(3) << " x " << std::left
    1022         << setw(6) <<  formatSec(rec.asFloat("INTERVAL")) << endl;
     1024        << setw(11) <<  formatSec(rec.asFloat("INTERVAL")) << setw(1) << ""
     1025        << setw(15) << SrcType::getName(rec.asInt("SRCTYPE")) << endl;
    10231026
    10241027    TableIterator biter(subt, "BEAMNO");
  • trunk/src/Scantable.h

    r1994 r2005  
    501501
    502502  /**
    503    * Turns a time vale into a formatted string
     503   * Turns a time value into a formatted string
    504504   * @param x
    505505   * @return
Note: See TracChangeset for help on using the changeset viewer.