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 | List of all members
casa::FitterEstimatesFileParser Class Reference

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

#include <FitterEstimatesFileParser.h>

Public Member Functions

 FitterEstimatesFileParser ()=delete
 
template<class T >
 FitterEstimatesFileParser (const casacore::String &filename, const casacore::ImageInterface< T > &image)
 Constructor filename Name of file containing estimates image Image for which the estimates apply. More...
 
 ~FitterEstimatesFileParser ()
 
ComponentList getEstimates () const
 Get the estimates specified in the file as a ComponentList object. More...
 
casacore::Vector
< casacore::String
getFixed () 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...
 
template<class T >
void _createComponentList (const casacore::ImageInterface< T > &image)
 

Private Attributes

ComponentList _componentList
 
casacore::Vector
< casacore::String
_fixedValues
 
std::unique_ptr< casacore::LogIO_log
 
casacore::Vector
< casacore::Double
_peakValues
 
casacore::Vector
< casacore::Double
_xposValues
 
casacore::Vector
< casacore::Double
_yposValues
 
casacore::Vector
< casacore::Quantity
_majValues
 
casacore::Vector
< casacore::Quantity
_minValues
 
casacore::Vector
< casacore::Quantity
_paValues
 
casacore::String _contents
 

Detailed Description

Class for parsing a file which holds initial estimates for 2-D components. Used by imfit.

Intended use:

Public interface

Review Status

Test programs:
tFitterEstimatesFileParser

Prerequisite

Synopsis

Used for reading files containing initial estimates of models for 2-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 six comma-delimited parameters for specifying an estimate for a component. The values are Flux (quantity), x pixel position of peak (double), y pixel position of peak (double), FWHM major axis (quantity), FWHM minor axis (quantity), position angle (measured from north to east (quantity).
  3. Optionally, a component estimate line can have a seventh 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: "f" flux, "x" x position, "y" y position, "a" major axis, "b" minor axis, "p" position angle. So, eg, "apx" means hold the major axis, position angle, and x position 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

FitterEstimatesFilebFileReader reader("myEstimates.txt", myImage);
ComponentList cl = reader.getEstimates();
casacore::Vector<casacore::String> fixed = reader.getFixed();

Definition at line 81 of file FitterEstimatesFileParser.h.

Constructor & Destructor Documentation

casa::FitterEstimatesFileParser::FitterEstimatesFileParser ( )
delete
template<class T >
casa::FitterEstimatesFileParser::FitterEstimatesFileParser ( const casacore::String filename,
const casacore::ImageInterface< T > &  image 
)
explicit

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

casa::FitterEstimatesFileParser::~FitterEstimatesFileParser ( )

Member Function Documentation

template<class T >
void casa::FitterEstimatesFileParser::_createComponentList ( const casacore::ImageInterface< T > &  image)
private
void casa::FitterEstimatesFileParser::_parseFile ( const casacore::RegularFile myFile)
private

parse the file

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

Get the contents of the file.

ComponentList casa::FitterEstimatesFileParser::getEstimates ( ) const

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

casacore::Vector<casacore::String> casa::FitterEstimatesFileParser::getFixed ( ) const

Get the fixed parameter masks specified in the file.

Member Data Documentation

ComponentList casa::FitterEstimatesFileParser::_componentList
private

Definition at line 106 of file FitterEstimatesFileParser.h.

casacore::String casa::FitterEstimatesFileParser::_contents
private

Definition at line 111 of file FitterEstimatesFileParser.h.

casacore::Vector<casacore::String> casa::FitterEstimatesFileParser::_fixedValues
private

Definition at line 107 of file FitterEstimatesFileParser.h.

std::unique_ptr<casacore::LogIO> casa::FitterEstimatesFileParser::_log
private

Definition at line 108 of file FitterEstimatesFileParser.h.

casacore::Vector<casacore::Quantity> casa::FitterEstimatesFileParser::_majValues
private

Definition at line 110 of file FitterEstimatesFileParser.h.

casacore::Vector<casacore::Quantity> casa::FitterEstimatesFileParser::_minValues
private

Definition at line 110 of file FitterEstimatesFileParser.h.

casacore::Vector<casacore::Quantity> casa::FitterEstimatesFileParser::_paValues
private

Definition at line 110 of file FitterEstimatesFileParser.h.

casacore::Vector<casacore::Double> casa::FitterEstimatesFileParser::_peakValues
private

Definition at line 109 of file FitterEstimatesFileParser.h.

casacore::Vector<casacore::Double> casa::FitterEstimatesFileParser::_xposValues
private

Definition at line 109 of file FitterEstimatesFileParser.h.

casacore::Vector<casacore::Double> casa::FitterEstimatesFileParser::_yposValues
private

Definition at line 109 of file FitterEstimatesFileParser.h.


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