Changeset 2289
- Timestamp:
- 09/08/11 19:35:40 (13 years ago)
- Location:
- trunk
- Files:
-
- 21 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/CMakeLists.txt
r2280 r2289 36 36 # flags 37 37 set( DEFAULT_CXX_FLAGS 38 "-pipe -Wall -Wextra -Wno-non-template-friend -Wcast-align -Wno-comment -O3 " )38 "-pipe -Wall -Wextra -Wno-non-template-friend -Wcast-align -Wno-comment -O3 -fno-omit-frame-pointer" ) 39 39 find_package( OpenMP ) 40 40 if( OPENMP_FOUND ) -
trunk/external-alma
- Property svn:mergeinfo changed
/branches/parallel/external-alma (added) merged: 2240,2247,2262-2264,2266
- Property svn:mergeinfo changed
-
trunk/external-alma/atnf/PKSIO/NRODataset.cc
r2212 r2289 71 71 dataid_ = -1 ; 72 72 73 // OS endian 74 int i = 1 ; 75 endian_ = -1 ; 76 if ( *reinterpret_cast<char *>(&i) == 1 ) { 77 endian_ = LITTLE_ENDIAN ; 78 os << LogIO::NORMAL << "LITTLE_ENDIAN " << LogIO::POST ; 79 } 80 else { 81 endian_ = BIG_ENDIAN ; 82 os << LogIO::NORMAL << "BIG_ENDIAN " << LogIO::POST ; 83 } 73 // endian matches 84 74 same_ = -1 ; 85 75 … … 353 343 vector< vector<double> > NRODataset::getSpectrum() 354 344 { 355 vector< vector<double> > spec ;345 vector< vector<double> > spec(rowNum_); 356 346 357 347 for ( int i = 0 ; i < rowNum_ ; i++ ) { 358 spec .push_back( getSpectrum( i )) ;348 spec[i] = getSpectrum( i ) ; 359 349 } 360 350 … … 370 360 // 371 361 // size of spectrum is not chmax_ but dataset_->getNCH() after binding 372 int nchan = NUMCH ; 373 vector<double> spec( chmax_, 0.0 ) ; // spectrum "before" binding 362 const int nchan = NUMCH ; 374 363 vector<double> bspec( nchan, 0.0 ) ; // spectrum "after" binding 375 364 // DEBUG … … 379 368 NRODataRecord *record = getRecord( i ) ; 380 369 381 int bit = IBIT ; // fixed to 12 bit370 const int bit = IBIT ; // fixed to 12 bit 382 371 double scale = record->SFCTR ; 383 372 // DEBUG … … 392 381 return bspec ; 393 382 } 394 char *cdata =record->LDATA ;383 unsigned char *cdata = (unsigned char *)record->LDATA ; 395 384 vector<double> mscale = MLTSCF ; 396 385 double dscale = mscale[getIndex( i )] ; … … 400 389 // char -> int 401 390 vector<int> ispec( chmax_, 0 ) ; 402 union SharedMemory { 403 int ivalue ; 404 unsigned char cbuf[4] ; 405 } ; 406 SharedMemory u ; 391 392 static const int shift_right[] = { 393 4, 0 394 }; 395 static const int start_pos[] = { 396 0, 1 397 }; 398 static const int incr[] = { 399 0, 3 400 }; 407 401 int j = 0 ; 408 char ctmp = 0x00 ;409 int sw = 0 ;410 402 for ( int i = 0 ; i < chmax_ ; i++ ) { 403 int ivalue = 0 ; 411 404 if ( bit == 12 ) { // 12 bit qunatization 412 u.ivalue = 0 ; 413 414 if ( endian_ == BIG_ENDIAN ) { 415 // big endian 416 if ( sw == 0 ) { 417 char c0 = (cdata[j] >> 4) & 0x0f ; 418 char c1 = ((cdata[j] << 4) & 0xf0) | ((cdata[j+1] >> 4) & 0x0f) ; 419 ctmp = cdata[j+1] & 0x0f ; 420 u.cbuf[2] = c0 ; 421 u.cbuf[3] = c1 ; 422 j += 2 ; 423 sw = 1 ; 424 } 425 else if ( sw == 1 ) { 426 u.cbuf[2] = ctmp ; 427 u.cbuf[3] = cdata[j] ; 428 j++ ; 429 sw = 0 ; 430 } 431 } 432 else if ( endian_ == LITTLE_ENDIAN ) { 433 // little endian 434 if ( sw == 0 ) { 435 char c0 = (cdata[j] >> 4) & 0x0f ; 436 char c1 = ((cdata[j] << 4) & 0xf0) | ((cdata[j+1] >> 4) & 0x0f) ; 437 ctmp = cdata[j+1] & 0x0f ; 438 u.cbuf[1] = c0 ; 439 u.cbuf[0] = c1 ; 440 j += 2 ; 441 sw = 1 ; 442 } 443 else if ( sw == 1 ) { 444 u.cbuf[1] = ctmp ; 445 u.cbuf[0] = cdata[j] ; 446 j++ ; 447 sw = 0 ; 448 } 449 } 450 } 451 452 ispec[i] = u.ivalue ; 405 const int idx = j + start_pos[i & 1]; 406 const unsigned tmp = unsigned(cdata[idx]) << 8 | cdata[idx + 1]; 407 ivalue = int((tmp >> shift_right[i & 1]) & 0xFFF); 408 j += incr[i & 1]; 409 } 410 411 ispec[i] = ivalue ; 453 412 if ( ( ispec[i] < 0 ) || ( ispec[i] > 4096 ) ) { 454 413 //cerr << "NRODataset::getSpectrum() ispec[" << i << "] is out of range" << endl ; … … 461 420 } 462 421 422 double *const spec = new double[ chmax_ ] ; // spectrum "before" binding 463 423 // int -> double 464 424 for ( int i = 0 ; i < chmax_ ; i++ ) { … … 490 450 bspec[i] = spec[i] ; 491 451 } 452 delete[] spec; 492 453 493 454 // DEBUG -
trunk/external-alma/atnf/PKSIO/NRODataset.h
r2198 r2289 506 506 507 507 // OS endian 508 int endian_ ;509 508 int same_ ; 510 509 -
trunk/external-alma/atnf/PKSIO/NROReader.cc
r2261 r2289 531 531 String &srcname, 532 532 String &fieldname, 533 Array<Float> &spectra,534 Array<uChar> &flagtra,535 Array<Float> &tsys,536 Array<Double> &direction,533 Vector<Float> &spectra, 534 Vector<uChar> &flagtra, 535 Vector<Float> &tsys, 536 Vector<Double> &direction, 537 537 Float &azimuth, 538 538 Float &elevation, … … 548 548 Float &winddir, 549 549 Double &srcvel, 550 Array<Double> &propermotion,550 Vector<Double> &propermotion, 551 551 Vector<Double> &srcdir, 552 Array<Double> &scanrate ) 553 { 552 Vector<Double> &scanrate ) 553 { 554 static const IPosition oneByOne( 1, 1 ); 555 554 556 // DEBUG 555 557 //cout << "NROReader::getScanInfo() irow = " << irow << endl ; … … 589 591 590 592 // restfreq (for MOLECULE_ID) 591 Vector<Double> rf( IPosition( 1, 1 ) ) ; 592 rf( 0 ) = record->FREQ0 ; 593 restfreq = rf ; 593 restfreq.resize( oneByOne ) ; 594 restfreq[0] = record->FREQ0 ; 594 595 //cout << "restfreq = " << rf << endl ; 595 596 … … 617 618 // spectra 618 619 vector<double> spec = dataset_->getSpectrum( irow ) ; 619 Array<Float> sp( IPosition( 1, spec.size()) ) ;620 spectra.resize( spec.size() ) ; 620 621 int index = 0 ; 621 for ( Array<Float>::iterator itr = sp.begin() ; itr != sp.end() ; itr++ ) {622 for ( Vector<Float>::iterator itr = spectra.begin() ; itr != spectra.end() ; itr++ ) { 622 623 *itr = spec[index++] ; 623 624 } 624 spectra = sp ;625 625 //cout << "spec.size() = " << spec.size() << endl ; 626 626 627 627 // flagtra 628 Array<uChar> flag( spectra.shape() ) ; 629 flag.set( 0 ) ; 630 flagtra = flag ; 628 flagtra.resize( spectra.nelements() ) ; 629 flagtra.set( 0 ) ; 631 630 //cout << "flag.size() = " << flag.size() << endl ; 632 631 633 632 // tsys 634 Array<Float> tmp( IPosition( 1, 1 ), record->TSYS) ;635 tsys = tmp;633 tsys.resize( oneByOne ) ; 634 tsys[0] = record->TSYS ; 636 635 //cout << "tsys[0] = " << tsys[0] << endl ; 637 636 … … 693 692 694 693 // propermotion 695 Array<Double> srcarr( IPosition( 1, 2 ) ) ; 696 srcarr = 0.0 ; 697 propermotion = srcarr ; 698 //cout << "propermotion = [" << propermotion[0] << ", " << propermotion[1] << "]" << endl ; 694 // do nothing 699 695 700 696 // srcdir … … 703 699 704 700 // scanrate 705 Array<Double> sr( IPosition( 1, 1 ) ) ; 706 sr = 0.0 ; 707 scanrate = sr ; 708 //cout << "scanrate = " << scanrate[0] << endl ; 701 // do nothing 709 702 710 703 return 0 ; -
trunk/external-alma/atnf/PKSIO/NROReader.h
r2201 r2289 139 139 String &srcname, 140 140 String &fieldname, 141 Array<Float> &spectra,142 Array<uChar> &flagtra,143 Array<Float> &tsys,144 Array<Double> &direction,141 Vector<Float> &spectra, 142 Vector<uChar> &flagtra, 143 Vector<Float> &tsys, 144 Vector<Double> &direction, 145 145 Float &azimuth, 146 146 Float &elevation, … … 156 156 Float &winddir, 157 157 Double &srcvel, 158 Array<Double> &propermotion,158 Vector<Double> &propermotion, 159 159 Vector<Double> &srcdir, 160 Array<Double> &scanrate ) ;160 Vector<Double> &scanrate ) ; 161 161 162 162 // Get scan type -
trunk/external-alma/atnf/pks/pks_maths.cc
- Property svn:mergeinfo changed
/branches/parallel/external-alma/atnf/pks/pks_maths.cc (added) merged: 2240,2247,2262
- Property svn:mergeinfo changed
-
trunk/src
- Property svn:mergeinfo changed
/branches/parallel/src (added) merged: 2205,2240,2247,2262-2263,2267,2274,2281-2285,2287-2288
- Property svn:mergeinfo changed
-
trunk/src/CMakeLists.txt
r1974 r2289 22 22 set( ASAP_SRCS 23 23 ${SRCDIR}/MathUtils.cpp 24 ${SRCDIR}/TableTraverse.cpp 24 25 ${SRCDIR}/RowAccumulator.cpp 25 26 ${SRCDIR}/Logger.cpp -
trunk/src/FillerBase.cpp
r2242 r2289 28 28 RecordFieldPtr<Int> fitIdCol( row_.record(), "FIT_ID" ) ; 29 29 *fitIdCol = -1 ; 30 31 mEntry_.resize( 0 ) ; 32 mIdx_.resize( 0 ) ; 33 fEntry_.resize( 0 ) ; 34 fIdx_.resize( 0 ) ; 35 wEntry_.resize( 0 ) ; 36 wIdx_.resize( 0 ) ; 30 37 } 31 38 … … 82 89 { 83 90 /// @todo this has to change when nchan isn't global anymore 84 uInt id= table_->frequencies().addEntry(refpix, refval, incr); 91 uInt nEntry = fEntry_.size() ; 92 Int idx = -1 ; 93 Vector<Double> entry( 3 ) ; 94 entry[0] = refpix ; 95 entry[1] = refval ; 96 entry[2] = incr ; 97 for ( uInt i = 0 ; i < nEntry ; i++ ) { 98 if ( allEQ( entry, fEntry_[i] ) ) { 99 idx = i ; 100 break ; 101 } 102 } 103 uInt id ; 104 if ( idx != -1 ) 105 id = fIdx_[idx] ; 106 else { 107 id= table_->frequencies().addEntry(refpix, refval, incr); 108 RecordFieldPtr<uInt> mfreqidCol(row_.record(), "FREQ_ID"); 109 fEntry_.push_back( entry ) ; 110 fIdx_.push_back( id ) ; 111 } 85 112 RecordFieldPtr<uInt> mfreqidCol(row_.record(), "FREQ_ID"); 86 113 *mfreqidCol = id; … … 91 118 void FillerBase::setMolecule(const Vector<Double>& restfreq) 92 119 { 93 Vector<String> tmp; 94 uInt id = table_->molecules().addEntry(restfreq, tmp, tmp); 120 uInt nEntry = mEntry_.size() ; 121 Int idx = -1 ; 122 for ( uInt i = 0 ; i < nEntry ; i++ ) { 123 if ( restfreq.conform( mEntry_[i] ) ) { 124 if ( allEQ( restfreq, mEntry_[i] ) ) { 125 idx = i ; 126 break ; 127 } 128 } 129 } 130 uInt id ; 131 if ( idx != -1 ) 132 id = mIdx_[idx] ; 133 else { 134 Vector<String> tmp ; 135 id = table_->molecules().addEntry(restfreq,tmp,tmp) ; 136 mEntry_.push_back( restfreq ) ; 137 mIdx_.push_back( id ) ; 138 } 95 139 RecordFieldPtr<uInt> molidCol(row_.record(), "MOLECULE_ID"); 96 140 *molidCol = id; … … 129 173 Float windspeed, Float windaz) 130 174 { 131 uInt id = table_->weather().addEntry(temperature, pressure, 132 humidity, windspeed, windaz); 133 RecordFieldPtr<uInt> mweatheridCol(row_.record(), "WEATHER_ID"); 134 *mweatheridCol = id; 175 uInt nEntry = wEntry_.size() ; 176 Int idx = -1 ; 177 Vector<Float> entry( 5 ) ; 178 entry[0] = temperature ; 179 entry[1] = pressure ; 180 entry[2] = humidity ; 181 entry[3] = windspeed ; 182 entry[4] = windaz ; 183 for ( uInt i = 0 ; i < nEntry ; i++ ) { 184 if ( allEQ( entry, wEntry_[i] ) ) { 185 idx = i ; 186 break ; 187 } 188 } 189 uInt id ; 190 if ( idx != -1 ) 191 id = wIdx_[idx] ; 192 else { 193 id = table_->weather().addEntry(temperature, pressure, 194 humidity, windspeed, windaz); 195 wEntry_.push_back( entry ) ; 196 wIdx_.push_back( id ) ; 197 } 198 RecordFieldPtr<uInt> mweatheridCol(row_.record(), "WEATHER_ID"); 199 *mweatheridCol = id; 135 200 } 136 201 … … 187 252 Float windaz) 188 253 { 254 uInt nEntry = wEntry_.size() ; 255 Int idx = -1 ; 256 Vector<Float> entry( 5 ) ; 257 entry[0] = temperature ; 258 entry[1] = pressure ; 259 entry[2] = humidity ; 260 entry[3] = windspeed ; 261 entry[4] = windaz ; 262 for ( uInt i = 0 ; i < nEntry ; i++ ) { 263 if ( allEQ( entry, wEntry_[i] ) ) { 264 idx = i ; 265 break ; 266 } 267 } 189 268 uInt id ; 190 Table tab = table_->weather().table() ; 191 Table subt = tab( tab.col("TEMPERATURE") == temperature \ 192 && tab.col("PRESSURE") == pressure \ 193 && tab.col("HUMIDITY") == humidity \ 194 && tab.col("WINDSPEED") == windspeed \ 195 && tab.col("WINDAZ") == windaz, 1 ) ; 196 Int nrow = tab.nrow() ; 197 Int nrowSel = subt.nrow() ; 198 if ( nrowSel == 0 ) { 199 tab.addRow( 1, True ) ; 200 TableRow row( tab ) ; 201 TableRecord &rec = row.record() ; 202 RecordFieldPtr<casa::uInt> rfpi ; 203 rfpi.attachToRecord( rec, "ID" ) ; 204 *rfpi = (uInt)nrow ; 205 RecordFieldPtr<casa::Float> rfp ; 206 rfp.attachToRecord( rec, "TEMPERATURE" ) ; 207 *rfp = temperature ; 208 rfp.attachToRecord( rec, "PRESSURE" ) ; 209 *rfp = pressure ; 210 rfp.attachToRecord( rec, "HUMIDITY" ) ; 211 *rfp = humidity ; 212 rfp.attachToRecord( rec, "WINDSPEED" ) ; 213 *rfp = windspeed ; 214 rfp.attachToRecord( rec, "WINDAZ" ) ; 215 *rfp = windaz ; 216 row.put( nrow, rec ) ; 217 id = (uInt)nrow ; 218 } 219 else { 220 ROTableColumn tc( subt, "ID" ) ; 221 id = tc.asuInt( 0 ) ; 269 if ( idx != -1 ) 270 id = wIdx_[idx] ; 271 else { 272 Table tab = table_->weather().table() ; 273 Table subt = tab( tab.col("TEMPERATURE") == temperature \ 274 && tab.col("PRESSURE") == pressure \ 275 && tab.col("HUMIDITY") == humidity \ 276 && tab.col("WINDSPEED") == windspeed \ 277 && tab.col("WINDAZ") == windaz, 1 ) ; 278 Int nrow = tab.nrow() ; 279 Int nrowSel = subt.nrow() ; 280 if ( nrowSel == 0 ) { 281 tab.addRow( 1, True ) ; 282 TableRow row( tab ) ; 283 TableRecord &rec = row.record() ; 284 RecordFieldPtr<casa::uInt> rfpi ; 285 rfpi.attachToRecord( rec, "ID" ) ; 286 *rfpi = (uInt)nrow ; 287 RecordFieldPtr<casa::Float> rfp ; 288 rfp.attachToRecord( rec, "TEMPERATURE" ) ; 289 *rfp = temperature ; 290 rfp.attachToRecord( rec, "PRESSURE" ) ; 291 *rfp = pressure ; 292 rfp.attachToRecord( rec, "HUMIDITY" ) ; 293 *rfp = humidity ; 294 rfp.attachToRecord( rec, "WINDSPEED" ) ; 295 *rfp = windspeed ; 296 rfp.attachToRecord( rec, "WINDAZ" ) ; 297 *rfp = windaz ; 298 row.put( nrow, rec ) ; 299 id = (uInt)nrow ; 300 } 301 else { 302 ROTableColumn tc( subt, "ID" ) ; 303 id = tc.asuInt( 0 ) ; 304 } 305 wEntry_.push_back( entry ) ; 306 wIdx_.push_back( id ) ; 222 307 } 223 308 RecordFieldPtr<uInt> mweatheridCol(row_.record(), "WEATHER_ID"); -
trunk/src/FillerBase.h
r2209 r2289 27 27 // STL 28 28 #include <string> 29 #include <vector> 29 30 // AIPS++ 30 31 #include <casa/aips.h> … … 103 104 casa::String referenceRx_; 104 105 casa::TableRow row_; 106 107 std::vector< casa::Vector<casa::Double> > mEntry_ ; 108 std::vector<casa::uInt> mIdx_ ; 109 std::vector< casa::Vector<casa::Double> > fEntry_ ; 110 std::vector<casa::uInt> fIdx_ ; 111 std::vector< casa::Vector<casa::Float> > wEntry_ ; 112 std::vector<casa::uInt> wIdx_ ; 105 113 }; 106 114 -
trunk/src/FillerWrapper.h
r1904 r2289 45 45 throw(AipsError("File does not exist")); 46 46 } 47 filler_ = new PKSFiller(stable_); 48 if (filler_->open(filename, rec)) { 49 // if (filler_->open(filename)) { 50 attached_ = true; 51 return; 47 int fileType = dataType( filename ) ; 48 if ( fileType == 0 ) { 49 filler_ = new PKSFiller(stable_); 50 if (filler_->open(filename, rec)) { 51 attached_ = true; 52 return; 53 } 52 54 } 53 filler_ = new NROFiller(stable_); 54 if (filler_->open(filename, rec)) { 55 // if (filler_->open(filename)) { 56 attached_ = true; 57 return; 55 else if ( fileType == 1 ) { 56 filler_ = new NROFiller(stable_); 57 if (filler_->open(filename, rec)) { 58 attached_ = true; 59 return; 60 } 58 61 } 59 62 filler_ = 0; … … 81 84 private: 82 85 86 int dataType( const std::string &filename ) { 87 int ret = -1 ; 88 int pks = 0 ; 89 int nro = 1 ; 90 casa::File file( filename ) ; 91 if ( file.isDirectory() ) 92 ret = pks ; 93 else if ( file.isReadable() ) { 94 FILE *f = fopen( filename.c_str(), "r") ; 95 char buf[8] ; 96 fread( buf, 6, 1, f ) ; 97 fclose( f ) ; 98 buf[7]='\0' ; 99 // NRO data has two types: 100 // 1) specific binary data for OTF observation 101 // 2) (pseudo-)FITS data that doesn't have primary HDU 102 // So, one can distinguish NRO and non-NRO data by examining 103 // first keyword name. 104 if ( casa::String( buf ) == "SIMPLE" ) { 105 ret = pks ; 106 } 107 else { 108 ret = nro ; 109 } 110 } 111 return ret ; 112 } 113 83 114 FillerWrapper(); 84 115 FillerWrapper(const FillerWrapper&); -
trunk/src/MSFiller.cpp
r2260 r2289 1418 1418 // assume that cols is sorted by TIME 1419 1419 Bool doInterp = False ; 1420 //uInt nrow = tcol.nrow() ;1421 1420 uInt nrow = dcol.nrow() ; 1422 1421 if ( nrow == 0 ) -
trunk/src/MSFiller.h
r2258 r2289 130 130 casa::Int &nrow, 131 131 casa::Vector<casa::Int> &corrtype ) ; 132 132 133 133 // initialize header 134 134 void initHeader( STHeader &header ) ; -
trunk/src/NROFiller.cpp
r2272 r2289 100 100 String srcname ; 101 101 String fieldname ; 102 Array<Float> spectra ;103 Array<uChar> flagtra ;104 Array<Float> tsys ;105 Array<Double> direction ;102 Vector<Float> spectra ; 103 Vector<uChar> flagtra ; 104 Vector<Float> tsys ; 105 Vector<Double> direction ; 106 106 Float azimuth ; 107 107 Float elevation ; 108 Float parangle ;108 Float parangle = 0.0 ; 109 109 Float opacity ; 110 110 uInt tcalid ; … … 117 117 Float winddir ; 118 118 Double srcvel ; 119 Array<Double> propermotion;119 Vector<Double> propermotion( 2, 0.0 ) ; 120 120 Vector<Double> srcdir ; 121 Array<Double> scanrate;121 Vector<Double> scanrate( 2, 0.0 ) ; 122 122 Int rowCount = 0 ; 123 123 … … 126 126 Vector<Float> defaultTcal( 1, 1.0 ) ; 127 127 String tcalTime = MVTime( header.utc ).string( MVTime::YMD ) ; 128 129 // TCAL subtable rows 130 setTcal( tcalTime, defaultTcal ) ; 131 132 // FOCUS subtable rows 133 setFocus( parangle ) ; 134 128 135 for ( Int irow = 0 ; irow < (Int)nRow ; irow++ ) { 129 136 // check scan intent … … 195 202 setMolecule( restfreq ) ; 196 203 197 // FOCUS subtable row198 setFocus( parangle ) ;199 200 204 // WEATHER subtable row 201 205 float p = 7.5 * temperature / ( 273.3 + temperature ) ; … … 204 208 winddir *= C::degree ; // deg->rad 205 209 humidity /= sh ; // P_H2O->relative humidity 206 setWeather( temperature, pressure, humidity, windvel, winddir ) ; 207 208 // TCAL subtable row 209 // use default since NRO input is calibrated data 210 setTcal( tcalTime, defaultTcal ) ; 211 210 setWeather2( temperature, pressure, humidity, windvel, winddir ) ; 212 211 213 212 // set row attributes 214 213 // SPECTRA, FLAGTRA, and TSYS 215 Vector<Float> spectrum( spectra ); 216 Vector<uChar> flags( flagtra ) ; 217 Vector<Float> Tsys( tsys ) ; 218 setSpectrum( spectrum, flags, Tsys ) ; 214 setSpectrum( spectra, flagtra, tsys ) ; 219 215 220 216 // SCANNO, CYCLENO, IFNO, POLNO, and BEAMNO 221 //uInt ifno = table_->frequencies().addEntry( (Double)fqs[0], (Double)fqs[1], (Double)fqs[2] ) ;222 217 setIndex( scanno, cycleno, ifno, polno, beamno ) ; 223 218 … … 226 221 227 222 // DIRECTION 228 Vector<Double> dir( direction ) ; 229 setDirection(dir, azimuth, elevation ) ; 223 setDirection( direction, azimuth, elevation ) ; 230 224 231 225 // TIME and INTERVAL … … 233 227 234 228 // SRCNAME, SRCTYPE, FIELDNAME, SRCDIRECTION, SRCPROPERMOTION, and SRCVELOCITY 235 Vector<Double> propermot( propermotion ) ; 236 setSource( srcname, srcType, fieldname, srcdir, propermot, srcvel ) ; 229 setSource( srcname, srcType, fieldname, srcdir, propermotion, srcvel ) ; 237 230 238 231 // SCANRATE 239 Vector<Double> srate( scanrate ) ; 240 setScanRate( srate ) ; 232 setScanRate( scanrate ) ; 241 233 242 234 // OPACITY -
trunk/src/SConscript
- Property svn:mergeinfo changed
/branches/parallel/src/SConscript (added) merged: 2240,2247,2262
- Property svn:mergeinfo changed
-
trunk/src/STFiller.cpp
r2201 r2289 645 645 String srcname ; 646 646 String fieldname ; 647 Array<Float> spectra ;648 Array<uChar> flagtra ;649 Array<Float> tsys ;650 Array<Double> direction ;647 Vector<Float> spectra ; 648 Vector<uChar> flagtra ; 649 Vector<Float> tsys ; 650 Vector<Double> direction ; 651 651 Float azimuth ; 652 652 Float elevation ; … … 662 662 Float winddir ; 663 663 Double srcvel ; 664 Array<Double> propermotion;664 Vector<Double> propermotion( 2, 0.0 ) ; 665 665 Vector<Double> srcdir ; 666 Array<Double> scanrate;666 Vector<Double> scanrate( 2, 0.0 ) ; 667 667 for ( i = 0 ; i < imax ; i++ ) { 668 668 string scanType = nreader_->getScanType( i ) ; -
trunk/src/STFocus.h
r1586 r2289 65 65 casa::ScalarColumn<casa::Float> rotationCol_, axisCol_, 66 66 tanCol_,handCol_, parangleCol_, 67 mountCol_,userCol_, xyphCol_,xyphoffCol_ ,;67 mountCol_,userCol_, xyphCol_,xyphoffCol_; 68 68 }; 69 69 -
trunk/src/STMath.cpp
r2278 r2289 979 979 const CountedPtr< Scantable >& caloff, Float tcal ) 980 980 { 981 if ( ! calon->conformant(*caloff) ) {981 if ( ! calon->conformant(*caloff) ) { 982 982 throw(AipsError("'CAL on' and 'CAL off' scantables are not conformant.")); 983 983 } … … 987 987 const Table& tcon = calon->table(); 988 988 Vector<Float> tcalout; 989 Vector<Float> tcalout2; //debug 989 990 std::map<uInt,uInt> tcalIdToRecNoMap; 991 const Table& calOffTcalTable = caloff->tcal().table(); 992 { 993 ROScalarColumn<uInt> calOffTcalTable_IDcol(calOffTcalTable, "ID"); 994 const Vector<uInt> tcalIds(calOffTcalTable_IDcol.getColumn()); 995 size_t tcalIdsEnd = tcalIds.nelements(); 996 for (uInt i = 0; i < tcalIdsEnd; i++) { 997 tcalIdToRecNoMap[tcalIds[i]] = i; 998 } 999 } 1000 ROArrayColumn<Float> calOffTcalTable_TCALcol(calOffTcalTable, "TCAL"); 990 1001 991 1002 if ( tout.nrow() != tcon.nrow() ) { … … 1058 1069 **/ 1059 1070 // get tcal if input tcal <= 0 1060 String tcalt;1061 1071 Float tcalUsed; 1062 1072 tcalUsed = tcal; 1063 1073 if ( tcal <= 0.0 ) { 1064 caloff->tcal().getEntry(tcalt, tcalout, tcalId); 1074 uInt tcalRecNo = tcalIdToRecNoMap[tcalId]; 1075 calOffTcalTable_TCALcol.get(tcalRecNo, tcalout); 1065 1076 // if (polno<=3) { 1066 1077 // tcalUsed = tcalout[polno]; … … 2418 2429 out->appendToHistoryTable((*it)->history()); 2419 2430 const Table& tab = (*it)->table(); 2431 2432 Block<String> cols(3); 2433 cols[0] = String("FREQ_ID"); 2434 cols[1] = String("MOLECULE_ID"); 2435 cols[2] = String("FOCUS_ID"); 2436 2420 2437 TableIterator scanit(tab, "SCANNO"); 2421 2438 while (!scanit.pastEnd()) { 2422 TableIterator freqit(scanit.table(), "FREQ_ID"); 2423 while ( !freqit.pastEnd() ) { 2424 Table thetab = freqit.table(); 2439 ScalarColumn<uInt> thescannocol(scanit.table(),"SCANNO"); 2440 Vector<uInt> thescannos(thescannocol.nrow(),newscanno); 2441 thescannocol.putColumn(thescannos); 2442 TableIterator subit(scanit.table(), cols); 2443 while ( !subit.pastEnd() ) { 2425 2444 uInt nrow = tout.nrow(); 2445 Table thetab = subit.table(); 2446 ROTableRow row(thetab); 2447 Vector<uInt> thecolvals(thetab.nrow()); 2448 ScalarColumn<uInt> thefreqidcol(thetab,"FREQ_ID"); 2449 ScalarColumn<uInt> themolidcol(thetab, "MOLECULE_ID"); 2450 ScalarColumn<uInt> thefocusidcol(thetab,"FOCUS_ID"); 2451 // The selected subset of table should have 2452 // the equal FREQ_ID, MOLECULE_ID, and FOCUS_ID values. 2453 const TableRecord& rec = row.get(0); 2454 // Set the proper FREQ_ID 2455 Double rv,rp,inc; 2456 (*it)->frequencies().getEntry(rp, rv, inc, rec.asuInt("FREQ_ID")); 2457 uInt id; 2458 id = out->frequencies().addEntry(rp, rv, inc); 2459 thecolvals = id; 2460 thefreqidcol.putColumn(thecolvals); 2461 // Set the proper MOLECULE_ID 2462 Vector<String> name,fname;Vector<Double> rf; 2463 (*it)->molecules().getEntry(rf, name, fname, rec.asuInt("MOLECULE_ID")); 2464 id = out->molecules().addEntry(rf, name, fname); 2465 thecolvals = id; 2466 themolidcol.putColumn(thecolvals); 2467 // Set the proper FOCUS_ID 2468 Float fpa,frot,fax,ftan,fhand,fmount,fuser, fxy, fxyp; 2469 (*it)->focus().getEntry(fpa, fax, ftan, frot, fhand, fmount,fuser, 2470 fxy, fxyp, rec.asuInt("FOCUS_ID")); 2471 id = out->focus().addEntry(fpa, fax, ftan, frot, fhand, fmount,fuser, 2472 fxy, fxyp); 2473 thecolvals = id; 2474 thefocusidcol.putColumn(thecolvals); 2475 2426 2476 tout.addRow(thetab.nrow()); 2427 2477 TableCopy::copyRows(tout, thetab, nrow, 0, thetab.nrow()); 2428 ROTableRow row(thetab); 2429 for ( uInt i=0; i<thetab.nrow(); ++i) { 2430 uInt k = nrow+i; 2431 scannocol.put(k, newscanno); 2432 const TableRecord& rec = row.get(i); 2433 Double rv,rp,inc; 2434 (*it)->frequencies().getEntry(rp, rv, inc, rec.asuInt("FREQ_ID")); 2435 uInt id; 2436 id = out->frequencies().addEntry(rp, rv, inc); 2437 freqidcol.put(k,id); 2438 //String name,fname;Double rf; 2439 Vector<String> name,fname;Vector<Double> rf; 2440 (*it)->molecules().getEntry(rf, name, fname, rec.asuInt("MOLECULE_ID")); 2441 id = out->molecules().addEntry(rf, name, fname); 2442 molidcol.put(k, id); 2443 Float fpa,frot,fax,ftan,fhand,fmount,fuser, fxy, fxyp; 2444 (*it)->focus().getEntry(fpa, fax, ftan, frot, fhand, 2445 fmount,fuser, fxy, fxyp, 2446 rec.asuInt("FOCUS_ID")); 2447 id = out->focus().addEntry(fpa, fax, ftan, frot, fhand, 2448 fmount,fuser, fxy, fxyp); 2449 focusidcol.put(k, id); 2450 } 2451 ++freqit; 2478 2479 ++subit; 2452 2480 } 2453 2481 ++newscanno; -
trunk/src/STTcal.cpp
r1391 r2289 120 120 void STTcal::getEntry( String& time, Vector<Float>& tcal, uInt id ) 121 121 { 122 Table t = table_(table_.col("ID") == Int(id) 122 Table t = table_(table_.col("ID") == Int(id),1); 123 123 if (t.nrow() == 0 ) { 124 124 throw(AipsError("STTcal::getEntry - id out of range")); -
trunk/src/Templates.cpp
r1819 r2289 81 81 82 82 //template void convertArray<Bool, uChar>(Array<Bool> &, Array<uChar> const &); 83 template void c onvertArray<uChar, Bool>(Array<uChar> &, Array<Bool> const &);83 template void casa::convertArray<uChar, Bool>(Array<uChar> &, Array<Bool> const &); 84 84 85 template Array<Float>& operator/=<Float>(Array<Float>&, MaskedArray<Float> const&);86 template MaskedArray<Float> const& operator*=<Float>(MaskedArray<Float> const&, Float const&);87 template MaskedArray<Float> const& operator*=<Float>(MaskedArray<Float> const&, Array<Float> const&);88 template MaskedArray<Float> const& operator/=<Float>(MaskedArray<Float> const&, Float const&);89 template MaskedArray<Float> operator+<Float>(MaskedArray<Float> const&, MaskedArray<Float> const&);90 template MaskedArray<Float> operator-<Float>(MaskedArray<Float> const&, MaskedArray<Float> const&);91 template MaskedArray<Float> operator-<Float>(MaskedArray<Float> const&, Array<Float> const&);85 template Array<Float>& casa::operator/=<Float>(Array<Float>&, MaskedArray<Float> const&); 86 template MaskedArray<Float> const& casa::operator*=<Float>(MaskedArray<Float> const&, Float const&); 87 template MaskedArray<Float> const& casa::operator*=<Float>(MaskedArray<Float> const&, Array<Float> const&); 88 template MaskedArray<Float> const& casa::operator/=<Float>(MaskedArray<Float> const&, Float const&); 89 template MaskedArray<Float> casa::operator+<Float>(MaskedArray<Float> const&, MaskedArray<Float> const&); 90 template MaskedArray<Float> casa::operator-<Float>(MaskedArray<Float> const&, MaskedArray<Float> const&); 91 template MaskedArray<Float> casa::operator-<Float>(MaskedArray<Float> const&, Array<Float> const&); 92 92 93 template MaskedArray<Float> operator/<Float>(MaskedArray<Float> const&, MaskedArray<Float> const&);93 template MaskedArray<Float> casa::operator/<Float>(MaskedArray<Float> const&, MaskedArray<Float> const&); 94 94 95 template MaskedArray<Float> operator*<Float>(MaskedArray<Float> const&, MaskedArray<Float> const&);96 template MaskedArray<Float> operator*<Float>(MaskedArray<Float> const&, Array<Float> const&);97 template MaskedArray<Float> operator*<Float>(Array<Float> const&, MaskedArray<Float> const&);98 template MaskedArray<Float> operator*<Float>(Float const&, MaskedArray<Float> const&);99 template Float stddev<Float>(MaskedArray<Float> const&);100 template Float median<Float>(MaskedArray<Float> const&, Bool, Bool);101 template Float sumsquares<Float>(MaskedArray<Float> const&);102 template Float avdev<Float>(MaskedArray<Float> const&);95 template MaskedArray<Float> casa::operator*<Float>(MaskedArray<Float> const&, MaskedArray<Float> const&); 96 template MaskedArray<Float> casa::operator*<Float>(MaskedArray<Float> const&, Array<Float> const&); 97 template MaskedArray<Float> casa::operator*<Float>(Array<Float> const&, MaskedArray<Float> const&); 98 template MaskedArray<Float> casa::operator*<Float>(Float const&, MaskedArray<Float> const&); 99 template Float casa::stddev<Float>(MaskedArray<Float> const&); 100 template Float casa::median<Float>(MaskedArray<Float> const&, Bool, Bool); 101 template Float casa::sumsquares<Float>(MaskedArray<Float> const&); 102 template Float casa::avdev<Float>(MaskedArray<Float> const&); 103 103 104 104 template void LatticeUtilities::bin(MaskedArray<float>&, MaskedArray<float> const&, uInt, uInt);
Note:
See TracChangeset
for help on using the changeset viewer.