//#--------------------------------------------------------------------------- //# PKSMS2reader.h: Class to read Parkes Multibeam data from a v2 MS. //#--------------------------------------------------------------------------- //# livedata - processing pipeline for single-dish, multibeam spectral data. //# Copyright (C) 2000-2009, Australia Telescope National Facility, CSIRO //# //# This file is part of livedata. //# //# livedata is free software: you can redistribute it and/or modify it under //# the terms of the GNU General Public License as published by the Free //# Software Foundation, either version 3 of the License, or (at your option) //# any later version. //# //# livedata is distributed in the hope that it will be useful, but WITHOUT //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for //# more details. //# //# You should have received a copy of the GNU General Public License along //# with livedata. If not, see . //# //# Correspondence concerning livedata may be directed to: //# Internet email: mcalabre@atnf.csiro.au //# Postal address: Dr. Mark Calabretta //# Australia Telescope National Facility, CSIRO //# PO Box 76 //# Epping NSW 1710 //# AUSTRALIA //# //# http://www.atnf.csiro.au/computing/software/livedata.html //# $Id: PKSMS2reader.h,v 19.18 2009-09-29 07:33:38 cal103 Exp $ //#--------------------------------------------------------------------------- //# Original: 2000/08/03, Mark Calabretta, ATNF //#--------------------------------------------------------------------------- #ifndef ATNF_PKSMS2READER_H #define ATNF_PKSMS2READER_H #include #include #include #include #include #include #include #include #include #include #include #include // // Class to read Parkes Multibeam data from a v2 MS. // class PKSMS2reader : public PKSreader { public: // Default constructor. PKSMS2reader(); // Destructor. virtual ~PKSMS2reader(); // Open the MS for reading. virtual Int open( const String msName, const String antenna, Vector &beams, Vector &IFs, Vector &nChan, Vector &nPol, Vector &haveXPol, Bool &haveBase, Bool &haveSpectra); // Get parameters describing the data. virtual Int getHeader( String &observer, String &project, String &antName, Vector &antPosition, String &obsMode, String &bunit, Float &equinox, //String &freqRef, String &dopplerFrame, Double &mjd, Double &refFreq, Double &bandwidth); // Get frequency parameters for each IF. virtual Int getFreqInfo( Vector &startFreq, Vector &endFreq); // Set data selection criteria. Channel numbering is 1-relative, zero or // negative channel numbers are taken to be offsets from the last channel. virtual uInt select( const Vector beamSel, const Vector IFsel, const Vector startChan, const Vector endChan, const Vector refChan, const Bool getSpectra = True, const Bool getXPol = False, const Bool getFeedPos = False, const Bool getPointing = False, const Int coordSys = 0); // Find the range of the data selected in time and position. virtual Int findRange( Int &nRow, Int &nSel, Vector &timeSpan, Matrix &positions); // Read the next data record. /** virtual Int read( Int &scanNo, Int &cycleNo, Double &mjd, Double &interval, String &fieldName, String &srcName, Vector &srcDir, Vector &srcPM, Double &srcVel, String &obsMode, Int &IFno, Double &refFreq, Double &bandwidth, Double &freqInc, Vector &restFreq, Vector &tcal, String &tcalTime, Float &azimuth, Float &elevation, Float &parAngle, Float &focusAxi, Float &focusTan, Float &focusRot, Float &temperature, Float &pressure, Float &humidity, Float &windSpeed, Float &windAz, Int &refBeam, Int &beamNo, Vector &direction, Vector &scanRate, Vector &tsys, Vector &sigma, Vector &calFctr, Matrix &baseLin, Matrix &baseSub, Matrix &spectra, Matrix &flagged, Complex &xCalFctr, Vector &xPol); **/ virtual Int read(PKSrecord &pksrec); // Read the next data record, just the basics. virtual Int read( Int &IFno, Vector &tsys, Vector &calFctr, Matrix &baseLin, Matrix &baseSub, Matrix &spectra, Matrix &flagged); // Close the MS. virtual void close(void); private: Vector splitAntennaSelectionString( const String s ); void setupAntennaList( const String s ) ; Bool cHaveBaseLin, cHaveCalFctr, cHaveSrcVel, cHaveTsys, cHaveXCalFctr, cMSopen, cHaveTcal, cHaveDataCol, cALMA, cHaveSysCal, cHaveCorrectedDataCol; Int cCycleNo, cIdx, cNRow, cScanNo; Double cTime, lastmjd; Vector cEndChan, cRefChan, cStartChan; Vector cBeams, cIFs; Vector cDataSel; String cDirRef, cTelName; MeasurementSet cPKSMS; Table cSysCalTab, tmptab, tmptab2; //Vector cAntenna; Vector cAntId; ROScalarColumn cScanNoCol; ROScalarColumn cTimeCol; ROScalarColumn cIntervalCol; ROScalarColumn cFieldIdCol; ROScalarColumn cFieldNameCol; ROArrayColumn cFieldDelayDirCol; ROScalarColumn cSrcIdCol; ROScalarColumn cSrcId2Col; ROScalarColumn cSrcNameCol; ROArrayColumn cSrcDirCol; ROArrayColumn cSrcPMCol; ROArrayColumn cSrcVelCol; ROScalarColumn cStateIdCol; ROScalarColumn cCalCol; ROScalarColumn cObsModeCol; ROArrayColumn cSrcRestFrqCol; ROScalarColumn cDataDescIdCol; ROScalarColumn cSpWinIdCol; ROArrayColumn cChanFreqCol; ROScalarColumn cTotBWCol; ROScalarColumn cWeatherTimeCol; ROScalarColumn cTemperatureCol; ROScalarColumn cPressureCol; ROScalarColumn cHumidityCol; ROArrayColumn cTcalCol; ROScalarColumn cBeamNoCol; ROArrayColumn cPointingCol; ROScalarColumn cPointingTimeCol; ROArrayColumn cTsysCol; ROArrayColumn cSigmaCol; ROArrayColumn cCalFctrCol; ROArrayColumn cBaseLinCol; ROArrayColumn cBaseSubCol; ROArrayColumn cFloatDataCol; ROArrayColumn cFlagCol; ROScalarColumn cFlagRowCol; ROScalarColumn cXCalFctrCol; ROArrayColumn cDataCol; ROArrayColumn cCorrectedDataCol; ROScalarColumn cNumReceptorCol; ROScalarColumn cSigStateCol; ROScalarColumn cRefStateCol; }; #endif