casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
casa::FitterEstimatesFileParser Class Reference

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

#include <FitterEstimatesFileParser.h>

List of all members.

Public Member Functions

 FitterEstimatesFileParser (const String &filename, const ImageInterface< Float > &image)
 Constructor filename Name of file containing estimates image Image for which the estimates apply.
 ~FitterEstimatesFileParser ()
ComponentList getEstimates () const
 Get the estimates specified in the file as a ComponentList object.
Vector< StringgetFixed () const
 Get the fixed parameter masks specified in the file.
String getContents () const
 Get the contents of the file.

Private Member Functions

 FitterEstimatesFileParser ()
 default constructor cannot be called.
void _parseFile (const RegularFile &myFile)
 parse the file
void _createComponentList (const ImageInterface< Float > &image)

Private Attributes

ComponentList _componentList
Vector< String_fixedValues
std::auto_ptr< LogIO_log
Vector< Double_peakValues
Vector< Double_xposValues
Vector< Double_yposValues
Vector< Quantity_majValues
 Vector<Quantity> fluxValues, majValues, minValues, paValues;.
Vector< Quantity_minValues
Vector< Quantity_paValues
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();
      Vector<String> fixed = reader.getFixed();

Definition at line 82 of file FitterEstimatesFileParser.h.


Constructor & Destructor Documentation

casa::FitterEstimatesFileParser::FitterEstimatesFileParser ( const String filename,
const ImageInterface< Float > &  image 
) [explicit]

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

default constructor cannot be called.


Member Function Documentation

void casa::FitterEstimatesFileParser::_parseFile ( const RegularFile myFile) [private]

parse the file

Get the contents of the file.

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

Get the fixed parameter masks specified in the file.


Member Data Documentation

Definition at line 105 of file FitterEstimatesFileParser.h.

Definition at line 111 of file FitterEstimatesFileParser.h.

Definition at line 106 of file FitterEstimatesFileParser.h.

std::auto_ptr<LogIO> casa::FitterEstimatesFileParser::_log [private]

Definition at line 107 of file FitterEstimatesFileParser.h.

Vector<Quantity> fluxValues, majValues, minValues, paValues;.

Definition at line 110 of file FitterEstimatesFileParser.h.

Definition at line 110 of file FitterEstimatesFileParser.h.

Definition at line 110 of file FitterEstimatesFileParser.h.

Definition at line 108 of file FitterEstimatesFileParser.h.

Definition at line 108 of file FitterEstimatesFileParser.h.

Definition at line 108 of file FitterEstimatesFileParser.h.


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