Changeset 2216


Ignore:
Timestamp:
07/12/11 16:06:18 (13 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-1913

Ready for Test: Yes/No

Interface Changes: Yes/No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Accept multi spectral resolution type (e.g. fr,ca).
Separator changed from '+' to ',' for -srt and -corr-mode options.


Location:
trunk/external-alma/asdm2ASAP
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/external-alma/asdm2ASAP/ASDMReader.cc

    r2215 r2216  
    106106
    107107    // spectral resolution type
    108     String resolutionType = "all" ;
     108    string resolutionType = "all" ;
    109109    if ( asdmrec.isDefined( "srt" ) ) {
    110       resolutionType = asdmrec.asString( "srt" ) ;
    111     }
    112     if ( resolutionType == "all" ) {
    113       resolutionType_.set( FULL_RESOLUTION ) ;
    114       resolutionType_.set( BASEBAND_WIDE ) ;
    115       resolutionType_.set( CHANNEL_AVERAGE ) ;
    116     }
    117     else if ( resolutionType == "fr" ) {
    118       resolutionType_.set( FULL_RESOLUTION ) ;
    119     }
    120     else if ( resolutionType == "bw" ) {
    121       resolutionType_.set( BASEBAND_WIDE ) ;
    122     }
    123     else if ( resolutionType == "ca" ) {
    124       resolutionType_.set( CHANNEL_AVERAGE ) ;
    125     }
    126     else {
     110      resolutionType = string( asdmrec.asString( "srt" ) ) ;
     111    }
     112    string resolutionTypes[3] ;
     113    Int numType = split( resolutionType, resolutionTypes, 3, "," ) ;
     114    for ( Int it = 0 ; it < numType ; it++ ) {
     115      if ( resolutionTypes[it] == "all" ) {
     116        resolutionType_.reset() ;
     117        resolutionType_.set( FULL_RESOLUTION ) ;
     118        resolutionType_.set( BASEBAND_WIDE ) ;
     119        resolutionType_.set( CHANNEL_AVERAGE ) ;
     120        break ;
     121      }
     122      else if ( resolutionTypes[it] == "fr" ) {
     123        resolutionType_.set( FULL_RESOLUTION ) ;
     124      }
     125      else if ( resolutionTypes[it] == "bw" ) {
     126        resolutionType_.set( BASEBAND_WIDE ) ;
     127      }
     128      else if ( resolutionTypes[it] == "ca" ) {
     129        resolutionType_.set( CHANNEL_AVERAGE ) ;
     130      }
     131    }
     132    if ( resolutionType_.size() == 0 ) {
    127133      logsink_->postLocally( LogMessage( "Unrecognized option for spectral resolution type: "+String::toString(resolutionType), LogOrigin(className_,funcName,WHERE), LogMessage::WARN ) ) ;
    128134      status = false ;
     
    130136   
    131137    // input correlation mode
     138    string corrMode = "ao+ca" ;
    132139    if ( asdmrec.isDefined( "corr" ) ) {
    133       string corrMode = string( asdmrec.asString( "corr" ) ) ;
     140      corrMode = string( asdmrec.asString( "corr" ) ) ;
    134141      //logsink_->postLocally( LogMessage("corrMode = "+String(corrMode),LogOrigin(className_,funcName,WHERE)) ) ;
    135       string corrModes[3] ;
    136       Int numCorr = split( corrMode, corrModes, 3, "+" ) ;
    137       for ( Int ic = 0 ; ic < numCorr ; ic++ ) {
    138         if ( corrModes[ic] == "ao" ) {
    139           corrMode_.set( AUTO_ONLY ) ;
    140         }
    141         else if ( corrModes[ic] == "ca" ) {
    142           corrMode_.set( CROSS_AND_AUTO ) ;
    143         }
    144       }
    145       //delete corrModes ;
    146       if ( corrMode_.size() == 0 ) {
    147         logsink_->postLocally( LogMessage( "Invalid option for correlation mode: "+String::toString(corrMode), LogOrigin(className_,funcName,WHERE), LogMessage::WARN ) ) ;
    148         status = false ;
    149       }
     142    }
     143    string corrModes[3] ;
     144    Int numCorr = split( corrMode, corrModes, 3, "," ) ;
     145    for ( Int ic = 0 ; ic < numCorr ; ic++ ) {
     146      if ( corrModes[ic] == "ao" ) {
     147        corrMode_.set( AUTO_ONLY ) ;
     148      }
     149      else if ( corrModes[ic] == "ca" ) {
     150        corrMode_.set( CROSS_AND_AUTO ) ;
     151      }
     152    }
     153    if ( corrMode_.size() == 0 ) {
     154      logsink_->postLocally( LogMessage( "Invalid option for correlation mode: "+String::toString(corrMode), LogOrigin(className_,funcName,WHERE), LogMessage::WARN ) ) ;
     155      status = false ;
    150156    }
    151157
  • trunk/external-alma/asdm2ASAP/asdm2ASAP.cc

    r2215 r2216  
    2323  Input inp ;
    2424  String indent = "   " ;
    25   String versionInfo = "$Id$\nConverts an ASDM dataset into Scantable.\nUsage:\n"+indent+argv[0]+" -antenna <antenna name or id> -asdm <ASDM directory> -asap <Scantable name> [-apc both|yes|no] [-corr-mode ca|ao|ca+ao] [-ocorr-mode ao] [-time-sampling all|integration|subintegration] [-srt fr|bw|ca|all]" ;
     25  String versionInfo = "$Id$\nConverts an ASDM dataset into Scantable.\nUsage:\n"+indent+argv[0]+" -antenna <antenna name or id> -asdm <ASDM directory> -asap <Scantable name> [-apc both|yes|no] [-corr-mode ca|ao|ca,ao] [-ocorr-mode ao] [-time-sampling all|integration|subintegration] [-srt fr|bw|ca|fr,bw|fr,ca|ca,bw|all]" ;
    2626  Bool helpMode = False ;
    2727  for ( int i = 1 ; i < argc ; i++ ) {
     
    4747  inp.create( "ocorr-mode", "ao", "Output correlator mode: ao", "String" ) ;
    4848  inp.create( "time-sampling", "all", "time sampling mode: all|integration|subintegration", "String" ) ;
    49   inp.create( "srt", "all", "spectral resolution mode: all|fr(full resolution)|ca(channel average)|bw(baseband wide)", "String" ) ;
     49  inp.create( "srt", "all", "spectral resolution mode: all|fr(full resolution)|ca(channel average)|bw(baseband wide)|fr+ca|fr+bw|ca+bw", "String" ) ;
    5050  inp.create( "logfile", "", "logger output", "String" ) ;
    5151  inp.readArguments( argc, argv ) ;
Note: See TracChangeset for help on using the changeset viewer.