00001 //# VlaDAs.h: 00002 //# Copyright (C) 1997,1999 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# 00027 //# $Id$ 00028 00029 #ifndef NRAO_VLADAS_H 00030 #define NRAO_VLADAS_H 00031 00032 #include <casa/aips.h> 00033 #include <casa/BasicSL/String.h> 00034 #include <casa/Arrays/Cube.h> 00035 #include <casa/Arrays/Vector.h> 00036 00037 #include <casa/namespace.h> 00038 // <summary> 00039 // Classes define VLA Data Archive structures 00040 //</summary> 00041 00042 // <use visibility=local> or <use visibility=export> 00043 00044 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos=""> 00045 // </reviewed> 00046 00047 // <prerequisite> 00048 // <li> SomeClass 00049 // <li> SomeOtherClass 00050 // <li> some concept 00051 // </prerequisite> 00052 // 00053 // <etymology> 00054 // </etymology> 00055 // 00056 // <synopsis> 00057 // </synopsis> 00058 // 00059 // <example> 00060 // </example> 00061 // 00062 // <motivation> 00063 // </motivation> 00064 // 00065 // <templating arg=T> 00066 // <li> 00067 // <li> 00068 // </templating> 00069 // 00070 // <thrown> 00071 // <li> 00072 // <li> 00073 // </thrown> 00074 // 00075 // <todo asof="yyyy/mm/dd"> 00076 // <li> add this feature 00077 // <li> fix this bug 00078 // <li> start discussion of this possible extension 00079 // </todo> 00080 00081 // These structures are created pretty much byte for byte from the Hunt, 00082 // Sowinski, and Bottomly memo on the VLA archive format. 00083 // 00084 // Note modcomp words are two bytes as I (wky) painfully found out. 00085 00086 struct RecordControlArea { 00087 Int logicalRecordLength; 00088 Short formatType; 00089 Short formatRevision; 00090 Int dateMJAD; 00091 Int timeIAT; // 19.2 Hz interrupt counts since IAT midnight 00092 String controlProgramID; 00093 Int ptr2SDA; 00094 Int ptr2ADA; 00095 Short lengthOfADA; 00096 Short numberOfAntennas; 00097 Int ptr2FirstCDA; 00098 Short numWordsFirstBRH; 00099 Short numWordsFirstBR; 00100 Int ptr2SecondCDA; 00101 Short numWordsSecondBRH; 00102 Short numWordsSecondBR; 00103 Int ptr2ThirdCDA; 00104 Short numWordsThirdBRH; 00105 Short numWordsThirdBR; 00106 Int ptr2FourthCDA; 00107 Short numWordsFourthBRH; 00108 Short numWordsFourthBR; 00109 Short recordSizePerBlockSize; 00110 }; 00111 00112 struct RCAFlags { 00113 Bool logicalRecordLengthFlag; 00114 Bool formatTypeFlag; 00115 Bool formatRevisionFlag; 00116 Bool dateMJADFlag; 00117 Bool timeIATFlag; 00118 Bool controlProgramIDFlag; 00119 Bool ptr2SDAFlag; 00120 Bool ptr2ADAFlag; 00121 Bool lengthOfADAFlag; 00122 Bool numberOfAntennasFlag; 00123 Bool ptr2FirstCDAFlag; 00124 Bool numWordsFirstBRHFlag; 00125 Bool numWordsFirstBRFlag; 00126 Bool ptr2SecondCDAFlag; 00127 Bool numWordsSecondBRHFlag; 00128 Bool numWordsSecondBRFlag; 00129 Bool ptr2ThirdCDAFlag; 00130 Bool numWordsThirdBRHFlag; 00131 Bool numWordsThirdBRFlag; 00132 Bool ptr2FourthCDAFlag; 00133 Bool numWordsFourthBRHFlag; 00134 Bool numWordsFourthBRFlag; 00135 Bool recordSizePerBlockSizeFlag; 00136 Bool writeSomethingFlag; 00137 }; 00138 00139 struct SubarrayDataArea { 00140 Short subarrayID; 00141 String sourceName; 00142 Short sourceNameQualifier; 00143 String arrayConfiguration; 00144 String observingProgramID; 00145 Short aipsID; 00146 String observingMode; 00147 Char calibratorCode; 00148 uChar submode; 00149 Short arrayStatusInformation; 00150 Short numFreqChansPerBaseline; 00151 Short integrationTime; // 19.2 Hz interrupt counts 00152 Float stopTime; // LST Radians 00153 Float startTime; // LST Radians 00154 Double ra; // At standard Epoch 00155 Double dec; // At standard Epoch 00156 Double apparentRA; // Now 00157 Double apparentDec; // Now 00158 Double sslos[4]; // Signed Sum of LOs for IFS A-D, GHz 00159 Double skyFreq[4]; // at Band Center channel 0, GHz 00160 Double iatEndOfIntegration; // Radians 00161 Double lstEndOfIntegration; // Radians 00162 Double iat4GeoCalculations; // Radians 00163 Float currentSurfaceRefractivity; // n-1 00164 Float estimatedZenithAtmosPhase; // nsec 00165 Float sinElevation; 00166 Float cosElevation; 00167 Float sinAzimuth; 00168 Float cosAzimuth; 00169 Float cosParallacticAngle; 00170 Float sinParallacticAngle; 00171 Short bandwidthCodes; 00172 Short frontendFilterCodes; 00173 Short recirculatorControlCodes; 00174 Float zeroSpacingFlux; 00175 Float uvLimits[2]; // for on-line antsol 00176 Int arrayControlBits; 00177 Float weatherInfo[5]; 00178 Double radialVelocity[4]; // km/s 00179 Double lineRestFreq[4]; // MHz 00180 String velocityReferenceFrame[4]; 00181 String correlatorMode; 00182 String arrayProcessorOptions; 00183 Short epochYear; 00184 Short channelOffsets[4]; 00185 Short channelSepCodes[4]; // the k in 50MHz/2**k 00186 }; 00187 00188 struct SDAFlags { 00189 Bool timeStampFlag; 00190 Bool subarrayIDFlag; 00191 Bool sourceNameFlag; 00192 Bool sourceNameQualifierFlag; 00193 Bool arrayConfigurationFlag; 00194 Bool observingProgramIDFlag; 00195 Bool aipsIDFlag; 00196 Bool observingModeFlag; 00197 Bool calibratorCodeFlag; 00198 Bool submodeFlag; 00199 Bool arrayStatusInformationFlag; 00200 Bool numFreqChansPerBaselineFlag; 00201 Bool integrationTimeFlag; 00202 Bool stopTimeFlag; 00203 Bool startTimeFlag; 00204 Bool raFlag; 00205 Bool decFlag; 00206 Bool apparentRAFlag; 00207 Bool apparentDecFlag; 00208 Bool sslosFlag[4]; 00209 Bool skyFreqFlag[4]; 00210 Bool iatEndOfIntegrationFlag; 00211 Bool lstEndOfIntegrationFlag; 00212 Bool iat4GeoCalculationsFlag; 00213 Bool currentSurfaceRefractivityFlag; 00214 Bool estimatedZenithAtmosPhaseFlag; 00215 Bool sinElevationFlag; 00216 Bool cosElevationFlag; 00217 Bool sinAzimuthFlag; 00218 Bool cosAzimuthFlag; 00219 Bool cosParallacticAngleFlag; 00220 Bool sinParallacticAngleFlag; 00221 Bool bandwidthCodesFlag; 00222 Bool frontendFilterCodesFlag; 00223 Bool recirculatorControlCodesFlag; 00224 Bool zeroSpacingFluxFlag; 00225 Bool uvLimitsFlag; 00226 Bool arrayControlBitsFlag; 00227 Bool weatherInfoFlag[5]; 00228 Bool radialVelocityFlag[4]; 00229 Bool lineRestFreqFlag[4]; 00230 Bool velocityReferenceFrameFlag[4]; 00231 Bool correlatorModeFlag; 00232 Bool arrayProcessorOptionsFlag; 00233 Bool epochYearFlag; 00234 Bool channelOffsetsFlag[4]; 00235 Bool channelSepCodesFlag[4]; 00236 Bool writeSomethingFlag; 00237 }; 00238 00239 struct AntennaDataArea { 00240 uShort antennaID; 00241 uShort dcsAddress; 00242 Int antennaControlBits; 00243 Char ifStatus[2]; 00244 Float nominalSensitivity[4];// unitless 00245 Float peculiarDelay[4]; // nsec 00246 Double peculiarPhase; // turns 00247 Double totalDelayAtEpoch; // nsec 00248 Float u; // at center of integration for specified 00249 Float v; // Epoch (nsec) 00250 Float w; 00251 Double bx; // nsec 00252 Double by; 00253 Double bz; 00254 Float ba; // K-term (nsec) 00255 Float frontendTsys[4]; // Kelvin 00256 Float backendTsys[4]; // Kelvin 00257 }; 00258 00259 struct ADAFlags { 00260 Bool timeStampFlag; 00261 Bool antennaIDFlag; 00262 Bool dcsAddressFlag; 00263 Bool antennaControlBitsFlag; 00264 Bool ifStatusFlag; 00265 Bool nominalSensitivityFlag; 00266 Bool peculiarDelayFlag; 00267 Bool peculiarPhaseFlag; 00268 Bool totalDelayAtEpochFlag; 00269 Bool uFlag; 00270 Bool vFlag; 00271 Bool wFlag; 00272 Bool bxFlag; 00273 Bool byFlag; 00274 Bool bzFlag; 00275 Bool baFlag; 00276 Bool frontendTsysFlag; 00277 Bool backendTsysFlag; 00278 Bool writeSomethingFlag; 00279 }; 00280 00281 // Correlator Data comes in two flavors, continuum and spectral line 00282 00283 00284 struct VLAContinuumDatum { 00285 Cube<Short> header; 00286 Cube<Float> dataAwA; 00287 Cube<Float> dataCwC; 00288 Cube<Float> dataAwC; 00289 Cube<Float> dataCwA; 00290 }; 00291 00292 struct VLASpectralLine { 00293 Int numberOfChannels; 00294 Vector<Short> header; 00295 Cube<Complex> data; 00296 }; 00297 00298 struct CorrelatorDataArea { 00299 Short numAntennas; 00300 Int* antennaIDs; 00301 Int* writeAntennae; 00302 Bool continuum; 00303 union { 00304 VLAContinuumDatum* continuum; 00305 VLASpectralLine* spectralLine; 00306 } correlatorData; 00307 00308 // These two are replicated from the RCA for diagnostic purposes 00309 00310 Int dateMJAD; 00311 Int timeIAT; // 19.2 Hz interrupt counts since IAT midnight 00312 00313 }; 00314 00315 struct ContinuumCDAFlags { 00316 Bool timeStampFlag; 00317 Bool headerFlag; 00318 Bool dataFlag; 00319 Bool AwAFlag; 00320 Bool CwCFlag; 00321 Bool AwCFlag; 00322 Bool CwAFlag; 00323 Bool writeSomethingFlag; 00324 }; 00325 00326 struct SpectralLineCDAFlags { 00327 Bool timeStampFlag; 00328 Bool channelFlag; 00329 Bool writeSomethingFlag; 00330 Int channelCount; 00331 Int* channelID; 00332 Int ifFlag[4]; 00333 Bool allChannelsFlag; 00334 Bool baseLineFlag; 00335 }; 00336 00337 #endif
1.5.1