Ignore:
Timestamp:
12/01/11 17:33:24 (13 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: test_importasdm_sd

Put in Release Notes: es/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Bug fix on asdm2ASAP that causes segmentation fault.


File:
1 edited

Legend:

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

    r2307 r2355  
    850850                                    vector<double> &restfreq )
    851851{
     852  String funcName = "getSourceProperty" ;
    852853  ostringstream oss ;
    853854  oss << fieldRow_p->getFieldName() << "__" << vmsData_->v_fieldId[dataIndex_] ;
    854855  fieldname = oss.str() ;
     856  SourceRow *srow = 0 ;
    855857  if ( fieldRow_p->isSourceIdExists() ) {
    856858    int sourceId = fieldRow_p->getSourceId() ;
    857     SourceRow *srow = asdm_->getSource().getRowByKey( sourceId, timeInterval_, specWinTag_ ) ;
     859    srow = asdm_->getSource().getRowByKey( sourceId, timeInterval_, specWinTag_ ) ;
     860  }
     861  if ( srow != 0 ) {
     862    //logsink_->postLocally( LogMessage("timeInterval_="+String::toString(timeInterval_.getStart().getMJD()),LogOrigin(className_,funcName,WHERE)) ) ;
     863    //logsink_->postLocally( LogMessage("specWinTag_="+String::toString(specWinTag_.toString()),LogOrigin(className_,funcName,WHERE)) ) ;
     864    //SourceRow *srow = asdm_->getSource().getRowByKey( sourceId, timeInterval_, specWinTag_ ) ;
     865    //logsink_->postLocally( LogMessage("sourceId="+String::toString(sourceId),LogOrigin(className_,funcName,WHERE)) ) ;
     866    //if ( srow == 0 )
     867    //logsink_->postLocally( LogMessage("nullpo",LogOrigin(className_,funcName,WHERE)) ) ;
    858868
    859869    // source name
    860870    srcname = srow->getSourceName() ;
     871    //logsink_->postLocally( LogMessage("srcname="+String::toString(srcname),LogOrigin(className_,funcName,WHERE)) ) ;
    861872
    862873    // source direction
     
    865876    srcdir[0] = limitedAngle( srcdirA[0].get() ) ;
    866877    srcdir[1] = limitedAngle( srcdirA[1].get() ) ;
     878    //logsink_->postLocally( LogMessage("srcdir=["+String::toString(srcdir[0])+","+String::toString(srcdir[1])+"]",LogOrigin(className_,funcName,WHERE)) ) ;
    867879    if ( srow->isDirectionCodeExists() ) {
    868880      DirectionReferenceCodeMod::DirectionReferenceCode dircode = srow->getDirectionCode() ;
     
    881893    srcpm[0] = srcpmA[0].get() ;
    882894    srcpm[1] = srcpmA[1].get() ;
    883 
     895    //logsink_->postLocally( LogMessage("srcpm=["+String::toString(srcpm[0])+","+String::toString(srcpm[1])+"]",LogOrigin(className_,funcName,WHERE)) ) ;
    884896    // systemic velocity
    885897    if ( srow->isSysVelExists() ) {
     
    891903      sysvel = 0.0 ;
    892904    }
    893 
     905    //logsink_->postLocally( LogMessage("sysvel="+String::toString(sysvel),LogOrigin(className_,funcName,WHERE)) ) ;
    894906    // rest frequency
    895907    if ( srow->isRestFrequencyExists() ) {
     
    903915      restfreq.resize( 0 ) ;
    904916    }
     917    //logsink_->postLocally( LogMessage("restfreq.size()="+String::toString(restfreq.size()),LogOrigin(className_,funcName,WHERE)) ) ;
    905918  }
    906919  else {
     
    11751188  vector< vector<float> > defaultT( 1, vector<float>( 1, 1.0 ) ) ;
    11761189  SysCalRow *scrow = getSysCalRow() ;
     1190  //logsink_->postLocally( LogMessage("scrow = "+String::toString((long)scrow),LogOrigin(className_,funcName,WHERE)) ) ;
    11771191  if ( scrow == 0 ) {
    11781192    tcal = defaultT ;
     
    11841198      unsigned int numReceptor = tsysSpec.size() ;
    11851199      unsigned int numChan = tsysSpec[0].size() ;
     1200      //logsink_->postLocally( LogMessage("TSYS: numReceptor = "+String::toString(numReceptor),LogOrigin(className_,funcName,WHERE)) ) ;
     1201      //logsink_->postLocally( LogMessage("TSYS:numChan = "+String::toString(numChan),LogOrigin(className_,funcName,WHERE)) ) ;
    11861202      tsys.resize( numReceptor ) ;
    11871203      for ( unsigned int ir = 0 ; ir < numReceptor ; ir++ ) {
     
    11991215      unsigned int numReceptor = tcalSpec.size() ;
    12001216      unsigned int numChan = tcalSpec[0].size() ;
     1217      //logsink_->postLocally( LogMessage("TCAL: numReceptor = "+String::toString(numReceptor),LogOrigin(className_,funcName,WHERE)) ) ;
     1218      //logsink_->postLocally( LogMessage("TCAL: numChan = "+String::toString(numChan),LogOrigin(className_,funcName,WHERE)) ) ;
    12011219      tcal.resize( numReceptor ) ;
    12021220      for ( unsigned int ir = 0 ; ir < numReceptor ; ir++ ) {
    1203         tcal[ir].resize( numReceptor ) ;
     1221        tcal[ir].resize( numChan ) ;
    12041222        for ( unsigned int ic = 0 ; ic < numChan ; ic++ ) {
    12051223          tcal[ir][ic] = tcalSpec[ir][ic].get() ;
Note: See TracChangeset for help on using the changeset viewer.