Changeset 2355


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.


Location:
trunk/external-alma
Files:
3 edited

Legend:

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

    r2301 r2355  
    134134        //unsigned int scanno = reader_->getScanNo() ;
    135135        unsigned int scanno = reader_->getScanNoOfCurrentRow() ;
     136        //logsink_->postLocally( LogMessage("scanno = "+String::toString(scanno),LogOrigin(className_,funcName,WHERE)) ) ;
    136137        //uInt subscanno = reader_->getSubscanNo() ;
    137138        citer = cycleno.find( scanno ) ;
     
    152153        string freqref = "" ;
    153154
     155        //logsink_->postLocally( LogMessage("numData = "+String::toString(numData),LogOrigin(className_,funcName,WHERE)) ) ;
    154156        for ( unsigned int idata = 0 ; idata < numData ; idata++ ) {
    155157          // prepare to extract binary data
     158          //logsink_->postLocally( LogMessage("prepare data...",LogOrigin(className_,funcName,WHERE)) ) ;
    156159          reader_->prepareData( idata ) ;
    157160
     
    159162          //unsigned int subscanno = reader_->getSubscanNo( idata ) ;
    160163          unsigned int subscanno = reader_->getSubscanNo() ;
     164          //logsink_->postLocally( LogMessage("subscanno = "+String::toString(subscanno),LogOrigin(className_,funcName,WHERE)) ) ;
    161165
    162166          // IFNO
    163167          //uInt ifno = reader_->getIFNo( idata ) ;
    164168          uInt ifno = reader_->getIFNo() ;
    165 
     169          //logsink_->postLocally( LogMessage("ifno = "+String::toString(ifno),LogOrigin(className_,funcName,WHERE)) ) ;
    166170          // source spec
    167171          int srctype = reader_->getSrcType( scanno, subscanno ) ;
     172          //logsink_->postLocally( LogMessage("srctype = "+String::toString(srctype),LogOrigin(className_,funcName,WHERE)) ) ;
    168173          string srcname ;
    169174          string fieldname ;
     
    185190                                      sysVel,
    186191                                      rf ) ;
    187          
     192          //logsink_->postLocally( LogMessage("srcname = "+String::toString(srcname),LogOrigin(className_,funcName,WHERE)) ) ;         
     193
    188194          // fill MOLECULE_ID and add MOLECULES row if necessary
    189195          Vector<casa::Double> restFreqs( rf.size() ) ;
     
    197203          casa::Double mjd = (casa::Double)(reader_->getTime()) ;
    198204          casa::Double interval = (casa::Double)(reader_->getInterval()) ;
     205          //logsink_->postLocally( LogMessage("mjd = "+String::toString(mjd),LogOrigin(className_,funcName,WHERE)) ) ;
    199206
    200207          // fill TIME and INTERVAL
     
    214221          unsigned int flagrow = reader_->getFlagRow() ;
    215222          setFlagrow( (uInt)flagrow ) ;
    216 
     223          //logsink_->postLocally( LogMessage("flagrow = "+String::toString(flagrow),LogOrigin(className_,funcName,WHERE)) ) ;
    217224          // fill WEATHER_ID and add WEATHER row if necessary
    218225          float temperature ;
     
    237244                       (casa::Float)windspeed,
    238245                       (casa::Float)windaz ) ;
    239 
     246          //logsink_->postLocally( LogMessage("temperature = "+String::toString(temperature),LogOrigin(className_,funcName,WHERE)) ) ;
    240247          // fill AZIMUTH, ELEVATION, DIRECTION and SCANRATE
    241248          vector<double> dir ;
     
    302309//               oss << dataShape[i] << ", " ;
    303310//           }
    304           //logsink_->postLocally( LogMessage(oss.str(),LogOrigin(className_,funcName,WHERE)) ) ;
     311//           logsink_->postLocally( LogMessage(oss.str(),LogOrigin(className_,funcName,WHERE)) ) ;
    305312                                     
    306313          //int numPol = reader_->getNumPol( idata ) ;
     
    317324          // SPECTRA, FLAGTRA, TSYS, TCAL
    318325          //float *sp = reader_->getSpectrum( idata ) ;
     326          //logsink_->postLocally( LogMessage("getting spectra...",LogOrigin(className_,funcName,WHERE)) ) ;
    319327          float *sp = reader_->getSpectrum() ;
     328          //logsink_->postLocally( LogMessage("sp[0] = "+String::toString(sp[0]),LogOrigin(className_,funcName,WHERE)) ) ;
    320329          vector< vector<float> > ts ;
    321330          vector< vector<float> > tc ;
     
    323332          reader_->getTcalAndTsys( tc, ts ) ;
    324333          Matrix<casa::Float> spectra = toMatrix( sp, numPol, numChan ) ;
     334          //logsink_->postLocally( LogMessage("spectra(0,0) = "+String::toString(spectra(0,0)),LogOrigin(className_,funcName,WHERE)) ) ;
    325335          Vector<uChar> flagtra( numChan, 0 ) ;
    326336          Matrix<casa::Float> tsys = toMatrix( ts, numPol, numChan ) ;
    327337          Matrix<casa::Float> tcal = toMatrix( tc, numPol, numChan ) ;
     338          //logsink_->postLocally( LogMessage("tsys(0,0) = "+String::toString(tsys(0,0)),LogOrigin(className_,funcName,WHERE)) ) ;
    328339//           String caltime = "" ;
    329340//           if ( anyNE( tcal, (casa::Float)1.0 ) )
  • 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() ;
  • trunk/external-alma/oldasdm2ASAP/OldASDMReader.cc

    r2307 r2355  
    12011201      tcal.resize( numReceptor ) ;
    12021202      for ( unsigned int ir = 0 ; ir < numReceptor ; ir++ ) {
    1203         tcal[ir].resize( numReceptor ) ;
     1203        tcal[ir].resize( numChan ) ;
    12041204        for ( unsigned int ic = 0 ; ic < numChan ; ic++ ) {
    12051205          tcal[ir][ic] = tcalSpec[ir][ic].get() ;
Note: See TracChangeset for help on using the changeset viewer.