Index: trunk/external-alma/asdm2ASAP/ASDMReader.cc
===================================================================
--- trunk/external-alma/asdm2ASAP/ASDMReader.cc	(revision 2307)
+++ trunk/external-alma/asdm2ASAP/ASDMReader.cc	(revision 2355)
@@ -850,13 +850,24 @@
                                     vector<double> &restfreq ) 
 {
+  String funcName = "getSourceProperty" ;
   ostringstream oss ;
   oss << fieldRow_p->getFieldName() << "__" << vmsData_->v_fieldId[dataIndex_] ;
   fieldname = oss.str() ;
+  SourceRow *srow = 0 ; 
   if ( fieldRow_p->isSourceIdExists() ) {
     int sourceId = fieldRow_p->getSourceId() ;
-    SourceRow *srow = asdm_->getSource().getRowByKey( sourceId, timeInterval_, specWinTag_ ) ;
+    srow = asdm_->getSource().getRowByKey( sourceId, timeInterval_, specWinTag_ ) ;
+  }
+  if ( srow != 0 ) {
+    //logsink_->postLocally( LogMessage("timeInterval_="+String::toString(timeInterval_.getStart().getMJD()),LogOrigin(className_,funcName,WHERE)) ) ;
+    //logsink_->postLocally( LogMessage("specWinTag_="+String::toString(specWinTag_.toString()),LogOrigin(className_,funcName,WHERE)) ) ;
+    //SourceRow *srow = asdm_->getSource().getRowByKey( sourceId, timeInterval_, specWinTag_ ) ;
+    //logsink_->postLocally( LogMessage("sourceId="+String::toString(sourceId),LogOrigin(className_,funcName,WHERE)) ) ;
+    //if ( srow == 0 ) 
+    //logsink_->postLocally( LogMessage("nullpo",LogOrigin(className_,funcName,WHERE)) ) ;
 
     // source name
     srcname = srow->getSourceName() ;
+    //logsink_->postLocally( LogMessage("srcname="+String::toString(srcname),LogOrigin(className_,funcName,WHERE)) ) ;
 
     // source direction
@@ -865,4 +876,5 @@
     srcdir[0] = limitedAngle( srcdirA[0].get() ) ;
     srcdir[1] = limitedAngle( srcdirA[1].get() ) ;
+    //logsink_->postLocally( LogMessage("srcdir=["+String::toString(srcdir[0])+","+String::toString(srcdir[1])+"]",LogOrigin(className_,funcName,WHERE)) ) ;
     if ( srow->isDirectionCodeExists() ) {
       DirectionReferenceCodeMod::DirectionReferenceCode dircode = srow->getDirectionCode() ;
@@ -881,5 +893,5 @@
     srcpm[0] = srcpmA[0].get() ;
     srcpm[1] = srcpmA[1].get() ;
-
+    //logsink_->postLocally( LogMessage("srcpm=["+String::toString(srcpm[0])+","+String::toString(srcpm[1])+"]",LogOrigin(className_,funcName,WHERE)) ) ;
     // systemic velocity
     if ( srow->isSysVelExists() ) {
@@ -891,5 +903,5 @@
       sysvel = 0.0 ;
     }
-
+    //logsink_->postLocally( LogMessage("sysvel="+String::toString(sysvel),LogOrigin(className_,funcName,WHERE)) ) ;
     // rest frequency
     if ( srow->isRestFrequencyExists() ) {
@@ -903,4 +915,5 @@
       restfreq.resize( 0 ) ;
     }
+    //logsink_->postLocally( LogMessage("restfreq.size()="+String::toString(restfreq.size()),LogOrigin(className_,funcName,WHERE)) ) ;
   }
   else {
@@ -1175,4 +1188,5 @@
   vector< vector<float> > defaultT( 1, vector<float>( 1, 1.0 ) ) ;
   SysCalRow *scrow = getSysCalRow() ;
+  //logsink_->postLocally( LogMessage("scrow = "+String::toString((long)scrow),LogOrigin(className_,funcName,WHERE)) ) ;
   if ( scrow == 0 ) {
     tcal = defaultT ;
@@ -1184,4 +1198,6 @@
       unsigned int numReceptor = tsysSpec.size() ;
       unsigned int numChan = tsysSpec[0].size() ;
+      //logsink_->postLocally( LogMessage("TSYS: numReceptor = "+String::toString(numReceptor),LogOrigin(className_,funcName,WHERE)) ) ;
+      //logsink_->postLocally( LogMessage("TSYS:numChan = "+String::toString(numChan),LogOrigin(className_,funcName,WHERE)) ) ;
       tsys.resize( numReceptor ) ;
       for ( unsigned int ir = 0 ; ir < numReceptor ; ir++ ) {
@@ -1199,7 +1215,9 @@
       unsigned int numReceptor = tcalSpec.size() ;
       unsigned int numChan = tcalSpec[0].size() ;
+      //logsink_->postLocally( LogMessage("TCAL: numReceptor = "+String::toString(numReceptor),LogOrigin(className_,funcName,WHERE)) ) ;
+      //logsink_->postLocally( LogMessage("TCAL: numChan = "+String::toString(numChan),LogOrigin(className_,funcName,WHERE)) ) ;
       tcal.resize( numReceptor ) ;
       for ( unsigned int ir = 0 ; ir < numReceptor ; ir++ ) {
-        tcal[ir].resize( numReceptor ) ;
+        tcal[ir].resize( numChan ) ;
         for ( unsigned int ic = 0 ; ic < numChan ; ic++ ) {
           tcal[ir][ic] = tcalSpec[ir][ic].get() ;
