casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
casa::ProfileFitterEstimatesFileParser Class Reference

Class for parsing a file which holds initial estimates for 1-D components. Used by ImageProfileFitter. More...

#include <ProfileFitterEstimatesFileParser.h>

Public Member Functions

 ProfileFitterEstimatesFileParser (const casacore::String &filename)
 Constructor filename Name of file containing estimates image Image for which the estimates apply. More...
 
 ~ProfileFitterEstimatesFileParser ()
 
SpectralList getEstimates () const
 Get the estimates specified in the file as a ComponentList object. More...
 
std::vector< casacore::StringgetFixed () const
 Get the fixed parameter masks specified in the file. More...
 
casacore::String getContents () const
 Get the contents of the file. More...
 

Private Member Functions

void _parseFile (const casacore::RegularFile &myFile)
 parse the file More...
 
void _createSpectralList ()
 

Private Attributes

SpectralList _spectralList
 
std::vector< casacore::String_fixedValues
 
casacore::LogIO _log
 
std::vector< casacore::Double_peakValues
 
std::vector< casacore::Double_centerValues
 
std::vector< casacore::Double_fwhmValues
 
casacore::String _contents
 

Static Private Attributes

static const casacore::String _class
 

Detailed Description

Class for parsing a file which holds initial estimates for 1-D components. Used by ImageProfileFitter.

Intended use:

Public interface

Review Status

Test programs:
tProfileFitterEstimatesFileParser

Prerequisite

Synopsis

Used for reading files containing initial estimates of models for 1-D fitting. The expected format is:

  1. Lines with a "#" in column 1 are treated as comments and ignored.
  2. Each non-comment line is treated as a complete set of three comma-delimited parameters for specifying an estimate for a gaussian component. The values are peak in image units (double), pixel position of center (double), and FWHM in pixels (double)
  3. Optionally, a gaussian component estimate line can have a fourth parameter which is a string specifying which of the parameters for that component should be held fixed during the fit. This string can include any combination of the following identifiers: "p" peak, "c" center position, "f" FWHM. So, eg, "cp" means hold the center and peak constant during the fit.

If the specified file passed to the constructor does not exist, an exception is thrown. Parsing is done during object construction and an exception is thrown if the file does not have the expected format.

Example

ProfileFitterEstimatesFilebFileReader reader("myEstimates.txt", myImage);
SpectralList sl = reader.getEstimates();
vector<casacore::String> fixed = reader.getFixed();

Definition at line 80 of file ProfileFitterEstimatesFileParser.h.

Constructor & Destructor Documentation

casa::ProfileFitterEstimatesFileParser::ProfileFitterEstimatesFileParser ( const casacore::String filename)
explicit

Constructor filename Name of file containing estimates image Image for which the estimates apply.

casa::ProfileFitterEstimatesFileParser::~ProfileFitterEstimatesFileParser ( )

Member Function Documentation

void casa::ProfileFitterEstimatesFileParser::_createSpectralList ( )
private
void casa::ProfileFitterEstimatesFileParser::_parseFile ( const casacore::RegularFile myFile)
private

parse the file

casacore::String casa::ProfileFitterEstimatesFileParser::getContents ( ) const

Get the contents of the file.

SpectralList casa::ProfileFitterEstimatesFileParser::getEstimates ( ) const

Get the estimates specified in the file as a ComponentList object.

std::vector<casacore::String> casa::ProfileFitterEstimatesFileParser::getFixed ( ) const

Get the fixed parameter masks specified in the file.

Member Data Documentation

std::vector<casacore::Double> casa::ProfileFitterEstimatesFileParser::_centerValues
private

Definition at line 106 of file ProfileFitterEstimatesFileParser.h.

const casacore::String casa::ProfileFitterEstimatesFileParser::_class
staticprivate

Definition at line 102 of file ProfileFitterEstimatesFileParser.h.

casacore::String casa::ProfileFitterEstimatesFileParser::_contents
private

Definition at line 107 of file ProfileFitterEstimatesFileParser.h.

std::vector<casacore::String> casa::ProfileFitterEstimatesFileParser::_fixedValues
private

Definition at line 104 of file ProfileFitterEstimatesFileParser.h.

std::vector<casacore::Double> casa::ProfileFitterEstimatesFileParser::_fwhmValues
private

Definition at line 106 of file ProfileFitterEstimatesFileParser.h.

casacore::LogIO casa::ProfileFitterEstimatesFileParser::_log
private

Definition at line 105 of file ProfileFitterEstimatesFileParser.h.

std::vector<casacore::Double> casa::ProfileFitterEstimatesFileParser::_peakValues
private

Definition at line 106 of file ProfileFitterEstimatesFileParser.h.

SpectralList casa::ProfileFitterEstimatesFileParser::_spectralList
private

Definition at line 103 of file ProfileFitterEstimatesFileParser.h.


The documentation for this class was generated from the following file: