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

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

#include <ProfileFitterEstimatesFileParser.h>

List of all members.

Public Member Functions

 ProfileFitterEstimatesFileParser (const String &filename)
 Constructor filename Name of file containing estimates image Image for which the estimates apply.
 ~ProfileFitterEstimatesFileParser ()
SpectralList 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

void _parseFile (const RegularFile &myFile)
 parse the file
void _createSpectralList ()

Private Attributes

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

Static Private Attributes

static const 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<String> fixed = reader.getFixed();

Definition at line 80 of file ProfileFitterEstimatesFileParser.h.


Constructor & Destructor Documentation

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


Member Function Documentation

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 106 of file ProfileFitterEstimatesFileParser.h.

Definition at line 102 of file ProfileFitterEstimatesFileParser.h.

Definition at line 107 of file ProfileFitterEstimatesFileParser.h.

Definition at line 104 of file ProfileFitterEstimatesFileParser.h.

Definition at line 106 of file ProfileFitterEstimatesFileParser.h.

Definition at line 105 of file ProfileFitterEstimatesFileParser.h.

Definition at line 106 of file ProfileFitterEstimatesFileParser.h.

Definition at line 103 of file ProfileFitterEstimatesFileParser.h.


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