17 #ifndef IMAGES_ASCIIANNOTATIONFILEPARSER_H
18 #define IMAGES_ASCIIANNOTATIONFILEPARSER_H
73 std::shared_ptr<std::pair<casacore::MFrequency, casacore::MFrequency> >
freqRange;
79 using ParamSet = std::map<AnnotationBase::Keyword, ParamValue>;
124 std::vector<AsciiAnnotationFileLine>
getLines()
const;
131 std::shared_ptr<std::pair<casacore::MFrequency, casacore::MFrequency> > overridingFreqRange,
144 std::unique_ptr<casacore::LogIO>
_log;
146 std::vector<AsciiAnnotationFileLine>
_lines;
168 std::vector<casacore::Quantity>& quantities,
182 const std::pair<casacore::Quantity, casacore::Quantity>& qFreqs,
183 const std::vector<casacore::Quantity>& quantities,
225 std::pair<casacore::Quantity, casacore::Quantity>& quantities,
casacore::String&
string,
A Vector of integers, for indexing into Array<T> objects.
A 1-D Specialization of the Array class.
casacore::IPosition _imShape
LatticeExprNode log(const LatticeExprNode &expr)
casacore::Int _fileVersion
casacore::Vector< casacore::Quantity > _extractQuantitiesFromPair(const casacore::String &pair, const casacore::String &preamble) const
casacore::Vector< casacore::Stokes::StokesTypes > stokes
void _setInitialGlobals()
AnnotationBase::RGB color
casacore::CoordinateSystem _csys
static const casacore::Regex startOnePair
ostream-like interface to creating log messages.
static const casacore::Regex startNPair
const_iterator end() const
static const casacore::Int CURRENT_VERSION
std::vector< AsciiAnnotationFileLine > getLines() const
void _determineVersion(const casacore::String &chunk, const casacore::String &filename, const casacore::Int requireAtLeastThisVersion)
RegionTextParser()=delete
std::pair< casacore::Quantity, casacore::Quantity > _extractSingleQuantityPair(const casacore::String &pair, const casacore::String &preamble) const
static casacore::String _getKeyValue(casacore::String &consumeMe, const casacore::String &preamble)
std::shared_ptr< casacore::Vector< casacore::Stokes::StokesTypes > > _overridingCorrRange
static const casacore::String sNPair
AnnotationBase::LineStyle lineStyleVal
casacore::Vector< casacore::Quantity > _extractNQuantityPairs(casacore::String &consumeMe, const casacore::String &preamble) const
Regular expression class.
static casacore::Vector< casacore::Stokes::StokesTypes > _stokesFromString(const casacore::String &stokes, const casacore::String &preamble)
casacore::Vector< AnnotationBase::Keyword > _globalKeysToApply
AnnotationBase::Type _getAnnotationType(casacore::Vector< casacore::Quantity > &qDirs, std::vector< casacore::Quantity > &quantities, casacore::String &textString, casacore::String &consumeMe, const casacore::String &preamble) const
std::shared_ptr< std::pair< casacore::MFrequency, casacore::MFrequency > > freqRange
bool Bool
Define the standard types used by Casacore.
void _createAnnotation(const AnnotationBase::Type annType, const casacore::Vector< casacore::Quantity > &qDirs, const std::pair< casacore::Quantity, casacore::Quantity > &qFreqs, const std::vector< casacore::Quantity > &quantities, const casacore::String &textString, const ParamSet ¤tParamSet, const casacore::Bool annOnly, const casacore::Bool isDifference, const casacore::String &preamble, casacore::Bool requireImageRegion)
casacore::Array< casacore::String > _extractTwoPairs(casacore::uInt &end, const casacore::String &string) const
std::unique_ptr< casacore::LogIO > _log
because of nonstandard access patterns, be careful when using ParamValue and ParamSet outside this cl...
static ParamSet getParamSet(casacore::Bool &spectralParmsUpdated, casacore::LogIO &log, const casacore::String &text, const casacore::String &preamble, const casacore::CoordinateSystem &csys, std::shared_ptr< std::pair< casacore::MFrequency, casacore::MFrequency > > overridingFreqRange, std::shared_ptr< casacore::Vector< casacore::Stokes::StokesTypes > > overridingCorrRange)
get the parameter set from a line of text.
std::pair< casacore::Quantity, casacore::Quantity > _quantitiesFromFrequencyString(const casacore::String &freqString, const casacore::String &preamble) const
casacore::Vector< casacore::Quantity > _extractTwoQuantityPairs(casacore::String &consumeMe, const casacore::String &preamble) const
casacore::Double doubleVal
RegionTextParser & operator=(const RegionTextParser &)=delete
void _parse(const casacore::String &contents, const casacore::String &fileDesc, casacore::Bool requireImageRegion)
static casacore::Vector< casacore::String > _extractSinglePair(const casacore::String &string)
extract s1 and s2 from a string of the form "[s1, s2]"
static const casacore::String bTwoPair
casacore::Int getFileVersion() const
casacore::Vector< casacore::Quantity > _extractTwoQuantityPairsAndSingleQuantity(casacore::String &consumeMe, const casacore::String &preamble) const
std::map< AnnotationBase::Keyword, ParamValue > ParamSet
std::shared_ptr< std::pair< casacore::MFrequency, casacore::MFrequency > > _overridingFreqRange
Represents a line in an ascii region file <author>Dave Mehringer</author>
static const casacore::String sOnePair
Parse and store regions and annotations from an ascii region file <author>Dave Mehringer</author> ...
String: the storage and methods of handling collections of characters.
std::vector< AsciiAnnotationFileLine > _lines
void _extractQuantityPairAndString(std::pair< casacore::Quantity, casacore::Quantity > &quantities, casacore::String &string, casacore::String &consumeMe, const casacore::String &preamble, const casacore::Bool requireQuotesAroundString) const
Subchunk class Provides the ordered pair identifying the current subchunk The first component is the chunk(goes from 0 to nChunks-1 during the outer loop iteration).The second component is the subchunk number which is zero after VisibilityIterator
static casacore::String _doLabel(casacore::String &consumeMe, const casacore::String &logPreamble)
ParamSet _getCurrentParamSet(casacore::Bool &spectralParmsUpdated, ParamSet &newParams, casacore::String &consumeMe, const casacore::String &preamble) const
void _addLine(const AsciiAnnotationFileLine &line)
void _setOverridingCorrelations(const casacore::String &globalOverrideStokes)
set the casacore::Stokes/polarizations/correlations that will override all global and per line correl...
casacore::String stringVal
std::vector< casacore::Int > intVec
AnnotationBase::FontStyle fontStyleVal
casacore::Vector< casacore::Quantity > _extractQuantityPairAndSingleQuantity(casacore::String &consumeMe, const casacore::String &preamble) const
void _setOverridingChannelRange(const casacore::String &globalOverrideChans)
set the (single) channel range that will override all global and per line frequency specifications...
Interconvert pixel and world coordinates.
static const casacore::Regex MAGIC