Changeset 1427 for trunk/external
- Timestamp:
- 07/04/08 13:23:49 (16 years ago)
- Location:
- trunk/external/atnf
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/external/atnf/PKSIO/MBFITSreader.cc
r1399 r1427 2 2 //# MBFITSreader.cc: ATNF single-dish RPFITS reader. 3 3 //#--------------------------------------------------------------------------- 4 //# Copyright (C) 2000-200 74 //# Copyright (C) 2000-2008 5 5 //# Mark Calabretta, ATNF 6 6 //# … … 27 27 //# AUSTRALIA 28 28 //# 29 //# $Id: MBFITSreader.cc,v 19.3 6 2007/11/12 03:37:56cal103 Exp $29 //# $Id: MBFITSreader.cc,v 19.38 2008-06-26 02:24:22 cal103 Exp $ 30 30 //#--------------------------------------------------------------------------- 31 31 //# The MBFITSreader class reads single dish RPFITS files (such as Parkes … … 52 52 const double PI = 3.141592653589793238462643; 53 53 const double TWOPI = 2.0 * PI; 54 const double R2D = 180.0 / PI; 54 55 55 56 //------------------------------------------------- MBFITSreader::MBFITSreader … … 501 502 502 503 #ifdef PKSIO_DEBUG 503 printf(" End-of-file detected, flushing last scan.\n");504 printf("\nEnd-of-file detected, flushing last scan.\n"); 504 505 #endif 505 506 … … 609 610 cCycleNo = 0; 610 611 cPrevUTC = 0.0; 611 cStaleness = new int[cNBeamSel];612 for (int iBeamSel = 0; iBeamSel < cNBeamSel; iBeamSel++) {613 cStaleness[iBeamSel] = 0;614 }615 612 } 616 613 … … 670 667 671 668 #ifdef PKSIO_DEBUG 672 printf(" In:%4d%4d%3d%3d\n", cScanNo, cCycleNo, beamNo, cIFno);669 printf("\n In:%4d%4d%3d%3d\n", cScanNo, cCycleNo, beamNo, cIFno); 673 670 if (cEOS) printf("Start of new scan, flushing previous scan.\n"); 674 671 #endif … … 730 727 731 728 if (cFlushing && cFlushBin == 0 && cFlushIF == 0 && cInterp) { 732 // Interpolate the beam position at the start of the flush cycle. 733 #ifdef PKSIO_DEBUG 734 printf("Doing position interpolation for beam %d.\n", iMBuff->beamNo); 735 #endif 736 737 double prevRA = iMBuff->ra; 738 double prevDec = iMBuff->dec; 739 double prevUTC = cPosUTC[iBeamSel]; 740 741 if (!cEOF && !cEOS) { 742 // The position is measured by the control system at a time returned 743 // by RPFITSIN as the 'w' visibility coordinate. The ra and dec, 744 // returned as the 'u' and 'v' visibility coordinates, must be 745 // interpolated to the integration time which RPFITSIN returns as 746 // 'cUTC', this usually being a second or two later. 747 // 729 // Start of flush cycle, interpolate the beam position. 730 // 731 // The position is measured by the control system at a time returned by 732 // RPFITSIN as the 'w' visibility coordinate. The ra and dec, returned 733 // as the 'u' and 'v' visibility coordinates, must be interpolated to 734 // the integration time which RPFITSIN returns as 'cUTC', this usually 735 // being a second or two later. 736 // 737 // "This" RA, Dec, and UTC refers to the position currently stored in 738 // the buffer marked for output (iMBuff). This position will be 739 // interpolated to the midpoint of that integration using the position 740 // recorded in the "next" integration which is currently sitting in the 741 // RPFITS commons. The interpolation method used here is based on the 742 // scan rate. At the end of a scan, or if the next position has not 743 // been updated, the most recent determination of the scan rate will be 744 // used for extrapolation. 745 // 746 // The rate "age" is the offset from "this" integration (in iMBuff) of 747 // the earliest integration in the pair used to compute the rate. A 748 // rate "age" of 0 thus refers to the normal situation where the rate 749 // is determined from "this" integration and the "next" one. An age 750 // of 1 cycle means that it is determined from "this" integration and 751 // the one preceding it, which should be equally reliable. An age 752 // of 2 cycles means that the rate is determined from the previous 753 // integration and the one before that, so the extrapolation spans one 754 // integration cycle. Thus it has a "staleness" of 1. 755 756 double thisRA = iMBuff->ra; 757 double thisDec = iMBuff->dec; 758 double thisUTC = cPosUTC[iBeamSel]; 759 760 if (cEOF || cEOS) { 761 iMBuff->rateAge++; 762 iMBuff->rateson = 0; 763 764 } else { 748 765 // Note that the time recorded as the 'w' visibility coordinate 749 766 // cycles through 86400 back to 0 at midnight, whereas that in 'cUTC' 750 767 // continues to increase past 86400. 751 768 752 double thisRA = cU;753 double thisDec = cV;754 double thisUTC = cW;755 756 if ( thisUTC < prevUTC) {769 double nextRA = cU; 770 double nextDec = cV; 771 double nextUTC = cW; 772 773 if (nextUTC < thisUTC) { 757 774 // Must have cycled through midnight. 758 thisUTC += 86400.0;775 nextUTC += 86400.0; 759 776 } 760 777 761 778 // Guard against RA cycling through 24h in either direction. 762 if (fabs( thisRA - prevRA) > PI) {763 if ( thisRA < prevRA) {764 thisRA += TWOPI;779 if (fabs(nextRA - thisRA) > PI) { 780 if (nextRA < thisRA) { 781 nextRA += TWOPI; 765 782 } else { 766 thisRA -= TWOPI;783 nextRA -= TWOPI; 767 784 } 768 785 } 786 787 #ifdef PKSIO_DEBUG 788 printf("Previous ra, dec, UTC: %8.4f %8.4f %7.1f\n", thisRA*R2D, 789 thisDec*R2D, thisUTC); 790 printf("Current ra, dec, UTC: %8.4f %8.4f %7.1f\n", nextRA*R2D, 791 nextDec*R2D, nextUTC); 792 #endif 769 793 770 794 // The control system at Mopra typically does not update the … … 774 798 // likely to be a better guess than anything else. 775 799 776 double dUTC = thisUTC - prevUTC;800 double dUTC = nextUTC - thisUTC; 777 801 778 802 // Scan rate for this beam. 779 803 if (dUTC > 0.0) { 780 iMBuff->raRate = (thisRA - prevRA) / dUTC; 781 iMBuff->decRate = (thisDec - prevDec) / dUTC; 804 iMBuff->raRate = (nextRA - thisRA) / dUTC; 805 iMBuff->decRate = (nextDec - thisDec) / dUTC; 806 iMBuff->rateAge = 0; 807 iMBuff->rateson = 0; 782 808 783 809 if (cInterp == 2) { 784 810 // Use the same interpolation scheme as the original pksmbfits 785 // client. This incorrectly assumed that ( thisUTC - prevUTC) is811 // client. This incorrectly assumed that (nextUTC - thisUTC) is 786 812 // equal to the integration time and interpolated by computing a 787 813 // weighted sum of the positions before and after the required … … 789 815 790 816 double utc = iMBuff->utc; 791 if (utc - prevUTC > 100.0) {817 if (utc - thisUTC > 100.0) { 792 818 // Must have cycled through midnight. 793 819 utc -= 86400.0; 794 820 } 795 821 796 double tw1 = 1.0 - (utc - prevUTC) / iMBuff->exposure;797 double tw2 = 1.0 - ( thisUTC - utc) / iMBuff->exposure;798 double gamma = (tw2 / (tw1 + tw2)) * dUTC / (utc - prevUTC);822 double tw1 = 1.0 - (utc - thisUTC) / iMBuff->exposure; 823 double tw2 = 1.0 - (nextUTC - utc) / iMBuff->exposure; 824 double gamma = (tw2 / (tw1 + tw2)) * dUTC / (utc - thisUTC); 799 825 800 826 iMBuff->raRate *= gamma; … … 802 828 } 803 829 804 cStaleness[iBeamSel] = 0;805 806 830 } else { 807 // Issue warnings. 808 int nch = 0; 809 fprintf(stderr, "WARNING, scan %d,%n cycle %d: Position ", 810 iMBuff->scanNo, &nch, iMBuff->cycleNo); 811 831 iMBuff->rateAge++; 832 833 // Staleness codes. 812 834 if (dUTC < 0.0) { 813 fprintf(stderr, "timestamp went backwards!\n");835 iMBuff->rateson = 3; 814 836 } else { 815 if ( thisRA != prevRA || thisDec != prevDec) {816 fprintf(stderr, "changed but timestamp unchanged!\n");837 if (nextRA != thisRA || nextDec != thisDec) { 838 iMBuff->rateson = 2; 817 839 } else { 818 fprintf(stderr, "and timestamp unchanged!\n");840 iMBuff->rateson = 1; 819 841 } 820 842 } 821 822 cStaleness[iBeamSel]++; 823 fprintf(stderr, "%-*s Using stale scan rate, staleness = %d " 824 "cycle%s.\n", nch, "WARNING,", cStaleness[iBeamSel], 825 (cStaleness[iBeamSel] == 1) ? "" : "s"); 826 827 if (thisRA != prevRA || thisDec != prevDec) { 828 if (iMBuff->raRate == 0.0 && iMBuff->decRate == 0.0) { 829 fprintf(stderr, "%-*s But the previous rate was zero! " 830 "Position will be inaccurate.\n", nch, "WARNING,"); 831 } 832 } 833 } 834 } 843 } 844 } 845 846 #ifdef PKSIO_DEBUG 847 printf("Doing position interpolation for beam %d.\n", iMBuff->beamNo); 848 printf("RA and Dec rates and age: %7.4f %7.4f %d\n", 849 iMBuff->raRate*R2D, iMBuff->decRate*R2D, iMBuff->rateAge); 850 #endif 835 851 836 852 // Compute the position of this beam for all bins. … … 841 857 cBuffer[jbuff].decRate = iMBuff->decRate; 842 858 843 double dutc = cBuffer[jbuff].utc - prevUTC;859 double dutc = cBuffer[jbuff].utc - thisUTC; 844 860 if (dutc > 100.0) { 845 861 // Must have cycled through midnight. … … 847 863 } 848 864 849 cBuffer[jbuff].ra = prevRA + cBuffer[jbuff].raRate * dutc;850 cBuffer[jbuff].dec = prevDec + cBuffer[jbuff].decRate * dutc;865 cBuffer[jbuff].ra = thisRA + cBuffer[jbuff].raRate * dutc; 866 cBuffer[jbuff].dec = thisDec + cBuffer[jbuff].decRate * dutc; 851 867 if (cBuffer[jbuff].ra < 0.0) { 852 868 cBuffer[jbuff].ra += TWOPI; -
trunk/external/atnf/PKSIO/MBFITSreader.h
r1399 r1427 27 27 //# AUSTRALIA 28 28 //# 29 //# $Id: MBFITSreader.h,v 19.1 4 2007/11/12 03:37:56 cal103 Exp $29 //# $Id: MBFITSreader.h,v 19.15 2008-06-26 02:14:36 cal103 Exp $ 30 30 //#--------------------------------------------------------------------------- 31 31 //# The MBFITSreader class reads single dish RPFITS files (such as Parkes … … 114 114 char cDateObs[10]; 115 115 int *cBeamSel, *cChanOff, cFirst, *cIFSel, cInterp, cIntTime, cMBopen, 116 cMopra, cNBeamSel, cNBin, cRetry, *cStaleness,cSUpos, *cXpolOff;116 cMopra, cNBeamSel, cNBin, cRetry, cSUpos, *cXpolOff; 117 117 118 118 // The data has to be bufferred to allow positions to be interpolated. -
trunk/external/atnf/PKSIO/PKSFITSreader.cc
r1399 r1427 1 1 //# PKSFITSreader.cc: Class to read Parkes multibeam data from a FITS file. 2 2 //#--------------------------------------------------------------------------- 3 //# Copyright (C) 2000-200 73 //# Copyright (C) 2000-2008 4 4 //# Associated Universities, Inc. Washington DC, USA. 5 5 //# … … 25 25 //# Charlottesville, VA 22903-2475 USA 26 26 //# 27 //# $Id: PKSFITSreader.cc,v 19.1 3 2007/11/12 03:37:56cal103 Exp $27 //# $Id: PKSFITSreader.cc,v 19.14 2008-06-26 02:07:21 cal103 Exp $ 28 28 //#--------------------------------------------------------------------------- 29 29 //# Original: 2000/08/02, Mark Calabretta, ATNF … … 50 50 const Bool interpolate) 51 51 { 52 c MBrec.setNIFs(1);52 cFITSMBrec.setNIFs(1); 53 53 54 54 if (fitsType == "SDFITS") { … … 321 321 // Read the next data record. 322 322 323 Int PKSFITSreader::read( 324 Int &scanNo, 325 Int &cycleNo, 326 Double &mjd, 327 Double &interval, 328 String &fieldName, 329 String &srcName, 330 Vector<Double> &srcDir, 331 Vector<Double> &srcPM, 332 Double &srcVel, 333 String &obsType, 334 Int &IFno, 335 Double &refFreq, 336 Double &bandwidth, 337 Double &freqInc, 338 Double &restFreq, 339 Vector<Float> &tcal, 340 String &tcalTime, 341 Float &azimuth, 342 Float &elevation, 343 Float &parAngle, 344 Float &focusAxi, 345 Float &focusTan, 346 Float &focusRot, 347 Float &temperature, 348 Float &pressure, 349 Float &humidity, 350 Float &windSpeed, 351 Float &windAz, 352 Int &refBeam, 353 Int &beamNo, 354 Vector<Double> &direction, 355 Vector<Double> &scanRate, 356 Vector<Float> &tsys, 357 Vector<Float> &sigma, 358 Vector<Float> &calFctr, 359 Matrix<Float> &baseLin, 360 Matrix<Float> &baseSub, 361 Matrix<Float> &spectra, 362 Matrix<uChar> &flagged, 363 Complex &xCalFctr, 364 Vector<Complex> &xPol) 323 Int PKSFITSreader::read(MBrecord &MBrec) 365 324 { 366 325 Int status; 367 326 368 if ((status = cReader->read(c MBrec))) {327 if ((status = cReader->read(cFITSMBrec))) { 369 328 if (status != -1) { 370 329 status = 1; … … 375 334 376 335 377 uInt nChan = c MBrec.nChan[0];378 uInt nPol = c MBrec.nPol[0];379 380 scanNo = cMBrec.scanNo;381 cycleNo = cMBrec.cycleNo;336 uInt nChan = cFITSMBrec.nChan[0]; 337 uInt nPol = cFITSMBrec.nPol[0]; 338 339 MBrec.scanNo = cFITSMBrec.scanNo; 340 MBrec.cycleNo = cFITSMBrec.cycleNo; 382 341 383 342 // Extract MJD. 384 343 Int day, month, year; 385 sscanf(cMBrec.datobs, "%4d-%2d-%2d", &year, &month, &day); 386 mjd = MVTime(year, month, Double(day)).day() + cMBrec.utc/86400.0; 387 388 interval = cMBrec.exposure; 389 390 fieldName = trim(cMBrec.srcName); 391 srcName = fieldName; 392 srcDir(0) = cMBrec.srcRA; 393 srcDir(1) = cMBrec.srcDec; 394 srcPM(0) = 0.0; 395 srcPM(1) = 0.0; 396 srcVel = 0.0; 397 obsType = trim(cMBrec.obsType); 398 399 IFno = cMBrec.IFno[0]; 400 Double chanWidth = fabs(cMBrec.fqDelt[0]); 401 refFreq = cMBrec.fqRefVal[0]; 402 bandwidth = chanWidth * nChan; 403 freqInc = cMBrec.fqDelt[0]; 404 restFreq = cMBrec.restFreq; 405 406 tcal.resize(nPol); 344 sscanf(cFITSMBrec.datobs, "%4d-%2d-%2d", &year, &month, &day); 345 MBrec.mjd = MVTime(year, month, Double(day)).day() + cFITSMBrec.utc/86400.0; 346 347 MBrec.interval = cFITSMBrec.exposure; 348 349 MBrec.fieldName = trim(cFITSMBrec.srcName); 350 MBrec.srcName = MBrec.fieldName; 351 352 MBrec.srcDir.resize(2); 353 MBrec.srcDir(0) = cFITSMBrec.srcRA; 354 MBrec.srcDir(1) = cFITSMBrec.srcDec; 355 356 MBrec.srcPM.resize(2); 357 MBrec.srcPM(0) = 0.0; 358 MBrec.srcPM(1) = 0.0; 359 MBrec.srcVel = 0.0; 360 MBrec.obsType = trim(cFITSMBrec.obsType); 361 362 MBrec.IFno = cFITSMBrec.IFno[0]; 363 Double chanWidth = fabs(cFITSMBrec.fqDelt[0]); 364 MBrec.refFreq = cFITSMBrec.fqRefVal[0]; 365 MBrec.bandwidth = chanWidth * nChan; 366 MBrec.freqInc = cFITSMBrec.fqDelt[0]; 367 MBrec.restFreq = cFITSMBrec.restFreq; 368 369 MBrec.tcal.resize(nPol); 407 370 for (uInt ipol = 0; ipol < nPol; ipol++) { 408 tcal(ipol) = cMBrec.tcal[0][ipol]; 409 } 410 tcalTime = trim(cMBrec.tcalTime); 411 azimuth = cMBrec.azimuth; 412 elevation = cMBrec.elevation; 413 parAngle = cMBrec.parAngle; 414 focusAxi = cMBrec.focusAxi; 415 focusTan = cMBrec.focusTan; 416 focusRot = cMBrec.focusRot; 417 418 temperature = cMBrec.temp; 419 pressure = cMBrec.pressure; 420 humidity = cMBrec.humidity; 421 windSpeed = cMBrec.windSpeed; 422 windAz = cMBrec.windAz; 423 424 refBeam = cMBrec.refBeam; 425 beamNo = cMBrec.beamNo; 426 427 direction(0) = cMBrec.ra; 428 direction(1) = cMBrec.dec; 429 scanRate(0) = cMBrec.raRate; 430 scanRate(1) = cMBrec.decRate; 431 432 tsys.resize(nPol); 433 sigma.resize(nPol); 434 calFctr.resize(nPol); 371 MBrec.tcal(ipol) = cFITSMBrec.tcal[0][ipol]; 372 } 373 MBrec.tcalTime = trim(cFITSMBrec.tcalTime); 374 MBrec.azimuth = cFITSMBrec.azimuth; 375 MBrec.elevation = cFITSMBrec.elevation; 376 MBrec.parAngle = cFITSMBrec.parAngle; 377 MBrec.focusAxi = cFITSMBrec.focusAxi; 378 MBrec.focusTan = cFITSMBrec.focusTan; 379 MBrec.focusRot = cFITSMBrec.focusRot; 380 381 MBrec.temperature = cFITSMBrec.temp; 382 MBrec.pressure = cFITSMBrec.pressure; 383 MBrec.humidity = cFITSMBrec.humidity; 384 MBrec.windSpeed = cFITSMBrec.windSpeed; 385 MBrec.windAz = cFITSMBrec.windAz; 386 387 MBrec.refBeam = cFITSMBrec.refBeam; 388 MBrec.beamNo = cFITSMBrec.beamNo; 389 390 MBrec.direction.resize(2); 391 MBrec.direction(0) = cFITSMBrec.ra; 392 MBrec.direction(1) = cFITSMBrec.dec; 393 394 MBrec.scanRate.resize(2); 395 MBrec.scanRate(0) = cFITSMBrec.raRate; 396 MBrec.scanRate(1) = cFITSMBrec.decRate; 397 MBrec.rateAge = cFITSMBrec.rateAge; 398 MBrec.rateson = cFITSMBrec.rateson; 399 400 MBrec.tsys.resize(nPol); 401 MBrec.sigma.resize(nPol); 402 MBrec.calFctr.resize(nPol); 435 403 for (uInt ipol = 0; ipol < nPol; ipol++) { 436 tsys(ipol) = cMBrec.tsys[0][ipol]; 437 sigma(ipol) = tsys(ipol) / 0.81 / sqrt(interval * chanWidth); 438 calFctr(ipol) = cMBrec.calfctr[0][ipol]; 439 } 440 441 if (cMBrec.haveBase) { 442 baseLin.resize(2,nPol); 443 baseSub.resize(9,nPol); 404 MBrec.tsys(ipol) = cFITSMBrec.tsys[0][ipol]; 405 MBrec.sigma(ipol) = (MBrec.tsys(ipol) / 0.81) / 406 sqrt(MBrec.interval * chanWidth); 407 MBrec.calFctr(ipol) = cFITSMBrec.calfctr[0][ipol]; 408 } 409 410 if (cFITSMBrec.haveBase) { 411 MBrec.baseLin.resize(2,nPol); 412 MBrec.baseSub.resize(9,nPol); 444 413 445 414 for (uInt ipol = 0; ipol < nPol; ipol++) { 446 baseLin(0,ipol) = cMBrec.baseLin[0][ipol][0];447 baseLin(1,ipol) = cMBrec.baseLin[0][ipol][1];415 MBrec.baseLin(0,ipol) = cFITSMBrec.baseLin[0][ipol][0]; 416 MBrec.baseLin(1,ipol) = cFITSMBrec.baseLin[0][ipol][1]; 448 417 449 418 for (uInt j = 0; j < 9; j++) { 450 baseSub(j,ipol) = cMBrec.baseSub[0][ipol][j];419 MBrec.baseSub(j,ipol) = cFITSMBrec.baseSub[0][ipol][j]; 451 420 } 452 421 } 453 422 454 423 } else { 455 baseLin.resize(0,0); 456 baseSub.resize(0,0); 457 } 458 459 if (cGetSpectra && cMBrec.haveSpectra) { 460 spectra.resize(nChan,nPol); 461 spectra.takeStorage(IPosition(2,nChan,nPol), cMBrec.spectra[0], SHARE); 462 463 flagged.resize(nChan,nPol); 464 flagged.takeStorage(IPosition(2,nChan,nPol), cMBrec.flagged[0], SHARE); 424 MBrec.baseLin.resize(0,0); 425 MBrec.baseSub.resize(0,0); 426 } 427 428 if (cGetSpectra && cFITSMBrec.haveSpectra) { 429 MBrec.spectra.resize(nChan,nPol); 430 MBrec.spectra.takeStorage(IPosition(2,nChan,nPol), cFITSMBrec.spectra[0], 431 SHARE); 432 433 MBrec.flagged.resize(nChan,nPol); 434 MBrec.flagged.takeStorage(IPosition(2,nChan,nPol), cFITSMBrec.flagged[0], 435 SHARE); 465 436 466 437 } else { 467 spectra.resize(0,0);468 flagged.resize(0,0);438 MBrec.spectra.resize(0,0); 439 MBrec.flagged.resize(0,0); 469 440 } 470 441 471 442 if (cGetXPol) { 472 xCalFctr = Complex(cMBrec.xcalfctr[0][0], cMBrec.xcalfctr[0][1]); 473 xPol.resize(nChan); 474 xPol.takeStorage(IPosition(1,nChan), (Complex *)cMBrec.xpol[0], SHARE); 443 MBrec.xCalFctr = Complex(cFITSMBrec.xcalfctr[0][0], 444 cFITSMBrec.xcalfctr[0][1]); 445 MBrec.xPol.resize(nChan); 446 MBrec.xPol.takeStorage(IPosition(1,nChan), (Complex *)cFITSMBrec.xpol[0], 447 SHARE); 475 448 } 476 449 … … 493 466 Int status; 494 467 495 if ((status = cReader->read(c MBrec))) {468 if ((status = cReader->read(cFITSMBrec))) { 496 469 if (status != -1) { 497 470 status = 1; … … 501 474 } 502 475 503 IFno = c MBrec.IFno[0];504 505 uInt nChan = c MBrec.nChan[0];506 uInt nPol = c MBrec.nPol[0];476 IFno = cFITSMBrec.IFno[0]; 477 478 uInt nChan = cFITSMBrec.nChan[0]; 479 uInt nPol = cFITSMBrec.nPol[0]; 507 480 508 481 tsys.resize(nPol); 509 482 calFctr.resize(nPol); 510 483 for (uInt ipol = 0; ipol < nPol; ipol++) { 511 tsys(ipol) = c MBrec.tsys[0][ipol];512 calFctr(ipol) = c MBrec.calfctr[0][ipol];513 } 514 515 if (c MBrec.haveBase) {484 tsys(ipol) = cFITSMBrec.tsys[0][ipol]; 485 calFctr(ipol) = cFITSMBrec.calfctr[0][ipol]; 486 } 487 488 if (cFITSMBrec.haveBase) { 516 489 baseLin.resize(2,nPol); 517 490 baseSub.resize(9,nPol); 518 491 519 492 for (uInt ipol = 0; ipol < nPol; ipol++) { 520 baseLin(0,ipol) = c MBrec.baseLin[0][ipol][0];521 baseLin(1,ipol) = c MBrec.baseLin[0][ipol][1];493 baseLin(0,ipol) = cFITSMBrec.baseLin[0][ipol][0]; 494 baseLin(1,ipol) = cFITSMBrec.baseLin[0][ipol][1]; 522 495 523 496 for (uInt j = 0; j < 9; j++) { 524 baseSub(j,ipol) = c MBrec.baseSub[0][ipol][j];497 baseSub(j,ipol) = cFITSMBrec.baseSub[0][ipol][j]; 525 498 } 526 499 } … … 531 504 } 532 505 533 if (cGetSpectra && c MBrec.haveSpectra) {506 if (cGetSpectra && cFITSMBrec.haveSpectra) { 534 507 spectra.resize(nChan,nPol); 535 spectra.takeStorage(IPosition(2,nChan,nPol), cMBrec.spectra[0], SHARE); 508 spectra.takeStorage(IPosition(2,nChan,nPol), cFITSMBrec.spectra[0], 509 SHARE); 536 510 537 511 flagged.resize(nChan,nPol); 538 flagged.takeStorage(IPosition(2,nChan,nPol), cMBrec.flagged[0], SHARE); 512 flagged.takeStorage(IPosition(2,nChan,nPol), cFITSMBrec.flagged[0], 513 SHARE); 539 514 540 515 } else { -
trunk/external/atnf/PKSIO/PKSFITSreader.h
r1399 r1427 2 2 //# PKSFITSreader.h: Class to read Parkes Multibeam data from a FITS file. 3 3 //#--------------------------------------------------------------------------- 4 //# Copyright (C) 2000-200 74 //# Copyright (C) 2000-2008 5 5 //# Associated Universities, Inc. Washington DC, USA. 6 6 //# … … 26 26 //# Charlottesville, VA 22903-2475 USA 27 27 //# 28 //# $Id: PKSFITSreader.h,v 19.1 2 2007/11/12 03:37:56cal103 Exp $28 //# $Id: PKSFITSreader.h,v 19.13 2008-06-26 02:02:43 cal103 Exp $ 29 29 //#--------------------------------------------------------------------------- 30 30 //# This class is basically a wrapper class for reading data from either an … … 114 114 115 115 // Read the next data record. 116 virtual Int read( 117 Int &scanNo, 118 Int &cycleNo, 119 Double &mjd, 120 Double &interval, 121 String &fieldName, 122 String &srcName, 123 Vector<Double> &srcDir, 124 Vector<Double> &srcPM, 125 Double &srcVel, 126 String &obsType, 127 Int &IFno, 128 Double &refFreq, 129 Double &bandwidth, 130 Double &freqInc, 131 Double &restFreq, 132 Vector<Float> &tcal, 133 String &tcalTime, 134 Float &azimuth, 135 Float &elevation, 136 Float &parAngle, 137 Float &focusAxi, 138 Float &focusTan, 139 Float &focusRot, 140 Float &temperature, 141 Float &pressure, 142 Float &humidity, 143 Float &windSpeed, 144 Float &windAz, 145 Int &refBeam, 146 Int &beamNo, 147 Vector<Double> &direction, 148 Vector<Double> &scanRate, 149 Vector<Float> &tsys, 150 Vector<Float> &sigma, 151 Vector<Float> &calFctr, 152 Matrix<Float> &baseLin, 153 Matrix<Float> &baseSub, 154 Matrix<Float> &spectra, 155 Matrix<uChar> &flagged, 156 Complex &xCalFctr, 157 Vector<Complex> &xPol); 116 virtual Int read(MBrecord &mbrec); 158 117 159 118 // Read the next data record, just the basics. … … 173 132 Int *cBeams, *cIFs; 174 133 uInt cNBeam, cNIF; 175 PKSMBrecord c MBrec;134 PKSMBrecord cFITSMBrec; 176 135 FITSreader *cReader; 177 136 -
trunk/external/atnf/PKSIO/PKSMBrecord.cc
r1325 r1427 2 2 //# PKSMBrecord.cc: Class to store an MBFITS single-dish data record. 3 3 //#--------------------------------------------------------------------------- 4 //# Copyright (C) 2000-200 64 //# Copyright (C) 2000-2008 5 5 //# Mark Calabretta, ATNF 6 6 //# … … 27 27 //# AUSTRALIA 28 28 //# 29 //# $Id: PKSMBrecord.cc,v 19. 6 2006/07/05 04:52:07 mcalabreExp $29 //# $Id: PKSMBrecord.cc,v 19.7 2008-06-26 02:10:21 cal103 Exp $ 30 30 //#--------------------------------------------------------------------------- 31 31 //# The PKSMBrecord class stores an MBFITS single-dish data record. … … 53 53 raRate = 0.0f; 54 54 decRate = 0.0f; 55 rateAge = 0; 55 56 nIF = 0; 56 57 } … … 226 227 // Beam-dependent parameters. 227 228 beamNo = other.beamNo; 228 ra = other.ra; 229 dec = other.dec; 230 raRate = other.raRate; 231 decRate = other.decRate; 229 ra = other.ra; 230 dec = other.dec; 231 raRate = other.raRate; 232 decRate = other.decRate; 233 rateAge = other.rateAge; 234 rateson = other.rateson; 232 235 233 236 // IF-dependent parameters. … … 343 346 // Beam-dependent parameters. 344 347 beamNo = other.beamNo; 345 ra = other.ra; 346 dec = other.dec; 347 raRate = other.raRate; 348 decRate = other.decRate; 348 ra = other.ra; 349 dec = other.dec; 350 raRate = other.raRate; 351 decRate = other.decRate; 352 rateAge = other.rateAge; 353 rateson = other.rateson; 349 354 350 355 // IF-dependent parameters. -
trunk/external/atnf/PKSIO/PKSMBrecord.h
r1325 r1427 2 2 //# PKSMBrecord.h: Class to store an MBFITS single-dish data record. 3 3 //#--------------------------------------------------------------------------- 4 //# Copyright (C) 2000-200 64 //# Copyright (C) 2000-2008 5 5 //# Mark Calabretta, ATNF 6 6 //# … … 27 27 //# AUSTRALIA 28 28 //# 29 //# $Id: PKSMBrecord.h,v 19. 8 2006/07/05 04:52:07 mcalabreExp $29 //# $Id: PKSMBrecord.h,v 19.9 2008-06-26 02:10:21 cal103 Exp $ 30 30 //#--------------------------------------------------------------------------- 31 31 //# The PKSMBrecord class stores an MBFITS single-dish data record. … … 109 109 float raRate; // Scan rate in right ascension, radian/s. 110 110 float decRate; // Scan rate in declination, radian/s. 111 short rateAge; // Scan rate age (staleness), cycles. 112 short rateson; // Staleness reason code: 113 // 1: position and timestamp unchanged, 114 // 2: position changed but not timestamp, 115 // 3: position timestamp went backwards. 111 116 112 117 // IF-dependent parameters. -
trunk/external/atnf/PKSIO/PKSMS2reader.cc
r1399 r1427 2 2 //# PKSMS2reader.cc: Class to read Parkes Multibeam data from a v2 MS. 3 3 //#--------------------------------------------------------------------------- 4 //# Copyright (C) 2000-200 74 //# Copyright (C) 2000-2008 5 5 //# Associated Universities, Inc. Washington DC, USA. 6 6 //# … … 26 26 //# Charlottesville, VA 22903-2475 USA 27 27 //# 28 //# $Id: PKSMS2reader.cc,v 19.1 2 2007/11/12 03:37:56cal103 Exp $28 //# $Id: PKSMS2reader.cc,v 19.13 2008-06-26 02:08:02 cal103 Exp $ 29 29 //#--------------------------------------------------------------------------- 30 30 //# Original: 2000/08/03, Mark Calabretta, ATNF … … 248 248 String &antName, 249 249 Vector<Double> &antPosition, 250 String &obs Mode,250 String &obsType, 251 251 String &bunit, 252 252 Float &equinox, … … 272 272 // Observation type. 273 273 if (cObsModeCol.nrow()) { 274 obs Mode = cObsModeCol(0);275 if (obs Mode == "\0") obsMode = "RF";276 } else { 277 obs Mode = "RF";274 obsType = cObsModeCol(0); 275 if (obsType == "\0") obsType = "RF"; 276 } else { 277 obsType = "RF"; 278 278 } 279 279 … … 486 486 // Read the next data record. 487 487 488 Int PKSMS2reader::read( 489 Int &scanNo, 490 Int &cycleNo, 491 Double &mjd, 492 Double &interval, 493 String &fieldName, 494 String &srcName, 495 Vector<Double> &srcDir, 496 Vector<Double> &srcPM, 497 Double &srcVel, 498 String &obsMode, 499 Int &IFno, 500 Double &refFreq, 501 Double &bandwidth, 502 Double &freqInc, 503 Double &restFreq, 504 Vector<Float> &tcal, 505 String &tcalTime, 506 Float &azimuth, 507 Float &elevation, 508 Float &parAngle, 509 Float &focusAxi, 510 Float &focusTan, 511 Float &focusRot, 512 Float &temperature, 513 Float &pressure, 514 Float &humidity, 515 Float &windSpeed, 516 Float &windAz, 517 Int &refBeam, 518 Int &beamNo, 519 Vector<Double> &direction, 520 Vector<Double> &scanRate, 521 Vector<Float> &tsys, 522 Vector<Float> &sigma, 523 Vector<Float> &calFctr, 524 Matrix<Float> &baseLin, 525 Matrix<Float> &baseSub, 526 Matrix<Float> &spectra, 527 Matrix<uChar> &flagged, 528 Complex &xCalFctr, 529 Vector<Complex> &xPol) 488 Int PKSMS2reader::read(MBrecord &MBrec) 530 489 { 531 490 if (!cMSopen) { … … 555 514 556 515 // Renumerate scan no. Here still is 1-based 557 scanNo = cScanNoCol(cIdx) - cScanNoCol(0) + 1;558 559 if ( scanNo != cScanNo) {516 MBrec.scanNo = cScanNoCol(cIdx) - cScanNoCol(0) + 1; 517 518 if (MBrec.scanNo != cScanNo) { 560 519 // Start of new scan. 561 cScanNo = scanNo;520 cScanNo = MBrec.scanNo; 562 521 cCycleNo = 1; 563 522 cTime = cTimeCol(cIdx); … … 565 524 566 525 Double time = cTimeCol(cIdx); 567 mjd = time/86400.0;568 interval = cIntervalCol(cIdx);526 MBrec.mjd = time/86400.0; 527 MBrec.interval = cIntervalCol(cIdx); 569 528 570 529 // Reconstruct the integration cycle number; due to small latencies the 571 530 // integration time is usually slightly less than the time between cycles, 572 531 // resetting cTime will prevent the difference from accumulating. 573 cCycleNo += nint((time - cTime)/ interval);574 cycleNo = cCycleNo;532 cCycleNo += nint((time - cTime)/MBrec.interval); 533 MBrec.cycleNo = cCycleNo; 575 534 cTime = time; 576 535 577 536 Int fieldId = cFieldIdCol(cIdx); 578 fieldName = cFieldNameCol(fieldId);537 MBrec.fieldName = cFieldNameCol(fieldId); 579 538 580 539 Int srcId = cSrcIdCol(fieldId); 581 srcName = cSrcNameCol(srcId);582 srcDir = cSrcDirCol(srcId);583 srcPM = cSrcPMCol(srcId);540 MBrec.srcName = cSrcNameCol(srcId); 541 MBrec.srcDir = cSrcDirCol(srcId); 542 MBrec.srcPM = cSrcPMCol(srcId); 584 543 585 544 // Systemic velocity. 586 545 if (!cHaveSrcVel) { 587 srcVel = 0.0f;588 } else { 589 srcVel = cSrcVelCol(srcId)(IPosition(1,0));546 MBrec.srcVel = 0.0f; 547 } else { 548 MBrec.srcVel = cSrcVelCol(srcId)(IPosition(1,0)); 590 549 } 591 550 592 551 // Observation type. 593 552 Int stateId = cStateIdCol(cIdx); 594 obsMode = cObsModeCol(stateId);595 596 IFno = iIF + 1;553 MBrec.obsType = cObsModeCol(stateId); 554 555 MBrec.IFno = iIF + 1; 597 556 Int nChan = abs(cEndChan(iIF) - cStartChan(iIF)) + 1; 598 557 … … 601 560 if (nChan == 1) { 602 561 cout << "The input is continuum data. "<< endl; 603 freqInc = chanFreq(0);604 refFreq = chanFreq(0);605 restFreq = 0.0f;562 MBrec.freqInc = chanFreq(0); 563 MBrec.refFreq = chanFreq(0); 564 MBrec.restFreq = 0.0f; 606 565 } else { 607 566 if (cStartChan(iIF) <= cEndChan(iIF)) { 608 freqInc = chanFreq(1) - chanFreq(0);567 MBrec.freqInc = chanFreq(1) - chanFreq(0); 609 568 } else { 610 freqInc = chanFreq(0) - chanFreq(1);611 } 612 613 refFreq = chanFreq(cRefChan(iIF)-1);614 restFreq = cSrcRestFrqCol(srcId)(IPosition(1,0));615 } 616 bandwidth = abs(freqInc * nChan);617 618 tcal.resize(cNPol(iIF));619 tcal = 0.0f;620 tcalTime = "";621 azimuth = 0.0f;622 elevation = 0.0f;623 parAngle = 0.0f;624 focusAxi = 0.0f;625 focusTan = 0.0f;626 focusRot = 0.0f;569 MBrec.freqInc = chanFreq(0) - chanFreq(1); 570 } 571 572 MBrec.refFreq = chanFreq(cRefChan(iIF)-1); 573 MBrec.restFreq = cSrcRestFrqCol(srcId)(IPosition(1,0)); 574 } 575 MBrec.bandwidth = abs(MBrec.freqInc * nChan); 576 577 MBrec.tcal.resize(cNPol(iIF)); 578 MBrec.tcal = 0.0f; 579 MBrec.tcalTime = ""; 580 MBrec.azimuth = 0.0f; 581 MBrec.elevation = 0.0f; 582 MBrec.parAngle = 0.0f; 583 MBrec.focusAxi = 0.0f; 584 MBrec.focusTan = 0.0f; 585 MBrec.focusRot = 0.0f; 627 586 628 587 // Find the appropriate entry in the WEATHER subtable. … … 637 596 if (weatherIdx < 0) { 638 597 // No appropriate WEATHER entry. 639 pressure= 0.0f;640 humidity= 0.0f;641 temperature= 0.0f;642 } else { 643 pressure = cPressureCol(weatherIdx);644 humidity = cHumidityCol(weatherIdx);645 temperature = cTemperatureCol(weatherIdx);646 } 647 648 windSpeed = 0.0f;649 windAz = 0.0f;650 651 refBeam = 0;652 beamNo = ibeam + 1;598 MBrec.temperature = 0.0f; 599 MBrec.pressure = 0.0f; 600 MBrec.humidity = 0.0f; 601 } else { 602 MBrec.temperature = cTemperatureCol(weatherIdx); 603 MBrec.pressure = cPressureCol(weatherIdx); 604 MBrec.humidity = cHumidityCol(weatherIdx); 605 } 606 607 MBrec.windSpeed = 0.0f; 608 MBrec.windAz = 0.0f; 609 610 MBrec.refBeam = 0; 611 MBrec.beamNo = ibeam + 1; 653 612 654 613 Matrix<Double> pointingDir = cPointingCol(fieldId); 655 direction = pointingDir.column(0);614 MBrec.direction = pointingDir.column(0); 656 615 uInt ncols = pointingDir.ncolumn(); 657 616 if (ncols == 1) { 658 scanRate = 0.0f; 659 } else { 660 scanRate = pointingDir.column(1); 661 } 617 MBrec.scanRate = 0.0f; 618 } else { 619 MBrec.scanRate = pointingDir.column(1); 620 } 621 MBrec.rateAge = 0; 622 MBrec.rateson = 0; 662 623 663 624 // Get Tsys assuming that entries in the SYSCAL table match the main table. … … 669 630 } 670 631 if (cHaveTsys) { 671 cTsysCol.get(cIdx, tsys, True);632 cTsysCol.get(cIdx, MBrec.tsys, True); 672 633 } else { 673 634 Int numReceptor; 674 635 cNumReceptorCol.get(0, numReceptor); 675 tsys.resize(numReceptor);676 tsys = 1.0f;677 } 678 cSigmaCol.get(cIdx, sigma, True);636 MBrec.tsys.resize(numReceptor); 637 MBrec.tsys = 1.0f; 638 } 639 cSigmaCol.get(cIdx, MBrec.sigma, True); 679 640 680 641 // Calibration factors (if available). 681 calFctr.resize(cNPol(iIF));642 MBrec.calFctr.resize(cNPol(iIF)); 682 643 if (cHaveCalFctr) { 683 cCalFctrCol.get(cIdx, calFctr);684 } else { 685 calFctr = 0.0f;644 cCalFctrCol.get(cIdx, MBrec.calFctr); 645 } else { 646 MBrec.calFctr = 0.0f; 686 647 } 687 648 688 649 // Baseline parameters (if available). 689 650 if (cHaveBaseLin) { 690 baseLin.resize(2,cNPol(iIF));691 cBaseLinCol.get(cIdx, baseLin);692 693 baseSub.resize(9,cNPol(iIF));694 cBaseSubCol.get(cIdx, baseSub);695 696 } else { 697 baseLin.resize(0,0);698 baseSub.resize(0,0);651 MBrec.baseLin.resize(2,cNPol(iIF)); 652 cBaseLinCol.get(cIdx, MBrec.baseLin); 653 654 MBrec.baseSub.resize(9,cNPol(iIF)); 655 cBaseSubCol.get(cIdx, MBrec.baseSub); 656 657 } else { 658 MBrec.baseLin.resize(0,0); 659 MBrec.baseSub.resize(0,0); 699 660 } 700 661 … … 709 670 // Transpose spectra. 710 671 Int nPol = tmpData.nrow(); 711 spectra.resize(nChan, nPol);712 flagged.resize(nChan, nPol);672 MBrec.spectra.resize(nChan, nPol); 673 MBrec.flagged.resize(nChan, nPol); 713 674 if (cEndChan(iIF) >= cStartChan(iIF)) { 714 675 // Simple transposition. 715 676 for (Int ipol = 0; ipol < nPol; ipol++) { 716 677 for (Int ichan = 0; ichan < nChan; ichan++) { 717 spectra(ichan,ipol) = tmpData(ipol,ichan);718 flagged(ichan,ipol) = tmpFlag(ipol,ichan);678 MBrec.spectra(ichan,ipol) = tmpData(ipol,ichan); 679 MBrec.flagged(ichan,ipol) = tmpFlag(ipol,ichan); 719 680 } 720 681 } … … 725 686 for (Int ipol = 0; ipol < nPol; ipol++) { 726 687 for (Int ichan = 0; ichan < nChan; ichan++, jchan--) { 727 spectra(ichan,ipol) = tmpData(ipol,jchan);728 flagged(ichan,ipol) = tmpFlag(ipol,jchan);688 MBrec.spectra(ichan,ipol) = tmpData(ipol,jchan); 689 MBrec.flagged(ichan,ipol) = tmpFlag(ipol,jchan); 729 690 } 730 691 } … … 735 696 if (cGetXPol) { 736 697 if (cHaveXCalFctr) { 737 cXCalFctrCol.get(cIdx, xCalFctr);698 cXCalFctrCol.get(cIdx, MBrec.xCalFctr); 738 699 } else { 739 xCalFctr = Complex(0.0f, 0.0f);740 } 741 742 cDataCol.get(cIdx, xPol, True);700 MBrec.xCalFctr = Complex(0.0f, 0.0f); 701 } 702 703 cDataCol.get(cIdx, MBrec.xPol, True); 743 704 744 705 if (cEndChan(iIF) < cStartChan(iIF)) { … … 746 707 Int jchan = nChan - 1; 747 708 for (Int ichan = 0; ichan < nChan/2; ichan++, jchan--) { 748 ctmp = xPol(ichan);749 xPol(ichan) =xPol(jchan);750 xPol(jchan) = ctmp;709 ctmp = MBrec.xPol(ichan); 710 MBrec.xPol(ichan) = MBrec.xPol(jchan); 711 MBrec.xPol(jchan) = ctmp; 751 712 } 752 713 } -
trunk/external/atnf/PKSIO/PKSMS2reader.h
r1399 r1427 2 2 //# PKSMS2reader.h: Class to read Parkes Multibeam data from a v2 MS. 3 3 //#--------------------------------------------------------------------------- 4 //# Copyright (C) 2000-200 74 //# Copyright (C) 2000-2008 5 5 //# Associated Universities, Inc. Washington DC, USA. 6 6 //# … … 26 26 //# Charlottesville, VA 22903-2475 USA 27 27 //# 28 //# $Id: PKSMS2reader.h,v 19.1 3 2007/11/12 03:37:56cal103 Exp $28 //# $Id: PKSMS2reader.h,v 19.14 2008-06-26 02:03:51 cal103 Exp $ 29 29 //#--------------------------------------------------------------------------- 30 30 //# Original: 2000/08/03, Mark Calabretta, ATNF … … 111 111 112 112 // Read the next data record. 113 virtual Int read( 114 Int &scanNo, 115 Int &cycleNo, 116 Double &mjd, 117 Double &interval, 118 String &fieldName, 119 String &srcName, 120 Vector<Double> &srcDir, 121 Vector<Double> &srcPM, 122 Double &srcVel, 123 String &obsMode, 124 Int &IFno, 125 Double &refFreq, 126 Double &bandwidth, 127 Double &freqInc, 128 Double &restFreq, 129 Vector<Float> &tcal, 130 String &tcalTime, 131 Float &azimuth, 132 Float &elevation, 133 Float &parAngle, 134 Float &focusAxi, 135 Float &focusTan, 136 Float &focusRot, 137 Float &temperature, 138 Float &pressure, 139 Float &humidity, 140 Float &windSpeed, 141 Float &windAz, 142 Int &refBeam, 143 Int &beamNo, 144 Vector<Double> &direction, 145 Vector<Double> &scanRate, 146 Vector<Float> &tsys, 147 Vector<Float> &sigma, 148 Vector<Float> &calFctr, 149 Matrix<Float> &baseLin, 150 Matrix<Float> &baseSub, 151 Matrix<Float> &spectra, 152 Matrix<uChar> &flagged, 153 Complex &xCalFctr, 154 Vector<Complex> &xPol); 113 virtual Int read(MBrecord &mbrec); 155 114 156 115 // Read the next data record, just the basics. -
trunk/external/atnf/PKSIO/PKSreader.cc
r1325 r1427 2 2 //# PKSreader.cc: Class to read Parkes multibeam data. 3 3 //#--------------------------------------------------------------------------- 4 //# Copyright (C) 2000-200 64 //# Copyright (C) 2000-2008 5 5 //# Associated Universities, Inc. Washington DC, USA. 6 6 //# … … 26 26 //# Charlottesville, VA 22903-2475 USA 27 27 //# 28 //# $Id: PKSreader.cc,v 19. 4 2006/05/19 02:14:50 mcalabreExp $28 //# $Id: PKSreader.cc,v 19.6 2008-06-26 01:54:08 cal103 Exp $ 29 29 //#--------------------------------------------------------------------------- 30 30 //# Original: 2000/08/23, Mark Calabretta, ATNF … … 75 75 if (inFile.isRegular()) { 76 76 // Is it MBFITS or SDFITS? 77 RegularFileIO file(name); 78 char buf[32]; 79 file.read(30, buf, False); 80 buf[30] = '\0'; 81 if (String(buf) == "SIMPLE = T") { 82 // Looks like SDFITS. 77 if (strstr(name.chars(), ".sdfits")) { 78 // Looks like SDFITS, possibly gzip'd. 83 79 format = "SDFITS"; 84 80 reader = new PKSFITSreader("SDFITS"); 85 81 86 82 } else { 87 // Assume it's MBFITS. 88 format = "MBFITS"; 89 reader = new PKSFITSreader("MBFITS", retry, interpolate); 83 RegularFileIO file(name); 84 char buf[32]; 85 file.read(30, buf, False); 86 buf[30] = '\0'; 87 if (String(buf) == "SIMPLE = T") { 88 // Looks like SDFITS. 89 format = "SDFITS"; 90 reader = new PKSFITSreader("SDFITS"); 91 92 } else { 93 // Assume it's MBFITS. 94 format = "MBFITS"; 95 reader = new PKSFITSreader("MBFITS", retry, interpolate); 96 } 90 97 } 91 98 … … 155 162 return 0; 156 163 } 164 165 166 //-------------------------------------------------------- PKSFITSreader::read 167 168 // Read the next data record. 169 170 Int PKSreader::read( 171 Int &scanNo, 172 Int &cycleNo, 173 Double &mjd, 174 Double &interval, 175 String &fieldName, 176 String &srcName, 177 Vector<Double> &srcDir, 178 Vector<Double> &srcPM, 179 Double &srcVel, 180 String &obsType, 181 Int &IFno, 182 Double &refFreq, 183 Double &bandwidth, 184 Double &freqInc, 185 Double &restFreq, 186 Vector<Float> &tcal, 187 String &tcalTime, 188 Float &azimuth, 189 Float &elevation, 190 Float &parAngle, 191 Float &focusAxi, 192 Float &focusTan, 193 Float &focusRot, 194 Float &temperature, 195 Float &pressure, 196 Float &humidity, 197 Float &windSpeed, 198 Float &windAz, 199 Int &refBeam, 200 Int &beamNo, 201 Vector<Double> &direction, 202 Vector<Double> &scanRate, 203 Vector<Float> &tsys, 204 Vector<Float> &sigma, 205 Vector<Float> &calFctr, 206 Matrix<Float> &baseLin, 207 Matrix<Float> &baseSub, 208 Matrix<Float> &spectra, 209 Matrix<uChar> &flagged, 210 Complex &xCalFctr, 211 Vector<Complex> &xPol) 212 { 213 Int status; 214 MBrecord MBrec; 215 216 if ((status = read(MBrec))) { 217 if (status != -1) { 218 status = 1; 219 } 220 221 return status; 222 } 223 224 scanNo = MBrec.scanNo; 225 cycleNo = MBrec.cycleNo; 226 mjd = MBrec.mjd; 227 interval = MBrec.interval; 228 fieldName = MBrec.fieldName; 229 srcName = MBrec.srcName; 230 srcDir = MBrec.srcDir; 231 srcPM = MBrec.srcPM; 232 srcVel = MBrec.srcVel; 233 obsType = MBrec.obsType; 234 IFno = MBrec.IFno; 235 refFreq = MBrec.refFreq; 236 bandwidth = MBrec.bandwidth; 237 freqInc = MBrec.freqInc; 238 restFreq = MBrec.restFreq; 239 tcal = MBrec.tcal; 240 tcalTime = MBrec.tcalTime; 241 azimuth = MBrec.azimuth; 242 elevation = MBrec.elevation; 243 parAngle = MBrec.parAngle; 244 focusAxi = MBrec.focusAxi; 245 focusTan = MBrec.focusTan; 246 focusRot = MBrec.focusRot; 247 temperature = MBrec.temperature; 248 pressure = MBrec.pressure; 249 humidity = MBrec.humidity; 250 windSpeed = MBrec.windSpeed; 251 windAz = MBrec.windAz; 252 refBeam = MBrec.refBeam; 253 beamNo = MBrec.beamNo; 254 direction = MBrec.direction; 255 scanRate = MBrec.scanRate; 256 tsys = MBrec.tsys; 257 sigma = MBrec.sigma; 258 calFctr = MBrec.calFctr; 259 baseLin = MBrec.baseLin; 260 baseSub = MBrec.baseSub; 261 spectra = MBrec.spectra; 262 flagged = MBrec.flagged; 263 xCalFctr = MBrec.xCalFctr; 264 xPol = MBrec.xPol; 265 266 return 0; 267 } -
trunk/external/atnf/PKSIO/PKSreader.h
r1399 r1427 2 2 //# PKSreader.h: Class to read Parkes multibeam data. 3 3 //#--------------------------------------------------------------------------- 4 //# Copyright (C) 2000-200 74 //# Copyright (C) 2000-2008 5 5 //# Associated Universities, Inc. Washington DC, USA. 6 6 //# … … 26 26 //# Charlottesville, VA 22903-2475 USA 27 27 //# 28 //# $Id: PKSreader.h,v 19.1 2 2007/11/12 03:37:56cal103 Exp $28 //# $Id: PKSreader.h,v 19.13 2008-06-26 01:50:24 cal103 Exp $ 29 29 //#--------------------------------------------------------------------------- 30 30 //# Original: 2000/08/02, Mark Calabretta, ATNF … … 40 40 #include <casa/BasicSL/String.h> 41 41 42 #include <casa/namespace.h> 43 42 44 // <summary> 43 45 // Class to read Parkes multibeam data. 44 46 // </summary> 45 46 #include <casa/namespace.h>47 47 48 48 // Open an appropriate PKSreader for a Parkes Multibeam dataset. … … 76 76 Bool &haveSpectra); 77 77 78 class MBrecord; 78 79 79 80 class PKSreader … … 132 133 Matrix<Double> &positions) = 0; 133 134 134 // Read the next data record. 135 // Read the next data record (MBrecord is defined below). 136 virtual Int read(MBrecord &mbrec) = 0; 137 138 // Read the next data record (for backwards compatibility, do not use). 135 139 virtual Int read( 136 140 Int &scanNo, … … 174 178 Matrix<uChar> &flagged, 175 179 Complex &xCalFctr, 176 Vector<Complex> &xPol) = 0;180 Vector<Complex> &xPol); 177 181 178 182 // Read the next data record, just the basics. … … 196 200 }; 197 201 202 203 // Essentially just a struct used as a function argument. 204 class MBrecord 205 { 206 public: 207 Int scanNo; 208 Int cycleNo; 209 Double mjd; 210 Double interval; 211 String fieldName; 212 String srcName; 213 Vector<Double> srcDir; 214 Vector<Double> srcPM; 215 Double srcVel; 216 String obsType; 217 Int IFno; 218 Double refFreq; 219 Double bandwidth; 220 Double freqInc; 221 Double restFreq; 222 Vector<Float> tcal; 223 String tcalTime; 224 Float azimuth; 225 Float elevation; 226 Float parAngle; 227 Float focusAxi; 228 Float focusTan; 229 Float focusRot; 230 Float temperature; 231 Float pressure; 232 Float humidity; 233 Float windSpeed; 234 Float windAz; 235 Int refBeam; 236 Int beamNo; 237 Vector<Double> direction; 238 Vector<Double> scanRate; 239 Int rateAge; 240 Int rateson; 241 Vector<Float> tsys; 242 Vector<Float> sigma; 243 Vector<Float> calFctr; 244 Matrix<Float> baseLin; 245 Matrix<Float> baseSub; 246 Matrix<Float> spectra; 247 Matrix<uChar> flagged; 248 Complex xCalFctr; 249 Vector<Complex> xPol; 250 }; 251 198 252 #endif -
trunk/external/atnf/PKSIO/SDFITSreader.cc
r1399 r1427 2 2 //# SDFITSreader.cc: ATNF CFITSIO interface class for SDFITS input. 3 3 //#--------------------------------------------------------------------------- 4 //# Copyright (C) 2000-200 74 //# Copyright (C) 2000-2008 5 5 //# Associated Universities, Inc. Washington DC, USA. 6 6 //# … … 26 26 //# Charlottesville, VA 22903-2475 USA 27 27 //# 28 //# $Id: SDFITSreader.cc,v 19.2 3 2007/11/12 03:37:56cal103 Exp $28 //# $Id: SDFITSreader.cc,v 19.24 2008-06-26 02:13:11 cal103 Exp $ 29 29 //#--------------------------------------------------------------------------- 30 30 //# The SDFITSreader class reads single dish FITS files such as those written … … 1289 1289 mbrec.decRate = scanrate[1] * D2R; 1290 1290 } 1291 mbrec.rateAge = 0; 1292 mbrec.rateson = 0; 1291 1293 1292 1294 // IF-dependent parameters. -
trunk/external/atnf/pks/pks_maths.cc
r1325 r1427 27 27 //# 28 28 //# Original: Mark Calabretta 29 //# $Id: pks_maths.cc,v 1.5 2006 /05/19 00:12:35 mcalabre Exp $29 //# $Id: pks_maths.cc,v 1.5 2006-05-19 00:12:35 mcalabre Exp $ 30 30 //---------------------------------------------------------------------------- 31 31 -
trunk/external/atnf/pks/pks_maths.h
r1325 r1427 27 27 //# 28 28 //# Original: Mark Calabretta 29 //# $Id: pks_maths.h,v 1.6 2006 /05/19 00:12:06 mcalabre Exp $29 //# $Id: pks_maths.h,v 1.6 2006-05-19 00:12:06 mcalabre Exp $ 30 30 //---------------------------------------------------------------------------- 31 31 #ifndef ATNF_PKS_MATHS_H -
trunk/external/atnf/pks/pksmb_support.cc
r1325 r1427 27 27 //# 28 28 //# Original: David Barnes, February 1997 29 //# $Id: pksmb_support.cc,v 19.9 2007 /02/07 06:44:05 cal103 Exp $29 //# $Id: pksmb_support.cc,v 19.9 2007-02-07 06:44:05 cal103 Exp $ 30 30 //---------------------------------------------------------------------------- 31 31 -
trunk/external/atnf/pks/pksmb_support.h
r1325 r1427 27 27 //# 28 28 //# Original: David Barnes, February 1997. 29 //# $Id: pksmb_support.h,v 19.9 2007 /02/07 06:44:05 cal103 Exp $29 //# $Id: pksmb_support.h,v 19.9 2007-02-07 06:44:05 cal103 Exp $ 30 30 //---------------------------------------------------------------------------- 31 31 #ifndef ATNF_PKSMB_SUPPORT_H
Note:
See TracChangeset
for help on using the changeset viewer.