[casacore] r21586 committed - Merged in CASA changes since 16-Mar-2015

1 view
Skip to first unread message

casa...@googlecode.com

unread,
Mar 25, 2015, 9:46:56 AM3/25/15
to casacor...@googlegroups.com
Revision: 21586
Author: gervandiepen
Date: Wed Mar 25 13:46:25 2015 UTC
Log: Merged in CASA changes since 16-Mar-2015

https://code.google.com/p/casacore/source/detail?r=21586

Modified:
/branches/nov14/coordinates/Coordinates/SpectralCoordinate.cc
/branches/nov14/coordinates/Coordinates/SpectralCoordinate.h
/branches/nov14/images/Images/ImageStatistics.h
/branches/nov14/images/Images/ImageStatistics.tcc
/branches/nov14/images/Images/test/tImageStatistics.cc
/branches/nov14/lattices/LatticeMath/LatticeStatistics.h
/branches/nov14/lattices/LatticeMath/LatticeStatistics.tcc
/branches/nov14/ms/MeasurementSets/MSMetaData.cc
/branches/nov14/ms/MeasurementSets/MSMetaData.h

=======================================
--- /branches/nov14/coordinates/Coordinates/SpectralCoordinate.cc Mon Feb
9 07:42:55 2015 UTC
+++ /branches/nov14/coordinates/Coordinates/SpectralCoordinate.cc Wed Mar
25 13:46:25 2015 UTC
@@ -466,9 +466,6 @@
//
return ok;
}
-
-
-

Bool SpectralCoordinate::toWorld(Double& world, const Double& pixel) const
{
@@ -1320,8 +1317,6 @@

return True;
}
-
-

Bool SpectralCoordinate::save(RecordInterface &container,
const String &fieldName) const
@@ -2513,6 +2508,7 @@
os << "waveUnit_p " << waveUnit_p << endl;
os << "nativeType_p " << nativeType_p << endl;
os << "unit_p " << unit_p.getName() << endl;
+ os << "increment " << increment() << endl;
os << "axisName_p " << axisName_p << endl;
os << "formatUnit_p " << formatUnit_p << endl;
os << "direction_p " << direction_p << endl;
@@ -2522,6 +2518,9 @@

}

+Bool SpectralCoordinate::isTabular() const {
+ return _tabular.ptr();
+}

ostream &operator<<(ostream &os, const SpectralCoordinate& spcoord) {
return spcoord.print(os);
=======================================
--- /branches/nov14/coordinates/Coordinates/SpectralCoordinate.h Wed Dec 10
08:06:42 2014 UTC
+++ /branches/nov14/coordinates/Coordinates/SpectralCoordinate.h Wed Mar 25
13:46:25 2015 UTC
@@ -586,6 +586,9 @@

ostream& print(ostream& os) const;

+ // is this a tabular coordinate?
+ Bool isTabular() const;
+
private:

SPtrHolder<TabularCoordinate> _tabular; // Tabular
coordinate OR
=======================================
--- /branches/nov14/images/Images/ImageStatistics.h Wed Mar 18 15:01:43
2015 UTC
+++ /branches/nov14/images/Images/ImageStatistics.h Wed Mar 25 13:46:25
2015 UTC
@@ -158,19 +158,7 @@

virtual Bool _canDoFlux() const;

- virtual Quantum<AccumType> _flux(
- AccumType sum, Double beamAreaInPixels
- ) const;

- virtual Bool _computeFlux(
- Array<AccumType>& flux, const Array<AccumType>& npts,
- const Array<AccumType>& sum
- );
-
- virtual Bool _computeFlux(
- AccumType& flux, AccumType sum, const IPosition& pos,
- Bool posInLattice
- );

private:
// Data
@@ -212,7 +200,21 @@
);


+ // If <src>isFluxDensity</src> is False, then the computed value is
+ // a flux (ie flux density integrated over a spectral extent)
+ Quantum<AccumType> _flux(
+ Bool& isFluxDensity, AccumType sum, Double beamAreaInPixels
+ ) const;
+
+ Bool _computeFlux(
+ Array<AccumType>& flux, const Array<AccumType>& npts,
+ const Array<AccumType>& sum
+ );

+ Bool _computeFlux(
+ Quantum<AccumType>& flux, AccumType sum, const IPosition& pos,
+ Bool posInLattice
+ );
//# Make members of parent class known.
protected:
using LatticeStatistics<T>::locInLattice;
=======================================
--- /branches/nov14/images/Images/ImageStatistics.tcc Wed Mar 18 15:01:43
2015 UTC
+++ /branches/nov14/images/Images/ImageStatistics.tcc Wed Mar 25 13:46:25
2015 UTC
@@ -58,38 +58,28 @@
// Public functions

template <class T>
-ImageStatistics<T>::ImageStatistics (const ImageInterface<T>& image,
- LogIO& os,
- Bool showProgress,
- Bool forceDisk)
-//
-// Constructor
-//
-: LatticeStatistics<T>(image, os, showProgress, forceDisk),
- pInImage_p(0), blc_(IPosition(image.coordinates().nPixelAxes(), 0)),
- precision_(-1), _showRobust(False), _recordMessages(False),
_listStats(True), _messages()
-{
- if (!setNewImage(image)) {
- os_p << error_p << LogIO::EXCEPTION;
- }
+ImageStatistics<T>::ImageStatistics (
+ const ImageInterface<T>& image, LogIO& os,
+ Bool showProgress, Bool forceDisk
+) : LatticeStatistics<T>(image, os, showProgress, forceDisk),
+ pInImage_p(0), blc_(IPosition(image.coordinates().nPixelAxes(), 0)),
+ precision_(-1), _showRobust(False), _recordMessages(False),
+ _listStats(True), _messages() {
+ ThrowIf(! setNewImage(image), error_p);
}

template <class T>
-ImageStatistics<T>::ImageStatistics (const ImageInterface<T>& image,
- Bool showProgress,
- Bool forceDisk)
-//
-// Constructor
-//
-: LatticeStatistics<T>(image, showProgress, forceDisk),
+ImageStatistics<T>::ImageStatistics (
+ const ImageInterface<T>& image, Bool showProgress,
+ Bool forceDisk
+) : LatticeStatistics<T>(image, showProgress, forceDisk),
pInImage_p(0), blc_(IPosition(image.coordinates().nPixelAxes(), 0)),
- precision_(-1), _showRobust(False), _recordMessages(False),
_listStats(True), _messages()
-{
+ precision_(-1), _showRobust(False), _recordMessages(False),
+ _listStats(True), _messages() {
if (!setNewImage(image)) {
os_p << error_p << LogIO::EXCEPTION;
}
}
-

template <class T>
ImageStatistics<T>::ImageStatistics(const ImageStatistics<T> &other)
@@ -121,16 +111,10 @@
}

template <class T>
-ImageStatistics<T>::~ImageStatistics()
-//
-// Destructor.
-//
-{
+ImageStatistics<T>::~ImageStatistics() {
delete pInImage_p;
pInImage_p = 0;
}
-
-

template <class T>
Bool ImageStatistics<T>::setNewImage(const ImageInterface<T>& image)
@@ -239,23 +223,9 @@
}
const ImageBeamSet& beams = ii.getBeamSet();
IPosition beamsShape = beams.shape();
- /*
- if (cSys.hasSpectralAxis()) {
- AlwaysAssert(
- beamsShape[0] == beamAreaShape[storageSpecAxis],
- AipsError
- );
- }
- */
Int beamPolAxis = -1;
if (cSys.hasPolarizationCoordinate()) {
beamPolAxis = specAxis < 0 ? 0 : 1;
- /*
- AlwaysAssert(
- beamsShape[beamPolAxis] == beamAreaShape[storagePolAxis],
- AipsError
- );
- */
}
IPosition curPos(beamAreaShape.nelements(), 0);
GaussianBeam curBeam;
@@ -481,24 +451,18 @@
Array<Double> beamArea;
String msg;
Bool hasBeam = _getBeamArea(beamArea, msg);
- String unit;
- if (! hasBeam) {
- unit = pInImage_p->units().getName();
- unit.downcase();
- }
- if (hasBeam || ! unit.contains("/beam")) {
- Quantum<AccumType> qFlux = _flux(
- sum, hasBeam ? *(beamArea.begin()) : 0
- );
- AccumType val = qFlux.getValue();
- String unit = qFlux.getFullUnit().getName();
- oss << " -- flux density [flux]: "
- << val << " " << unit;
- messages.push_back(oss.str());
- oss.str("");
- }
+ Bool isFluxDensity;
+ Quantum<AccumType> qFlux = _flux(
+ isFluxDensity, sum, hasBeam ? *(beamArea.begin()) : 0
+ );
+ AccumType val = qFlux.getValue();
+ String unit = qFlux.getFullUnit().getName();
+ oss << " -- flux" << (isFluxDensity ? " density" : "")
+ << " [flux]:" << (isFluxDensity ? "" : " ")
+ << " " << val << " " << unit;
+ messages.push_back(oss.str());
+ oss.str("");
}
-
if (LattStatsSpecialize::hasSomePoints(nPts)) {
oss << " -- number of points [npts]: " << nPts;
messages.push_back(oss.str());
@@ -603,30 +567,105 @@
}
}

-template <class T> Quantum<typename
casacore::NumericTraits<T>::PrecisionType> ImageStatistics<T>::_flux(
- AccumType sum, Double beamAreaInPixels
+template <class T> Quantum<typename ImageStatistics<T>::AccumType>
ImageStatistics<T>::_flux(
+ Bool& isFluxDensity, AccumType sum, Double beamAreaInPixels
) const {
ThrowIf(
! _canDoFlux(),
"This object cannot be used to determine flux densities"
);
- AccumType flux = 0;
- String fUnit;
+ isFluxDensity = True;
+ Quantum<AccumType> flux(0, "");
String sbunit = pInImage_p->units().getName();
+ Bool intensityBeamBased = False;
if (sbunit.contains("K")) {
String areaUnit = "arcsec2";
- fUnit = sbunit + "." + areaUnit;
- flux = sum *
pInImage_p->coordinates().directionCoordinate().getPixelArea().getValue(areaUnit);
+ flux.setUnit(sbunit + "." + areaUnit);
+ flux.setValue(
+ sum *
pInImage_p->coordinates().directionCoordinate().getPixelArea().getValue(areaUnit)
+ );
}
else {
- fUnit = "Jy";
+ flux.setUnit("Jy");
if (sbunit.contains("/beam")) {
+ intensityBeamBased = True;
uInt iBeam = sbunit.find("/beam");
- flux = sum/beamAreaInPixels;
- fUnit = sbunit.substr(0, iBeam) + sbunit.substr(iBeam+5);
+ if (beamAreaInPixels > 0) {
+ flux.setValue(sum/beamAreaInPixels);
+ }
+ flux.setUnit(sbunit.substr(0, iBeam) + sbunit.substr(iBeam+5));
}
}
- return Quantum<AccumType>(flux, fUnit);
+ if (pInImage_p->coordinates().hasSpectralAxis()) {
+
+ Int specAxis = pInImage_p->coordinates().spectralAxisNumber(False);
+ Vector<Int>::const_iterator myend = cursorAxes_p.end();
+ if (
+ pInImage_p->shape()[specAxis] > 1
+ && std::find(cursorAxes_p.begin(), myend, specAxis) != myend
+ ) {
+ // integrate over nondegenerate spectral axis
+ if (intensityBeamBased && pInImage_p->imageInfo().hasMultipleBeams()) {
+ // the resolution varies by channel, so the previously computed
+ // value based on the passed in sum is bogus because the beam area
+ // varies
+ vector<Int> newCursorAxes = cursorAxes_p.tovector();
+ newCursorAxes.erase(
+ std::find(newCursorAxes.begin(), newCursorAxes.end(), specAxis)
+ );
+ ImageStatistics<T> newStats(*this);
+ newStats.setAxes(Vector<Int>(newCursorAxes));
+ Array<AccumType> fluxDensities;
+ newStats.getStatistic(fluxDensities, LatticeStatsBase::FLUX);
+ flux.setValue(casa::sum(fluxDensities));
+ }
+ const SpectralCoordinate& spCoord =
pInImage_p->coordinates().spectralCoordinate();
+ Quantity inc(0, "");
+ if (spCoord.restFrequency() > 0) {
+ Double v0, v1;
+ if (
+ spCoord.pixelToVelocity(v0, 0)
+ && spCoord.pixelToVelocity(v1, 1)
+ ) {
+ inc = Quantity(abs(v1 - v0), spCoord.velocityUnit());
+ }
+ }
+ else {
+ inc = Quantity(spCoord.increment()[0], spCoord.worldAxisUnits()[0]);
+ }
+ flux.setValue(flux.getValue()*inc.getValue());
+ Quantity q1(1, flux.getUnit());
+ Quantity q2(1, inc.getUnit());
+ flux.setUnit((q1*q2).getUnit());
+ isFluxDensity = False;
+ }
+ }
+ if (isFluxDensity) {
+ // the brightness unit may already imply this
+ // image has been integrated over a spectral
+ // range, such as the case for moment images
+ UnitVal u = flux.getFullUnit().getValue();
+ std::vector<UnitVal> fluxDensityUnits(2);
+ fluxDensityUnits[0] = UnitVal(1, "Jy");
+ fluxDensityUnits[1] = UnitVal(1, "K*arcsec2");
+ std::vector<UnitVal> spectralUnits(2);
+ spectralUnits[0] = UnitVal(1, "km/s");
+ spectralUnits[1] = UnitVal(1, "Hz");
+ std::vector<UnitVal>::const_iterator fiter = fluxDensityUnits.begin();
+ std::vector<UnitVal>::const_iterator fend = fluxDensityUnits.end();
+ std::vector<UnitVal>::const_iterator send = spectralUnits.end();
+ while (isFluxDensity && fiter != fend) {
+ std::vector<UnitVal>::const_iterator siter = spectralUnits.begin();
+ while (isFluxDensity && siter != send) {
+ if (u == (*fiter) * (*siter)) {
+ isFluxDensity = False;
+ }
+ ++siter;
+ }
+ ++fiter;
+ }
+ }
+ return flux;
}

template <class T> Bool ImageStatistics<T>::_computeFlux(
@@ -638,7 +677,7 @@
if (! gotBeamArea) {
String unit = pInImage_p->units().getName();
unit.downcase();
- if (unit.contains("/beam")) {
+ if (unit.contains("/beam") && !
pInImage_p->imageInfo().hasMultipleBeams()) {
os_p << LogIO::WARN << "Unable to compute flux density: "
<< msg << LogIO::POST;
return False;
@@ -654,8 +693,9 @@
while (!nPtsIt.pastEnd()) {
for (uInt i=0; i<n1; ++i) {
if (nPtsIt.vector()(i) > 0.5) {
+ Bool isFluxDensity;
fluxIt.vector()(i) = _flux(
- sumIt.vector()(i), gotBeamArea ? beamAreaIter->vector()(i) : 0
+ isFluxDensity, sumIt.vector()(i), gotBeamArea ?
beamAreaIter->vector()(i) : 0
).getValue();
}
}
@@ -670,17 +710,18 @@
}

template <class T> Bool ImageStatistics<T>::_computeFlux(
- AccumType& flux, AccumType sum, const IPosition& pos,
+ Quantum<AccumType>& flux, AccumType sum, const IPosition& pos,
Bool posInLattice
) {
Array<Double> beamArea;
String msg;
+ Bool unused;
if (_getBeamArea(beamArea, msg)) {
IPosition beamPos = pos;
if (posInLattice) {
this->_latticePosToStoragePos(beamPos, pos);
}
- flux = _flux(sum, beamArea(beamPos)).getValue();
+ flux = _flux(unused, sum, beamArea(beamPos)).getValue();
}
else {
String unit = pInImage_p->units().getName();
@@ -688,18 +729,75 @@
if (unit.contains("/beam")) {
return False;
}
- flux = _flux(sum, 0).getValue();
+ flux = _flux(unused, sum, 0).getValue();
}
return True;
}

template <class T> Bool ImageStatistics<T>::_canDoFlux() const {
+ const CoordinateSystem& csys = pInImage_p->coordinates();
+ if (! csys.hasDirectionCoordinate()) {
+ return False;
+ }
String unit = pInImage_p->units().getName();
- return unit.contains("K")
+ Bool unitOK = unit.contains("K")
|| (
pInImage_p->imageInfo().hasBeam()
&& unit.contains("/beam")
);
+ if (! unitOK) {
+ return False;
+ }
+ Bool cursorHasDirection = False;
+ Vector<Int> dirAxesNumbers = csys.directionAxesNumbers();
+ Vector<Int>::const_iterator dIter = dirAxesNumbers.begin();
+ Vector<Int>::const_iterator dEnd = dirAxesNumbers.end();
+ Vector<Int>::const_iterator curBegin = cursorAxes_p.begin();
+ Vector<Int>::const_iterator curEnd = cursorAxes_p.end();
+ while (dIter != dEnd) {
+ if(
+ std::find(curBegin, curEnd, *dIter) != curEnd
+ ) {
+ cursorHasDirection = True;
+ break;
+ }
+ ++dIter;
+ }
+ if (! cursorHasDirection) {
+ return False;
+ }
+ std::set<Int> okCursorAxes;
+ okCursorAxes.insert(dirAxesNumbers.begin(), dirAxesNumbers.end());
+ IPosition shape = pInImage_p->shape();
+ if (csys.hasSpectralAxis()) {
+ Int specAxis = csys.spectralAxisNumber(False);
+ if (
+ shape[specAxis] > 1
+ && std::find(curBegin, curEnd, specAxis) != curEnd
+ && csys.spectralCoordinate().isTabular()
+ ) {
+ // spectral axis is tabular,
+ // spectral axis is nondegenerate and a cursor axis
+ // FIXME the tabular constraints can
+ // be removed, but that will take a bit of work
+ return False;
+ }
+ okCursorAxes.insert(specAxis);
+ }
+ Vector<Int>::const_iterator curIter = curBegin;
+ while (curIter != curEnd) {
+ if (
+ shape[*curIter] > 1
+ && std::find(okCursorAxes.begin(), okCursorAxes.end(), *curIter)
+ == okCursorAxes.end()
+ ) {
+ // There is a cursor axis that is nondegenerate and is neither
+ // a spectral nor a direction axis
+ return False;
+ }
+ ++curIter;
+ }
+ return True;
}

template <class T>
@@ -757,7 +855,6 @@
hLabel = String(oss);
}
}
-

template <class T>
void ImageStatistics<T>::listMinMax(ostringstream& osMin,
@@ -790,8 +887,6 @@
}
}

-
-} //# NAMESPACE CASACORE - END
-
+}

#endif
=======================================
--- /branches/nov14/images/Images/test/tImageStatistics.cc Wed Mar 18
15:01:43 2015 UTC
+++ /branches/nov14/images/Images/test/tImageStatistics.cc Wed Mar 25
13:46:25 2015 UTC
@@ -141,8 +141,6 @@
else {
AlwaysAssert(allTrue(myStats == exp), AipsError);
}
-
-
}
}
}
@@ -170,7 +168,7 @@
AlwaysAssert(
stats.getConvertedStatistic (flux, LatticeStatsBase::FLUX), AipsError
);
- AlwaysAssert(near(*flux.begin(), 529348.9), AipsError);
+ AlwaysAssert(near(*flux.begin(), 111724.9893), AipsError);
Vector<Int> axes(2, 0);
axes[1] = 1;
stats.setAxes(axes);
@@ -195,7 +193,7 @@
AlwaysAssert(
stats.getConvertedStatistic (flux, LatticeStatsBase::FLUX), AipsError
);
- AlwaysAssert(near(*flux.begin(), 1.61946e10), AipsError);
+ AlwaysAssert(near(*flux.begin(), 3.4180507464507e9), AipsError);
axes = Vector<Int>(2, 0);
axes[1] = 1;
stats.setAxes(axes);
@@ -213,11 +211,45 @@
);
AlwaysAssert(near(statVals[LatticeStatsBase::FLUX], expFlux),
AipsError);
}
+ Vector<GaussianBeam> beams(20);
+ Vector<GaussianBeam>::iterator bIter = beams.begin();
+ Vector<GaussianBeam>::iterator bEnd = beams.end();
+ uInt count = 0;
+ while (bIter != bEnd) {
+ *bIter = GaussianBeam(
+ Quantity(3 + count, "arcmin"),
+ Quantity(2.5, "arcmin"),
+ Quantity(30, "deg")
+ );
+ ++count;
+ ++bIter;
+ }
+ ImageBeamSet beamSet(beams);
+ ImageInfo ii = tim.imageInfo();
+ ii.setBeams(beamSet);
+ tim.setUnits("Jy/beam");
+ tim.setImageInfo(ii);
+ stats = ImageStatistics<Float> (tim);
+ stats.setAxes(indgen(2, 0, 1));
+ Array<Float> fluxDensities;
+ AlwaysAssert(
+ stats.getConvertedStatistic (
+ fluxDensities, LatticeStatsBase::FLUX
+ ), AipsError
+ );
+ cout << "flux densities " << fluxDensities << endl;
+ // 0.2110611 is channel width in km/s
+ Double expected = sum(fluxDensities) * 0.2110611;
+ stats.setAxes(Vector<Int>());
+ AlwaysAssert(
+ stats.getConvertedStatistic(flux, LatticeStatsBase::FLUX),
+ AipsError
+ );
+ AlwaysAssert(near(*flux.begin(), expected), AipsError);
}
cout << "ok" << endl;
}
- catch (AipsError x) {
-
+ catch (const AipsError& x) {
cerr << "Exception caught: " << x.getMesg() << endl;
return 1;
}
=======================================
--- /branches/nov14/lattices/LatticeMath/LatticeStatistics.h Wed Mar 18
15:01:43 2015 UTC
+++ /branches/nov14/lattices/LatticeMath/LatticeStatistics.h Wed Mar 25
13:46:25 2015 UTC
@@ -288,6 +288,7 @@
// indicates an invalid plotting device, or that the internal state of the
class is bad.

Bool display();
+
Bool getLayerStats(String& stats, Double area,
Int zAxis=-1, Int zLayer=-1,
Int hAxis=-1, Int hLayer=-1);
@@ -423,7 +424,8 @@
// more time than I have atm. A return value of False means that the
object in
// question cannot compute flux density values. The default
implementation returns False.
virtual Bool _canDoFlux() const { return False; }
- virtual Quantum<AccumType> _flux(AccumType, Double) const {
+
+ virtual Quantum<AccumType> _flux(Bool&, AccumType, Double) const {
ThrowCc("Logic Error: This object cannot compute flux density");
}

@@ -449,13 +451,13 @@
virtual Bool listLayerStats (
const Matrix<AccumType>& ord,
ostringstream& rslt, Int zLayer);
-
+/*
// Gets labels for higher order axes and x axis.
// dPos is the location of the start of the cursor in the
// storage image for this row.
virtual void getLabels(String& higherOrderLabel, String& xAxisLabel,
const IPosition& dPos) const;
-
+*/
// Given a location in the storage lattice, convert those locations on the
// non-statistics axis (the last one) and optionally account for the
// lattice subsectioning
@@ -475,7 +477,7 @@
);

virtual Bool _computeFlux(
- AccumType& flux, AccumType sum, const IPosition& pos,
+ Quantum<AccumType>& flux, AccumType sum, const IPosition& pos,
Bool posInLattice
);

=======================================
--- /branches/nov14/lattices/LatticeMath/LatticeStatistics.tcc Wed Mar 18
15:01:43 2015 UTC
+++ /branches/nov14/lattices/LatticeMath/LatticeStatistics.tcc Wed Mar 25
13:46:25 2015 UTC
@@ -512,9 +512,11 @@
stats(RMS) = LattStatsSpecialize::getRms(stats(SUMSQ), n);
stats(FLUX) = 0;
if (_canDoFlux()) {
- if (! _computeFlux(stats(FLUX), stats(SUM), pos, posInLattice)) {
+ Quantum<AccumType> q;
+ if (! _computeFlux(q, stats(SUM), pos, posInLattice)) {
return False;
}
+ stats(FLUX) = q.getValue();
}
return True;
}
@@ -541,7 +543,6 @@
}
return True;
}
-

template <class T>
Bool LatticeStatistics<T>::getFullMinMax(T& dataMin, T& dataMax)
@@ -572,7 +573,7 @@

template <class T>
Bool LatticeStatistics<T>::_computeFlux(
- AccumType&, AccumType, const IPosition&,
+ Quantum<AccumType>&, AccumType, const IPosition&,
Bool
) {
ThrowCc("This object does not support computing fluxes");
@@ -1390,9 +1391,10 @@
os << setw(oDWidth)
<< sum;
if (_canDoFlux()) {
+ Bool unused;
setStream(os, oPrec);
os << setw(oDWidth)
- << _flux(sum, area);
+ << _flux(unused, sum, area);
}
setStream(os, oPrec);
os << setw(oDWidth)
@@ -1472,14 +1474,16 @@
layer = zLayer;
}

- Matrix<AccumType> matrix(pixelIterator.matrixCursor());
+ Matrix<AccumType> matrix(pixelIterator.matrixCursor());
+ Bool canDoFlux = _canDoFlux();
+ Bool unused;
for (uInt i=0; i<n1; i++) {
const AccumType& nPts = matrix(i,NPTS);
if (LattStatsSpecialize::hasSomePoints(nPts)) {
ord(i,MEAN) =
LattStatsSpecialize::getMean(matrix(i,SUM), nPts);
- if (_canDoFlux()) {
- ord(i,FLUX) = _flux(matrix(i,SUM), area).getValue();
+ if (canDoFlux) {
+ ord(i,FLUX) = _flux(unused, matrix(i,SUM), area).getValue();
}
ord(i,SIGMA) = LattStatsSpecialize::getSigma(
matrix(i,VARIANCE));
@@ -1569,9 +1573,9 @@
sprintf( buffer, "%e", sum );
stats.push_back(stat_element("Sum",buffer));

-
if ( _canDoFlux()) {
- sprintf( buffer, "%e", _flux(sum, area ).getValue());
+ Bool unused;
+ sprintf( buffer, "%e", _flux(unused, sum, area ).getValue());
stats.push_back(stat_element("FluxDensity",buffer));
}

@@ -1648,12 +1652,13 @@


Matrix<AccumType> matrix(pixelIterator.matrixCursor());
+ Bool unused;
for (uInt i=0; i<n1; i++) {
const AccumType& nPts = matrix(i,NPTS);
if (LattStatsSpecialize::hasSomePoints(nPts)) {
ord(i,MEAN) = LattStatsSpecialize::getMean(matrix(i,SUM), nPts);
if (_canDoFlux()) {
- ord(i,FLUX) = _flux(matrix(i,SUM), area).getValue();
+ ord(i,FLUX) = _flux(unused, matrix(i,SUM), area).getValue();
}
//ord(i,VARIANCE) = LattStatsSpecialize::getVariance( matrix(i,SUM),
matrix(i,SUMSQ), nPts);
ord(i,SIGMA) = LattStatsSpecialize::getSigma(matrix(i,VARIANCE));
@@ -1727,7 +1732,6 @@
}
return True;
}
-

template <class T>
Bool LatticeStatistics<T>::listLayerStats (
@@ -1994,7 +1998,7 @@
}

// virtual functions
-
+/*
template <class T>
void LatticeStatistics<T>::getLabels(String& hLabel, String& xLabel, const
IPosition& dPos) const
//
@@ -2018,7 +2022,7 @@
hLabel = String(oss);
}
}
-
+*/
template <class T>
Bool LatticeStatistics<T>::retrieveStorageStatistic(Array<AccumType>&
slice,
const
LatticeStatsBase::StatisticsTypes type,
=======================================
--- /branches/nov14/ms/MeasurementSets/MSMetaData.cc Wed Mar 18 15:01:43
2015 UTC
+++ /branches/nov14/ms/MeasurementSets/MSMetaData.cc Wed Mar 25 13:46:25
2015 UTC
@@ -49,19 +49,18 @@
_scanToSpwsMap(),
_scanToDDIDsMap(),
_dataDescIDToSpwMap(),
- _dataDescIDToPolIDMap(), /*_scanToNRowsMap(),*/
+ _dataDescIDToPolIDMap(),
_fieldToSpwMap(),
_scanToStatesMap(), _scanToFieldsMap(),
_fieldToStatesMap(), _stateToFieldsMap(),
_sourceToFieldsMap(),
- // _arrayToScansMap(),
_antennaNameToIDMap(),
_intentToFieldIDMap(),
_intentToScansMap(),
_scanToTimeRangeMap(),
_scanSpwToIntervalMap(),
_uniqueIntents(),
- /*_uniqueScanNumbers(), */ _uniqueFieldIDs(), _uniqueStateIDs(),
+ _uniqueFieldIDs(), _uniqueStateIDs(),
_avgSpw(), _tdmSpw(),
_fdmSpw(), _wvrSpw(), _sqldSpw(), _antenna1(), _antenna2(),
_scans(), _fieldIDs(), _stateIDs(), _dataDescIDs(),
@@ -73,7 +72,6 @@
_spwInfo(0),
_spwToFieldIDsMap(), _obsToArraysMap(), _spwToScansMap(),
_fieldToScansMap(),
-
_fieldNames(0),
_antennaNames(0), _observatoryNames(0),
_times(),
@@ -699,6 +697,21 @@
_intentToScansMap = intentToScansMap;
}
}
+
+uInt MSMetaData::_sizeof(
+ const std::map<Double, MSMetaData::TimeStampProperties> & m
+) {
+ uInt sizeInt = sizeof(Int);
+ uInt size = m.size()*(sizeof(Double) + sizeInt);
+ std::map<Double, MSMetaData::TimeStampProperties>::const_iterator iter =
m.begin();
+ std::map<Double, MSMetaData::TimeStampProperties>::const_iterator end =
m.end();
+ uInt n = 0;
+ while (iter != end) {
+ n += iter->second.ddIDs.size();
+ ++iter;
+ }
+ return size + n*sizeInt;
+}

template <class T>
uInt MSMetaData::_sizeof(const std::map<T, std::set<String> >& m) {
@@ -1426,15 +1439,15 @@
return _subscans;
}
std::set<SubScanKey> mysubscans;
- Vector<Int> scans = *_getScans();
- Vector<Int> fields = *_getFieldIDs();
- Vector<Int> arrays = *_getArrayIDs();
- Vector<Int> obs = *_getObservationIDs();
- Vector<Int>::const_iterator scanIter = scans.begin();
- Vector<Int>::const_iterator scanEnd = scans.end();
- Vector<Int>::const_iterator fIter = fields.begin();
- Vector<Int>::const_iterator oIter = obs.begin();
- Vector<Int>::const_iterator aIter = arrays.begin();
+ CountedPtr<Vector<Int> > scans = _getScans();
+ CountedPtr<Vector<Int> > fields = _getFieldIDs();
+ CountedPtr<Vector<Int> > arrays = _getArrayIDs();
+ CountedPtr<Vector<Int> > obs = _getObservationIDs();
+ Vector<Int>::const_iterator scanIter = scans->begin();
+ Vector<Int>::const_iterator scanEnd = scans->end();
+ Vector<Int>::const_iterator fIter = fields->begin();
+ Vector<Int>::const_iterator oIter = obs->begin();
+ Vector<Int>::const_iterator aIter = arrays->begin();
SubScanKey subScanKey;
while (scanIter != scanEnd) {
subScanKey.obsID = *oIter;
@@ -1775,15 +1788,15 @@
if (_scanToTimesMap && ! _scanToTimesMap->empty()) {
return _scanToTimesMap;
}
- Vector<Int> scans = *_getScans();
- Vector<Int> obsIDs = *_getObservationIDs();
- Vector<Int> arrayIDs = *_getArrayIDs();
- Vector<Int>::const_iterator curScan = scans.begin();
- Vector<Int>::const_iterator lastScan = scans.end();
- Vector<Double> times = *_getTimes();
- Vector<Double>::const_iterator curTime = times.begin();
- Vector<Int>::const_iterator curObs = obsIDs.begin();
- Vector<Int>::const_iterator curArray = arrayIDs.begin();
+ CountedPtr<Vector<Int> > scans = _getScans();
+ CountedPtr<Vector<Int> > obsIDs = _getObservationIDs();
+ CountedPtr<Vector<Int> > arrayIDs = _getArrayIDs();
+ Vector<Int>::const_iterator curScan = scans->begin();
+ Vector<Int>::const_iterator lastScan = scans->end();
+ CountedPtr<Vector<Double> > times = _getTimes();
+ Vector<Double>::const_iterator curTime = times->begin();
+ Vector<Int>::const_iterator curObs = obsIDs->begin();
+ Vector<Int>::const_iterator curArray = arrayIDs->begin();
CountedPtr<std::map<ScanKey, std::set<Double> > > scanToTimesMap(
new std::map<ScanKey, std::set<Double> >()
);
@@ -1817,6 +1830,38 @@
}
return times;
}
+
+/*
+CountedPtr<std::map<Double, MSMetaData::TimeStampProperties> >
MSMetaData::_getTimeStampProperties() const {
+ if (_timeStampPropsMap) {
+ return _timeStampPropsMap;
+ }
+ CountedPtr<Vector<Double> > times = _getTimes();
+ CountedPtr<Vector<Int> > ddids = _getDataDescIDs();
+ CountedPtr<std::map<Double, TimeStampProperties> > mymap(
+ new std::map<Double, TimeStampProperties>()
+ );
+ Vector<Double>::const_iterator titer = times->begin();
+ Vector<Double>::const_iterator tend = times->end();
+ Vector<Int>::const_iterator diter = ddids->begin();
+ while (titer != tend) {
+ if (mymap->find(*titer) == mymap->end()) {
+ (*mymap)[*titer].nrows = 1;
+ }
+ else {
+ ++((*mymap)[*titer].nrows);
+ }
+ (*mymap)[*titer].ddIDs.insert(*diter);
+ ++titer;
+ ++diter;
+ }
+ if (_cacheUpdated(_sizeof(*mymap))) {
+ _timeStampPropsMap = mymap;
+ }
+ return mymap;
+}
+*/
+

CountedPtr<Quantum<Vector<Double> > > MSMetaData::_getExposureTimes() {
if (_exposures && ! _exposures->getValue().empty()) {
@@ -1857,8 +1902,8 @@
) const {
std::set<Double> times;
if (scans.empty()) {
- Vector<Double> allTimes = *_getTimes();
- times.insert(allTimes.begin(), allTimes.end());
+ CountedPtr<Vector<Double> > allTimes = _getTimes();
+ times.insert(allTimes->begin(), allTimes->end());
return times;
}
CountedPtr<std::map<ScanKey, std::set<Double> > > scanToTimesMap =
_getScanToTimesMap();
@@ -1897,19 +1942,19 @@
return;
}
scanToTimeRangeMap.clear();
- Vector<Int> obsIDs = *_getObservationIDs();
- Vector<Int>::const_iterator oIter = obsIDs.begin();
- Vector<Int> arrayIDs = *_getArrayIDs();
- Vector<Int>::const_iterator aIter = arrayIDs.begin();
+ CountedPtr<Vector<Int> > obsIDs = _getObservationIDs();
+ Vector<Int>::const_iterator oIter = obsIDs->begin();
+ CountedPtr<Vector<Int> > arrayIDs = _getArrayIDs();
+ Vector<Int>::const_iterator aIter = arrayIDs->begin();
CountedPtr<Vector<Int> > scans = _getScans();
Vector<Int>::const_iterator sIter = scans->begin();
Vector<Int>::const_iterator sEnd = scans->end();

CountedPtr<Vector<Int> > dataDescIDs = _getDataDescIDs();
Vector<Int>::const_iterator dIter = dataDescIDs->begin();
- Vector<Double> times = *_getTimes();
+ CountedPtr<Vector<Double> > times = _getTimes();

- Vector<Double>::const_iterator tIter = times.begin();
+ Vector<Double>::const_iterator tIter = times->begin();
String intervalColName =
MeasurementSet::columnName(MSMainEnums::INTERVAL);
Vector<Double> intervals = ScalarColumn<Double>(*_ms,
intervalColName).getColumn();
Vector<Double>::const_iterator iIter = intervals.begin();
@@ -2250,59 +2295,98 @@
while (oIter != oEnd) {
std::set<Int>::const_iterator aIter = oIter->begin();
std::set<Int>::const_iterator aEnd = oIter->end();
- Record aRec;
+ Record obsRec;
while (aIter != aEnd) {
- Record scanRec;
+ Record arrayRec;
ArrayKey aKey;
aKey.obsID = oCount;
aKey.arrayID = *aIter;
- std::set<ScanKey> scanKeys = _getScanKeys(aKey);
- std::set<ScanKey>::const_iterator scanIter = scanKeys.begin();
- std::set<ScanKey>::const_iterator scanEnd = scanKeys.end();
- while(scanIter != scanEnd) {
- ScanKey scanKey = *scanIter;
- std::set<Int> antennasForScan;
- uInt scanNRows = 0;
- Record scanSubRec;
- std::set<SubScanKey> subScans = _getSubScanKeys(scanKey);
- uInt subScanCount = 0;
- std::set<SubScanKey>::const_iterator subScanIter = subScans.begin();
- std::set<SubScanKey>::const_iterator subScanEnd = subScans.end();
- Record subScanRec;
- while (subScanIter != subScanEnd) {
- SubScanProperties props = subScanProps[*subScanIter];
- subScanRec.define("data description IDs",
Vector<Int>(props.ddIDs.begin(), props.ddIDs.size(), 0));
- subScanRec.define("nrows", props.nrows);
- scanNRows += props.nrows;
- subScanRec.define("antennas", Vector<Int>(props.antennas.begin(),
props.antennas.size(), 0));
- antennasForScan.insert(props.antennas.begin(), props.antennas.end());
- subScanRec.define("begin time", props.beginTime);
- subScanRec.define("end time", props.endTime);
- subScanRec.define("state IDs", Vector<Int>(props.stateIDs.begin(),
props.stateIDs.size(), 0));
- subScanRec.define("field ID", subScanIter->fieldID);
-
scanSubRec.defineRecord(String::toString(subScanCount), subScanRec);
- ++subScanCount;
- ++subScanIter;
- }
- scanSubRec.define("nrows", scanNRows);
- scanSubRec.define("antennas", Vector<Int>(antennasForScan.begin(),
antennasForScan.size(), 0));
- scanRec.defineRecord("scan=" + String::toString(scanKey.scan),
scanSubRec);
- ++scanIter;
- }
- aRec.defineRecord("arrayID=" + String::toString(*aIter), scanRec);
+ _createScanRecords(
+ arrayRec, aKey, subScanProps
+ );
+ obsRec.defineRecord("arrayID=" + String::toString(*aIter), arrayRec);
++aIter;
}
- summary.defineRecord("observationID=" + String::toString(oCount), aRec);
+ summary.defineRecord("observationID=" + String::toString(oCount),
obsRec);
++oIter;
++oCount;
}
summary.define("nrows", nRows());
- Vector<Double> times = *_getTimes();
- summary.define("begin time", min(times));
- summary.define("end time", max(times));
+ CountedPtr<Vector<Double> > times = _getTimes();
+ summary.define("begin time", min(*times));
+ summary.define("end time", max(*times));
return summary;
}

+void MSMetaData::_createScanRecords(
+ Record& parent, const ArrayKey& arrayKey,
+ const std::map<SubScanKey, SubScanProperties>& subScanProps
+) const {
+ std::set<ScanKey> scanKeys = _getScanKeys(arrayKey);
+ std::set<ScanKey>::const_iterator scanIter = scanKeys.begin();
+ std::set<ScanKey>::const_iterator scanEnd = scanKeys.end();
+ while(scanIter != scanEnd) {
+ ScanKey scanKey = *scanIter;
+ std::set<Int> antennasForScan;
+ uInt scanNRows = 0;
+ Record scanRec;
+ _createSubScanRecords(
+ scanRec, scanNRows, antennasForScan,
+ scanKey, subScanProps
+ );
+ scanRec.define("nrows", scanNRows);
+ scanRec.define("antennas", Vector<Int>(antennasForScan.begin(),
antennasForScan.size(), 0));
+ parent.defineRecord("scan=" + String::toString(scanKey.scan), scanRec);
+ ++scanIter;
+ }
+}
+
+void MSMetaData::_createSubScanRecords(
+ Record& parent, uInt& scanNRows, std::set<Int>& antennasForScan,
+ const ScanKey& scanKey, const std::map<SubScanKey, SubScanProperties>&
subScanProps
+) const {
+ std::set<SubScanKey> subScans = _getSubScanKeys(scanKey);
+ std::set<SubScanKey>::const_iterator subScanIter = subScans.begin();
+ std::set<SubScanKey>::const_iterator subScanEnd = subScans.end();
+ uInt subScanCount = 0;
+ while (subScanIter != subScanEnd) {
+ Record subScanRec;
+ SubScanProperties props = subScanProps.find(*subScanIter)->second;
+ subScanRec.define("data description IDs",
Vector<Int>(props.ddIDs.begin(), props.ddIDs.size(), 0));
+ subScanRec.define("nrows", props.nrows);
+ scanNRows += props.nrows;
+ subScanRec.define("antennas", Vector<Int>(props.antennas.begin(),
props.antennas.size(), 0));
+ antennasForScan.insert(props.antennas.begin(), props.antennas.end());
+ subScanRec.define("begin time", props.beginTime);
+ subScanRec.define("end time", props.endTime);
+ subScanRec.define("state IDs", Vector<Int>(props.stateIDs.begin(),
props.stateIDs.size(), 0));
+ //subScanRec.define("field ID", subScanIter->fieldID);
+ _createTimeStampRecords(subScanRec, props);
+ parent.defineRecord("fieldID=" + String::toString(subScanIter->fieldID),
subScanRec);
+ ++subScanCount;
+ ++subScanIter;
+ }
+}
+
+void MSMetaData::_createTimeStampRecords(
+ Record& parent, const SubScanProperties& subScanProps
+) {
+ std::map<Double, TimeStampProperties>::const_iterator tpIter =
subScanProps.timeProps.begin();
+ std::map<Double, TimeStampProperties>::const_iterator tpEnd =
subScanProps.timeProps.end();
+ uInt timeCount = 0;
+ while (tpIter != tpEnd) {
+ Record timeRec;
+ timeRec.define(
+ "data description IDs",
+ Vector<Int>(tpIter->second.ddIDs.begin(), tpIter->second.ddIDs.size(),
0)
+ );
+ timeRec.define("nrows", tpIter->second.nrows);
+ timeRec.define("time", tpIter->first);
+ parent.defineRecord(String::toString(timeCount), timeRec);
+ ++tpIter;
+ ++timeCount;
+ }
+}

std::set<Double> MSMetaData::getTimesForIntent(const String& intent) const
{
if (! _hasIntent(intent)) {
@@ -2316,7 +2400,6 @@
return mymap[intent];
}
}
-

Bool MSMetaData::hasBBCNo() const {
return _ms->spectralWindow().isColumn(MSSpectralWindowEnums::BBC_NO);
@@ -2425,11 +2508,11 @@
if (! _obsToArraysMap.empty()) {
return _obsToArraysMap;
}
- Vector<Int> obsIDs = *_getObservationIDs();
- Vector<Int> arrayIDs = *_getArrayIDs();
- Vector<Int>::const_iterator oIter = obsIDs.begin();
- Vector<Int>::const_iterator oEnd = obsIDs.end();
- Vector<Int>::const_iterator aIter = arrayIDs.begin();
+ CountedPtr<Vector<Int> > obsIDs = _getObservationIDs();
+ CountedPtr<Vector<Int> > arrayIDs = _getArrayIDs();
+ Vector<Int>::const_iterator oIter = obsIDs->begin();
+ Vector<Int>::const_iterator oEnd = obsIDs->end();
+ Vector<Int>::const_iterator aIter = arrayIDs->begin();
vector<std::set<Int> > mymap(nObservations());
while (oIter != oEnd) {
mymap[*oIter].insert(*aIter);
@@ -2826,25 +2909,25 @@
if (! _subScanProperties.empty()) {
return _subScanProperties;
}
- Vector<Int> scans = *_getScans();
- Vector<Int> fields = *_getFieldIDs();
- Vector<Int> ddIDs = *_getDataDescIDs();
- Vector<Int> states = *_getStateIDs();
- Vector<Double> times = *_getTimes();
- Vector<Int> arrays = *_getArrayIDs();
- Vector<Int> observations = *_getObservationIDs();
+ CountedPtr<Vector<Int> > scans = _getScans();
+ CountedPtr<Vector<Int> > fields = _getFieldIDs();
+ CountedPtr<Vector<Int> > ddIDs = _getDataDescIDs();
+ CountedPtr<Vector<Int> > states = _getStateIDs();
+ CountedPtr<Vector<Double> > times = _getTimes();
+ CountedPtr<Vector<Int> > arrays = _getArrayIDs();
+ CountedPtr<Vector<Int> > observations = _getObservationIDs();
CountedPtr<Vector<Int> > ant1, ant2;
_getAntennas(ant1, ant2);
- Vector<Int>::const_iterator scanIter = scans.begin();
- Vector<Int>::const_iterator scanEnd = scans.end();
+ Vector<Int>::const_iterator scanIter = scans->begin();
+ Vector<Int>::const_iterator scanEnd = scans->end();
Vector<Int>::const_iterator a1Iter = ant1->begin();
Vector<Int>::const_iterator a2Iter = ant2->begin();
- Vector<Int>::const_iterator fIter = fields.begin();
- Vector<Int>::const_iterator dIter = ddIDs.begin();
- Vector<Int>::const_iterator stateIter = states.begin();
- Vector<Int>::const_iterator oIter = observations.begin();
- Vector<Int>::const_iterator arIter = arrays.begin();
- Vector<Double>::const_iterator tIter = times.begin();
+ Vector<Int>::const_iterator fIter = fields->begin();
+ Vector<Int>::const_iterator dIter = ddIDs->begin();
+ Vector<Int>::const_iterator stateIter = states->begin();
+ Vector<Int>::const_iterator oIter = observations->begin();
+ Vector<Int>::const_iterator arIter = arrays->begin();
+ Vector<Double>::const_iterator tIter = times->begin();
std::map<SubScanKey, SubScanProperties> mysubscans;
SubScanKey subScanKey;
while (scanIter != scanEnd) {
@@ -2870,6 +2953,13 @@
mysubscans[subScanKey].antennas.insert(*a2Iter);
mysubscans[subScanKey].ddIDs.insert(*dIter);
mysubscans[subScanKey].stateIDs.insert(*stateIter);
+ if (mysubscans[subScanKey].timeProps.find(*tIter) ==
mysubscans[subScanKey].timeProps.end()) {
+ mysubscans[subScanKey].timeProps[*tIter].nrows = 1;
+ }
+ else {
+ ++(mysubscans[subScanKey].timeProps[*tIter].nrows);
+ }
+ mysubscans[subScanKey].timeProps[*tIter].ddIDs.insert(*dIter);
++tIter;
++scanIter;
++fIter;
@@ -2887,6 +2977,7 @@
uInt mapSize = mysubscans.size() * (structSize + keySize);
while (mIter != mEnd) {
mapSize += sizeof(Int)*(mIter->second.ddIDs.size() +
mIter->second.stateIDs.size());
+ mapSize += (sizeof(Double) + sizeof(Int)) +
mIter->second.timeProps.size();
++mIter;
}
if (_cacheUpdated(mapSize)) {
=======================================
--- /branches/nov14/ms/MeasurementSets/MSMetaData.h Wed Mar 18 15:01:43
2015 UTC
+++ /branches/nov14/ms/MeasurementSets/MSMetaData.h Wed Mar 25 13:46:25
2015 UTC
@@ -402,6 +402,11 @@
String name;
};

+ struct TimeStampProperties {
+ std::set<Int> ddIDs;
+ uInt nrows;
+ };
+
struct SubScanProperties {
std::set<Int> antennas;
Double beginTime;
@@ -409,6 +414,7 @@
Double endTime;
uInt nrows;
std::set<Int> stateIDs;
+ std::map<Double, TimeStampProperties> timeProps;
};

// The general pattern is that a mutable gets set only once, on demand,
when its
@@ -485,6 +491,8 @@
mutable std::set<SubScanKey> _subscans;
mutable std::map<ScanKey, std::set<SubScanKey> > _scanToSubScans;

+ //mutable CountedPtr<std::map<Double, TimeStampProperties> >
_timeStampPropsMap;
+
// disallow copy constructor and = operator
MSMetaData(const MSMetaData&);
MSMetaData operator =(const MSMetaData&);
@@ -503,6 +511,8 @@
// set metadata from OBSERVATION table
void _setObservation(const MeasurementSet& ms);

+ Bool _cacheUpdated(const Float incrementInBytes) const;
+
void _checkField(uInt fieldID) const;

//static void _checkScan(const Int scan, const std::set<Int> allScans);
@@ -513,49 +523,41 @@

void _checkSubScan(const SubScanKey& key) const;

- Bool _hasIntent(const String& intent) const;
+ static void _checkTolerance(const Double tol);

- Bool _hasFieldID(Int fieldID) const;
+ void _createScanRecords(
+ Record& parent, const ArrayKey& arrayKey,
+ const std::map<SubScanKey, SubScanProperties>& subScanProps
+ ) const;

- Bool _hasStateID(Int stateID);
+ void _createSubScanRecords(
+ Record& parent, uInt& scanNRows, std::set<Int>& antennasForScan,
+ const ScanKey& scanKey, const std::map<SubScanKey, SubScanProperties>&
subScanProps
+ ) const;

- void _hasAntennaID(Int antennaID);
+ static void _createTimeStampRecords(
+ Record& parent,
+ const SubScanProperties& subScanProps
+ );

- vector<std::set<String> > _getSpwToIntentsMap();
+ vector<String> _getAntennaNames(
+ std::map<String, uInt>& namesToIDsMap
+ );
+
+ vector<MPosition> _getAntennaPositions() const;

void _getAntennas(
CountedPtr<Vector<Int> >& ant1,
CountedPtr<Vector<Int> >& ant2
) const;
-
- CountedPtr<Vector<Int> > _getScans() const;
-
- CountedPtr<Vector<Int> > _getObservationIDs() const;
-
CountedPtr<Vector<Int> > _getArrayIDs() const;

- CountedPtr<Vector<Int> > _getFieldIDs() const;
-
- CountedPtr<Vector<Int> > _getStateIDs() const;
-
CountedPtr<Vector<Int> > _getDataDescIDs() const;

- CountedPtr<Vector<Double> > _getTimes() const;
+ vector<uInt> _getDataDescIDToSpwMap() const;

CountedPtr<Quantum<Vector<Double> > > _getExposureTimes();

- CountedPtr<ArrayColumn<Bool> > _getFlags() const;
-
- //std::map<Int, std::set<Int> > _getScanToStatesMap() const;
-
- Bool _cacheUpdated(const Float incrementInBytes) const;
-
- static void _checkTolerance(const Double tol);
-
- //std::map<Int, std::set<Int> > _getArrayIDToScansMap() const;
-
- vector<uInt> _getDataDescIDToSpwMap() const;
-
void _getFieldsAndIntentsMaps(
vector<std::set<String> >& fieldToIntentsMap,
std::map<String, std::set<Int> >& intentToFieldsMap
@@ -580,15 +582,34 @@
CountedPtr<std::map<Int, std::set<Double> > >& fieldToTimesMap,
CountedPtr<std::map<Double, std::set<Int> > >& timesToFieldMap
);
+
+ CountedPtr<Vector<Int> > _getFieldIDs() const;
+
vector<String> _getFieldNames() const;

+ CountedPtr<ArrayColumn<Bool> > _getFlags() const;
+
std::map<String, std::set<Double> > _getIntentsToTimesMap() const;

- vector<String> _getAntennaNames(
- std::map<String, uInt>& namesToIDsMap
- );
+ CountedPtr<Vector<Int> > _getObservationIDs() const;
+
+ CountedPtr<Vector<Int> > _getScans() const;
+
+ vector<std::set<String> > _getSpwToIntentsMap();
+
+ CountedPtr<Vector<Int> > _getStateIDs() const;
+
+ CountedPtr<Vector<Double> > _getTimes() const;
+
+ //CountedPtr<std::map<Double, TimeStampProperties> >
_getTimeStampProperties() const;
+
+ Bool _hasIntent(const String& intent) const;
+
+ Bool _hasFieldID(Int fieldID) const;
+
+ Bool _hasStateID(Int stateID);

- vector<MPosition> _getAntennaPositions() const;
+ void _hasAntennaID(Int antennaID);

std::map<Double, Double> _getTimeToTotalBWMap(
const Vector<Double>& times, const Vector<Int>& ddIDs
@@ -713,6 +734,8 @@
std::map<SubScanKey, Double>*& scanNXCRows
) const;

+ static uInt _sizeof(const std::map<Double,
MSMetaData::TimeStampProperties> & m);
+
template <class T>
static uInt _sizeof(const std::map<T, std::set<String> >& m);

Reply all
Reply to author
Forward
0 new messages