Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents
Next: Details Up: aips++ prototype Previous: System management

Subsections


Public interfaces

CoordSys.h

HEADER FILE DESCRIPTION

Header file for CoordSys class

ENVIRONMENT

#define COORDSYS_H

#include <iostream.h>
#include "ImPixelCoord.h"
#include "ImageCoord.h"
#include "CoordSysType.h"

CLASS DESCRIPTION

Class: CoordSys This class defines the coordinate system associated with an image. The coordinate system specification consists of two parts. The first relates ImPixelCoords to a "native" image coordinate system. For example, the "native " coordinate system for a VLA observed image would be l and m in the SIN system. The second part of the specification defines the coordinate system which the user wants to use for ImageCoords. For example, the user may want to use Galactic coordinates as ImageCoords.

CLASS SUMMARY

class CoordSys
{
public:
        void SetRefPix(ImPixelCoord);
        ImPixelCoord GetRefPix() const;
        void SetRefCoord(ImageCoord ic);
        ImageCoord GetRefCoord() const;
        void SetDeltaCoord(ImageCoord ic);
        ImageCoord GetDeltaCoord() const;
        void SetRotAng(double);
        double GetRotAng() const;
        void SetNtvCrd(CoordSysType ct);
        CoordSysType GetNtvCrd() const;
        void SetImageCrd(CoordSysType ct);
        CoordSysType GetImageCrd() const;
        ImageCoord GetImageCoord(ImPixelCoord) const;
        ImPixelCoord GetImPixelCoord(ImageCoord) const;
        CoordSys();
        CoordSys(ImPixelCoord rp, ImageCoord rc, ImageCoord d, double a,
                CoordSysType n, CoordSysType i);
        ~CoordSys();
};
ostream& operator << (ostream& os, const CoordSys& cs);

MEMBER FUNCTIONS

Set the coordinates of the reference ImPixel for coordinate system transformations to native ImageCoords.

        void SetRefPix(ImPixelCoord);

Return the reference ImPixel for coordinate transformations

        ImPixelCoord GetRefPix() const;

Set the reference native ImageCoord value at the reference pixel (presumably a value in radians for sky coordinates)

        void SetRefCoord(ImageCoord ic);

Return the reference native ImageCoord value at the reference pixel (presumably a value in radians for sky coordinates)

        ImageCoord GetRefCoord() const;

Set the increment native ImageCoord value, per ImPixelCoord increment (presumably a value in radians for sky coordinates)

        void SetDeltaCoord(ImageCoord ic);

Return the increment native ImageCoord value, per ImPixelCoord increment (presumably a value in radians for sky coordinates)

        ImageCoord GetDeltaCoord() const;

Set the rotation angle (radians)

        void SetRotAng(double);

Get the rotation angle (radians)

        double GetRotAng() const;

Set the type of the native coordinate system (SIN, NCP, etc.)

        void SetNtvCrd(CoordSysType ct);

Return the type of the native coordinate system (SIN, NCP, etc.)

        CoordSysType GetNtvCrd() const;

Set the type of the desired Image Coordinate system (SIN, NCP, etc.)

        void SetImageCrd(CoordSysType ct);

Return the type of the Image Coordinate system (SIN, NCP, etc.)

        CoordSysType GetImageCrd() const;

Convert ImPixel Coordinates to Image Coordinates (converting from system "ntvcrd" to "imagecrd").

        ImageCoord GetImageCoord(ImPixelCoord) const;

Convert Image Coordinates to ImPixel Coordinates (converting from system "imagecrd" to "ntvcrd" in the process).

        ImPixelCoord GetImPixelCoord(ImageCoord) const;

        // constructors and destructor
        CoordSys();
        CoordSys(ImPixelCoord rp, ImageCoord rc, ImageCoord d, double a,
                CoordSysType n, CoordSysType i);
        ~CoordSys();

NON-MEMBER FUNCTIONS

ostream& operator << (ostream& os, const CoordSys& cs);

CoordSysType.h

HEADER FILE DESCRIPTION

Header file for CoordSysType class

ENVIRONMENT

#define COORDSYSTYPE_H

#include <iostream.h>
#include <K_String.h>

CLASS DESCRIPTION

Class: CoordSysType This class defines the type of a coordinate system (e.g. SIN, NCP, RaDec, etc.), and associated parameters. Currently the type is defined by an arbitrary character string, but in future might be defined as one of a number of pre-determined descriptors.

CLASS SUMMARY

class CoordSysType
{
public:
        void SetCoordSysID(K_String& );
        K_String GetCoordSysID() const;
        void SetEpoch(float);
        float GetEpoch() const;
        void SetParam(int, double);
        double GetParam(int) const;
        CoordSysType();
        CoordSysType(K_String , float = 2000, double = 0.0, double = 0.0,
                double = 0.0, double = 0.0);
        ~CoordSysType();
};
ostream& operator << (ostream& os, const CoordSysType& cst);
int operator == (const CoordSysType& ct1, const CoordSysType& ct2);

MEMBER FUNCTIONS

Set the coordinate-system descriptor
        void SetCoordSysID(K_String& );

Return the coordinate-system descriptor

        K_String GetCoordSysID() const;

Set the epoch

        void SetEpoch(float);

Get the epoch

        float GetEpoch() const;

Set parameter i (0 <= i <= 3)

        void SetParam(int, double);

Get parameter i (0 <= i <= 3)

        double GetParam(int) const;


        CoordSysType();
        CoordSysType(K_String , float = 2000, double = 0.0, double = 0.0,
                double = 0.0, double = 0.0);
        ~CoordSysType();

NON-MEMBER FUNCTIONS

Print out a CoordSysType object

ostream& operator << (ostream& os, const CoordSysType& cst);

Compare two CoordSysTypes for equality

int operator == (const CoordSysType& ct1, const CoordSysType& ct2);

FilledImage.h

HEADER FILE DESCRIPTION

This file contains the interface to the FilledImage class.

ENVIRONMENT

#define FILLED_IMAGE_H

#include "Array2d.h"
#include "Image.h"
#include <assert.h>
#include <iostream.h>
#include "ListImage.h"
#include "ModelImage.h"

DECLARE_ONCE Array2d<float>;
DECLARE_ONCE Array2d<double>;

class ModelImage;
class ListImage;

CLASS DESCRIPTION

The FilledImage class is a two dimensional image (of float) class with access via the various coordinate type.

CLASS SUMMARY

class FilledImage  : public Image
{
public:
    FilledImage();
    FilledImage(int m, int n, float v=0.0);
    FilledImage(const FilledImage& src);
    FilledImage(const ListImage& src, float);
    FilledImage(const ModelImage& src);
    FilledImage &operator=(const FilledImage& src);
    FilledImage &operator=(const ModelImage& src); 
    int GetNumEl() const;
    Array2d<double> GetStorage();
    void SetStorage(const Array2d<double> &);
    void Scale(float);
    void Fill(float);
    int Extrema(Pixel &maxpix, Pixel &minpix) const;
    void SetPixel(PixelCoord, float);
    float &operator() (int,int);
    float GetPixel(PixelCoord) const;
    int GetImPixelVal(const ImPixelCoord&, float&) const;
    virtual int UCombine (float, const Image&, float, const Image&, float);
    virtual int XCombine (float, const Image&, float, const Image&, float);
    virtual int ScaledAdd (float, const Image&);
    FilledImage SubImage(PixelCoord &, ImPixStep &, ImageDim &) const;
    void Display();
    void Write(Char *File);
    ~FilledImage();
    friend ostream &operator<<(ostream &os, const FilledImage &im);
};

MEMBER FUNCTIONS

Default constructor makes 0 sized image.

    FilledImage();

Make a FilledImage of a given size (possibly with a set value)

    FilledImage(int m, int n, float v=0.0);

Copy constructors

    FilledImage(const FilledImage& src);

Copy constructor (from ListImage) - needs "fill" value

    FilledImage(const ListImage& src, float);

Copy constructor (from ModelImage)

    FilledImage(const ModelImage& src);

Assignment operators

    FilledImage &operator=(const FilledImage& src);

The following will fail if the existing FilledImage does not have enough storage allocated!!

    FilledImage &operator=(const ModelImage& src);

Accessors

    int GetNumEl() const;

Put all the values in memory, which this function allocates

    Array2d<double> GetStorage();

Fill the image with the values in memory, optionally delete that memory

    void SetStorage(const Array2d<double> &);

Data operations.

   void Scale(float);
   void Fill(float);
   int Extrema(Pixel &maxpix, Pixel &minpix) const;
   void SetPixel(PixelCoord, float);

Set/get pixel values by direct indexing

   float &operator() (int,int);

If PixelCoord is non-integral or lies outside image range, method exits.

   float GetPixel(PixelCoord) const;

The following returns FALSE if corresponding PixelCoord is non- integral or lies outside image.

   int GetImPixelVal(const ImPixelCoord&, float&) const;

Union/Intersection operators

  virtual int UCombine (float, const Image&, float, const Image&, float);
  virtual int XCombine (float, const Image&, float, const Image&, float);
  virtual int ScaledAdd (float, const Image&);

Extract sub-image with the TLC specified (as a Pixel coordinate), the step in pixels specified (by an ImPixStep object), and desired dimension specified. Exits if no image is possible (e.g. TLC doesn't lie within the parent image). Desired dimension will shrink to get maximum sub-image allowed.

   FilledImage SubImage(PixelCoord &, ImPixStep &, ImageDim &) const;

Display Function (uses PGPLOT to present a grey-scale representation of the image)

   void Display();

Write Function (ASCII)

   void Write(Char *File);

Destructor.

   ~FilledImage();

Output an image's attributes and contents. Note that a CoordSys must be defined.

   friend ostream &operator<<(ostream &os, const FilledImage &im);

Filler.h

HEADER FILE DESCRIPTION

This file contains the defintions for the Filler class.

ENVIRONMENT

#define FILLER_H

#include "String.h"
#include "XYZ.h"
#include "YegSet.h"
#include "Telescope.h"

CLASS DESCRIPTION

The Filler class produces an observation, consisting of a Telescope object, and its associated YegSet. The constructor defines the observation parameters. The only other method, GetTelescope, returns the associated Telescope object.

CLASS SUMMARY

class Filler
{
public:
    Filler(const String& mytel, const XYZ& myxyz, double myinttime=10.0,
        double myfreq=1.4, double myHAbegH=-2.0,  double myHAbegH= 2.0,
        double mylat=34.0, double mydecl=50.0);
    Telescope& Filler::GetTelescope();
};

MEMBER FUNCTIONS

The one (and only) constructor. Give the various observation parameters. The default parameters are for an obseratory at the VLA's latitude, observing a source at dec of 50 degrees, at 1.4 GHz, with a 10 sec integration time.
    Filler(
        const String& mytel,    // Observatory name.
        const XYZ& myxyz,       // Antenna coordinates (nanosec).
        double myinttime=10.0,  // Integration time (seconds).
        double myfreq=1.4,      // Observing frequency (GHz).
        double myHAbegH=-2.0,   // Beginning Hour Angle, (hours).
        double myHAbegH= 2.0,   // Ending Hour Angle, (hours).
        double mylat=34.0,      // Observatory latitude (degrees).
        double mydecl=50.0);    // Source declination (degrees).

Return the Telescope object associated with this observation.

    Telescope& Filler::GetTelescope();

GainTable.h

HEADER FILE DESCRIPTION

This file contains definitions for the GainTable class.

ENVIRONMENT

#define GAINTABLE_H

#include <assert.h>
#include <math.h>
#include <complex.h>

CLASS DESCRIPTION

GainTable class

CLASS SUMMARY

class GainTable
{
public:
    GainTable(int, int);
    ~GainTable();
    complex& Gain(int, int);
    void SetGain(int, int, complex);
    int Nants();
    int Nentries();
};

MEMBER FUNCTIONS

Constructor for GainTable specifying: number of receptors; number of entries;
    GainTable(int, int);

Destructor.

    ~GainTable();
Return a reference to a gain field in the table specifying: entry/tuple number; receptor number;
    complex& Gain(int, int);
Set a Gain value specifying entry/tuple number; receptor number; value
    void SetGain(int, int, complex);

Return number of collumns (NANTS)

    int Nants();

Return number of rows (Entries)

    int Nentries();

GridTool.h

HEADER FILE DESCRIPTION

ENVIRONMENT

#define GRIDTOOL_H

#include <IntYegSet.h>
#include <DummyImage.h>

typedef double  DFunction(double);
double SincExp(double);

CLASS DESCRIPTION

CLASS SUMMARY

class GridTool
{
public:
   GridTool(DFunction *CF=SincExp,int w=1,int n=6);
   ~GridTool();
   void SetConvFunc(DFunction *CF);
   void SetWeightingScheme(int w);
   void SetSupportSize(int i);
   virtual int Resample(const IntYegSet &, DummyImage &);
   virtual int Resample(const DummyImage &, IntYegSet &); 
   virtual int Resample(const IntYegSet &, DummyImage &, DummyImage &);
};

MEMBER FUNCTIONS

Constructor
   GridTool(DFunction *CF=SincExp,int w=1,int n=6);

Destructor

   ~GridTool();

Services

   void SetConvFunc(DFunction *CF);
   void SetWeightingScheme(int w);
   void SetSupportSize(int i);

The Gridding and De-gridding services. The approprate algorithm is invoked by the ordering of the argumensts.

 Resample(IntYegSet, DummyImage) ==> griddiding from VIS -> Image
 Resample(DummyImage, IntYegSet) ==> de-gridding from Image -> VIS

   virtual int Resample(const IntYegSet &, DummyImage &);
   virtual int Resample(const DummyImage &, IntYegSet &);

Gives grid for PSF as well

   virtual int Resample(const IntYegSet &, DummyImage &, DummyImage &);

HistFile.h

HEADER FILE DESCRIPTION

Header file for HistFile class

ENVIRONMENT

#define HISTFILE_H

#include "K_DList.h"
#include "K_String.h"
#include <iostream.h>

DECLARE_ONCE K_DList<K_String>;

CLASS DESCRIPTION

Class HistFile defines a linked list of CIC strings, which holds an account of the history associated with an image.

CLASS SUMMARY

class HistFile
{
public:
        HistFile();
        ~HistFile();
        HistFile(const HistFile& src);
        HistFile& operator = (const HistFile &);
        void AddRecord(K_String);
        void AddFile(const HistFile &);
        int NumRecs();
};
ostream& operator << (ostream&, HistFile&);

MEMBER FUNCTIONS

Constructor and desctructor
        HistFile();
        ~HistFile();

Copy constructor

        HistFile(const HistFile& src);

Assignment operator

        HistFile& operator = (const HistFile &);

Add a record

        void AddRecord(K_String);

Add the contents of another history file

        void AddFile(const HistFile &);

Get number of records

        int NumRecs();

Print on given stream records i to j. The value of i must be positive and i must be < j. If no specified records exist, nothing is output!

NON-MEMBER FUNCTIONS

Print out a HistFile object

        ostream& operator << (ostream&, HistFile&);

ImPixStep.h

HEADER FILE DESCRIPTION

ENVIRONMENT

#define IMPIXSTEP_H

#include <iostream.h>
#include <K_Array.h>
#include <assert.h>
#include "PixelCoord.h"
#include "ImPixelCoord.h"

DECLARE_ONCE K_Array<int>;    // For the TI preprocessor

CLASS DESCRIPTION

Number of ImPixel's per pixel. Important for derivation of sub-images from an image. For a system where ImPixels increase left to right, and bottom to top; and a system such as CIC where image pixels increase left to right and top to bottom, ImPixStep is + in the x coordinate and - in the y coordinate. ImPixStep is also a useful object for integer vector operations involving Pixel or ImPixel coordinates. INVARIANT Pixel steps must be non zero, although both positive and negative are acceptable.

CLASS SUMMARY

class ImPixStep
{
public:
    ImPixStep();
    ImPixStep(int dx,int dy);
    ImPixStep(const K_Array<int> &);
    virtual ~ImPixStep();
    virtual int Ok() const;
    void SetImPixStep(int i, int m);
    void SetImPixStep(const K_Array<int> &);
    int GetImPixStep(int i) const;
    K_Array<int> GetImPixSet() const;
};
ImPixelCoord operator * (const PixelCoord &, const ImPixStep &);
ImPixelCoord operator * (const ImPixStep &, const PixelCoord &);
PixelCoord operator / (const ImPixelCoord&, const ImPixStep&);
ImPixStep operator * (const ImPixStep&, const ImPixStep&);
int operator == (const ImPixStep&, const ImPixStep& );
ostream& operator<< (ostream&, ImPixStep);

MEMBER FUNCTIONS

Default constructor sets to steps of 1
    ImPixStep();

Construct with given steps (non-zero)

    ImPixStep(int dx,int dy);

Construct with given steps given in an array (non-zero)

    ImPixStep(const K_Array<int> &);
Destructor does nothing presently
    virtual ~ImPixStep();

Returns one if the state is acceptable (non-zero steps)

    virtual int Ok() const;

Set's the ith step to m (must be non-zero)

    void SetImPixStep(int i, int m);

Sets the steps to the vector elements (must be non zero and the correct size.

    void SetImPixStep(const K_Array<int> &);

Get the ith step

    int GetImPixStep(int i) const;

Get all steps into a vector;

    K_Array<int> GetImPixSet() const;

NON-MEMBER FUNCTIONS

Arithmetic operators

ImPixelCoord operator * (const PixelCoord &, const ImPixStep &);
ImPixelCoord operator * (const ImPixStep &, const PixelCoord &);
PixelCoord operator / (const ImPixelCoord&, const ImPixStep&);
ImPixStep operator * (const ImPixStep&, const ImPixStep&);

Compare two ImPixSteps for equality

int operator == (const ImPixStep&, const ImPixStep& );

Print a PixelCoord

ostream& operator<< (ostream&, ImPixStep);

ImPixelCoord.h

HEADER FILE DESCRIPTION

Header file for ImPixelCoord class

ENVIRONMENT

#define A_IMPIXELCOORD_H

#include <assert.h>
#include <iostream.h>
#include "ImageCoord.h"

CLASS DESCRIPTION

This class defines the n-dimensional (currently 2-dimensional) coordinates of an image, in the pixel frame of reference used by a CoordSys object. The x axis increases left to right and the y axis from bottom to top. Although usually only integral coordinate values are used with reference to an image, they are stored as floats for generality. (Coordinate conversions from astronomical coordinates can return non-integral values!)

CLASS SUMMARY

class ImPixelCoord
{
public:
        void SetImPixCoord(int i, float val);
        void SetImPixCoord(float*);
        float GetImPixCoord(int i) const;
        float* GetImPixCoord() const;
        ImPixelCoord operator += (const ImPixelCoord &);
        ImPixelCoord operator -= (const ImPixelCoord &);
        ImPixelCoord();
        ImPixelCoord(float i, float j);
        ~ImPixelCoord();
};
ostream& operator << (ostream& os, const ImPixelCoord ic);
ImPixelCoord operator + (const ImPixelCoord&, const ImPixelCoord&);
ImPixelCoord operator - (const ImPixelCoord&, const ImPixelCoord&);
ImPixelCoord operator * (const ImPixelCoord&, const float);
ImPixelCoord operator * (const float, const ImPixelCoord&);
ImageCoord operator * (const ImPixelCoord&, const ImageCoord&);
ImageCoord operator * (const ImageCoord&, const ImPixelCoord&);
ImPixelCoord operator / (const ImageCoord&, const ImageCoord&);

MEMBER FUNCTIONS

Set the i-axis coordinate to value: val. The value of i must be greater than 0 and less than 3 (currently)
       Preconditions:
                  valid axis: 0 < i  < 3
          
       Postconditions:
                  invalid input parameters: assertion exit
        void SetImPixCoord(int i, float val);

Set the coordinate values to the array of float values given by the float pointer.

       Preconditions:
                  valid number of values: 2
          
       Postconditions:
                  invalid input parameters: assertion exit
        void SetImPixCoord(float*);

Get the value of the i'th axis coordinate. The value i must be greater than 0 and less than 2.

       Preconditions:<
                  valid axis: 0 < i  < 3
          
       Postconditions:
                  true
        float GetImPixCoord(int i) const;

Return the coordinate values by a pointer

       Preconditions:
                  true
          
       Postconditions:
                  true
        float* GetImPixCoord() const;

Add an ImPixelCoord

        ImPixelCoord operator += (const ImPixelCoord &);

Subtract an ImPixelCoord

        ImPixelCoord operator -= (const ImPixelCoord &);


        ImPixelCoord();
        ImPixelCoord(float i, float j);
        ~ImPixelCoord();

NON-MEMBER FUNCTIONS

Print an ImPixelCoord

   ostream& operator << (ostream& os, const ImPixelCoord ic);

Add two ImPixelCoords

   ImPixelCoord operator + (const ImPixelCoord&, const ImPixelCoord&);

Subtract two ImPixelCoords

   ImPixelCoord operator - (const ImPixelCoord&, const ImPixelCoord&);

Multiply an ImPixelCoord by a float

   ImPixelCoord operator * (const ImPixelCoord&, const float);

Multiply a float by an ImPixelCoord

   ImPixelCoord operator * (const float, const ImPixelCoord&);

Multiply an ImPixelCoord by a ImageCoord

   ImageCoord operator * (const ImPixelCoord&, const ImageCoord&);

Multiply a ImageCoord by an ImPixelCoord

   ImageCoord operator * (const ImageCoord&, const ImPixelCoord&);
Divide two ImageCoords (a coordinate value by a coordinate increment)
   ImPixelCoord operator / (const ImageCoord&, const ImageCoord&);

Image.h

HEADER FILE DESCRIPTION

aips++ header

CLASS DESCRIPTION

Abstract base class which stores an image.

ENVIRONMENT

#define A_IMAGE_H

#include <assert.h>
#include <iostream.h>
#include "K_String.h"
#include "CoordSys.h"
#include "ImPixelCoord.h"
#include "PixelCoord.h"
#include "ImageUnits.h"
#include "ImPixStep.h"
#include "HistFile.h"
#include "ImageDim.h"
#include "Pixel.h"

CLASS SUMMARY

class Image
{
public:
   Image(int m =0, int n = 0);
   ImageDim GetDim() const;
   virtual int GetNumEl() const = 0;
   K_String GetImageType() const;
   void SetImageType(K_String s);
   void SetCenPix(PixelCoord p);
   PixelCoord GetCenPix() const;
   void SetImCornPix(ImPixelCoord p);
   ImPixelCoord GetImCornPix() const;
   void SetPixStep(ImPixStep r);
   ImPixStep GetPixStep() const;
   void SetDataType(ImageUnits iu);
   ImageUnits GetDataType() const;
   void SetCoordSys(CoordSys * pcs);
   CoordSys * GetCoordSys() const;
   void SetRegBLC(ImPixelCoord blc);
   ImPixelCoord GetRegBLC() const;
   void SetRegTRC(ImPixelCoord trc);
   ImPixelCoord GetRegTRC() const;
   HistFile * GetHistPointer() const;
   void CenterImage(ImPixelCoord);
   int ConformsWith(const Image&) const;
   ImPixelCoord GetImPixCoord(PixelCoord) const;
   ImageCoord GetImageCoord(ImPixelCoord) const;
   ImageCoord GetImageCoord(PixelCoord) const;
   ImPixelCoord GetImPixCoord(ImageCoord) const;
   PixelCoord GetPixelCoord(ImPixelCoord) const;
   PixelCoord GetPixelCoord(ImageCoord) const;
   void AddHistory(K_String);
   void AddHistory(const Image&);
   void ListHistory() const;
   virtual void Scale(float) = 0;
   virtual void Fill(float) = 0;
   virtual int Extrema(Pixel&, Pixel&) const = 0;
   Pixel Maximum() const;
   Pixel Minimum() const;
   virtual void SetPixel(PixelCoord, float) = 0;
   virtual float GetPixel(PixelCoord) const = 0;
   virtual int GetImPixelVal(const ImPixelCoord&, float&) const = 0;
   virtual int UCombine (float, const Image&, float, const Image&, float) = 0;
   virtual int XCombine (float, const Image&, float, const Image&, float) = 0;
   virtual int ScaledAdd(float, const Image&) = 0;
   virtual  ~Image();

protected:
   ImageDim dim;
   K_String pImtype;
   ImPixelCoord regblc, regtrc;
   PixelCoord cenpix;
   ImPixelCoord imcornpix;
   ImPixStep pixstep;
   ImageUnits  datatype;
   CoordSys *pCsys;
   HistFile *pHist;

   int CombTwoImages(int, const Image&, const Image&, float&, float&,
		float&, float&);
   int CombOneImage(const Image&, float&, float&, float&, float&);
   void UpdateCenter();
};

MEMBER FUNCTIONS

Constructor ("fill with value" version must be in derived class). (Probably need more constructors.)

   Image(int m =0, int n = 0);

   // Accessors.
The following accessor returns the image dimensions. If the dimensions of an image are [m, n], then PixelCoords run from 0 to m-1 in the X dimension and from 0 to n-1 in the Y direction. Image dimensions can be set only by the constructor, or modified by adding pixels to a list image, or by an X/UCombine method. The default dimensions from the constructor are [0,0].
   ImageDim GetDim() const;

Return the number of pixels in the image

   virtual int GetNumEl() const = 0;

Return/set the image descriptor (a string)

   K_String GetImageType() const;
   void SetImageType(K_String s);

Set/return the specification of the "image center" in PixelCoord. N.B. The default "center" position is (m/2, n/2-1) in Pixel coordinates, i.e. displaced to Top Right of geometric image center.

   void SetCenPix(PixelCoord p);
   PixelCoord GetCenPix() const;

Set/return the ImPixelCoords of the TLC of the image (the origin (0,0) of PixelCoord).

   void SetImCornPix(ImPixelCoord p);
   ImPixelCoord GetImCornPix() const;

Set/return the ImPixStep for the image == the number of ImPixels per Pixel. Since the TLC is the origin for PixelCoords (CIC convention), the Y value of ImPixStep is negative. Step values must be integral.

   void SetPixStep(ImPixStep r);
   ImPixStep GetPixStep() const;

Set/return the type of data units for the image

   void SetDataType(ImageUnits iu);
   ImageUnits GetDataType() const;

Set/retrieve the "coordinate system" for the image. This defines the relationship between ImPixelCoord and some selected system of ImageCoords. The definition of the precise system of ImageCoords to be used is defined within the CoordSys object. When images are cloned, sub-images are formed, assignments made to new image objects, copied, etc., the same CoordSys object is referenced.

   void SetCoordSys(CoordSys * pcs);
   CoordSys * GetCoordSys() const;

Set/retrieve a "region of interest" for the image. This feature is defined by a BLC in ImPixelCoord and a TRC in ImPixelCoord. Implementation of a feature like this is not currently in place. Probably one would need a list of regions of interest.

   void SetRegBLC(ImPixelCoord blc);
   ImPixelCoord GetRegBLC() const;

   void SetRegTRC(ImPixelCoord trc);
   ImPixelCoord GetRegTRC() const;

Get pointer to history file

   HistFile * GetHistPointer() const;

Method to shift "center" of image to a specified ImPixelCoord. The reference value (imcornpix) of the TLC of the image is modified.

   void CenterImage(ImPixelCoord);
Checks whether another Image conforms with the current Image, i.e. can be used with it in a "combine" or "scaledAdd" operation. The two images must have the same "pCsys", the same "pixstep", the same "dataunit", and their "imcornpix" must be consistent with"pixstep". Returns TRUE if they are conformant, FALSE otherwise.
   int ConformsWith(const Image&) const;

Coordinate conversion - forward (various coordinate systems) Note that the first may return non-integral values of ImPixelCoord.

   ImPixelCoord GetImPixCoord(PixelCoord) const;
   ImageCoord GetImageCoord(ImPixelCoord) const;
   ImageCoord GetImageCoord(PixelCoord) const;

Coordinate conversion - reverse (various coordinate systems) Note that these may return non-integral values of ImPixelCoords or PixelCoord (even though the latter must be integral to refer to image data elements).

   ImPixelCoord GetImPixCoord(ImageCoord) const;
   PixelCoord GetPixelCoord(ImPixelCoord) const;
   PixelCoord GetPixelCoord(ImageCoord) const;

History maintenance. Add comments (string), another Image's history, or print out file

   void AddHistory(K_String);
   void AddHistory(const Image&);
   void ListHistory() const;

Scale all pixel values in the image by a scaling factor.

   virtual void Scale(float) = 0;

Replace all pixel values in the image by a new value.

   virtual void Fill(float) = 0;

Return the maximum and minimum Pixel value (by returning Pixels) in the image. Returns FALSE if image is empty, otherwise TRUE.

   virtual int Extrema(Pixel&, Pixel&) const = 0;

Return the maximum and minimum Pixel values (by returning Pixels) in the image. Exits if image is empty.

   Pixel Maximum() const;
   Pixel Minimum() const;

Inserts a pixel value into the image with given PixelCoord.

   virtual void SetPixel(PixelCoord, float) = 0;

Returns the data value of a pixel having a given PixelCoord. For a ListImage, it will return the value of the FIRST matching pixel in the list. If no matching pixel exists in the image, the method exits.

   virtual float GetPixel(PixelCoord) const = 0;

Returns the data value of a Pixel having a specified ImPixel coordinate. This function may not always be able to find a matching pixel, in which case it returns FALSE. (There is no guarantee that an integral ImPixel coordinate will be an integral Pixel coordinate). In the case of a "ListImage", it will return the FIRST matching pixel found in the list.

   virtual int GetImPixelVal(const ImPixelCoord&, float&) const = 0;
 
   // Union image operators.

General UNION combine: Image C (*this) = factor1*Image A + factor2*Image B . Image C can be Filled or ListImage type, while Images A and B can be any image type. Images A and B must be conformant: same ImageUnits, same CoordSys, same ImPixStep and their "imcornpix" reference corners must be separated by an integral number of ImPixSteps. Image C will be made to be conformant with images A and B, and its history file (if any) will be repaced by that of A followed by B. The dimensions of C, and its reference corner, will be set to represent the true UNION of images A and B. Output pixels in C will be set to a "fill" value (only if C is a FilledImage) if there are no corresponding pixels in A or B. Otherwise, the output pixels in C will be = factor1*A (if pixel exists only in A), = factor2*B (if pixel exists only in B), = factor1*A + factor2*B (if pixel exists in both). The method returns FALSE if the images are non-conformant.

  virtual int UCombine (float, const Image&, float, const Image&, float) = 0;

   // Intersection image operators.

General INTERSECTION combine: Image C (*this) = factor1*Image A + factor2*Image B . Image C can be Filled or ListImage type, while Images A and B can be any image type. Images A and B must be conformant: same ImageUnits, same CoordSys, same ImPixStep and their "imcornpix" reference corners must be separated by an integral number of ImPixSteps. Image C will be made to be conformant with images A and B, and its history file (if any) will be repaced by that of A followed by B. The dimensions of C, and its reference corner, will be set to represent the true INTERSECTION of images A and B. Output pixels in C will be set to a "fill" value (only if C is a FilledImage) if there is no corresponding pixels in both A and B. (This can only happen if A or B is a ListImage.) Otherwise, the output pixels in C will be = factor1*A + factor2*B. The method returns FALSE if the images are non-conformant, or if there is no INTERSECTION.

   virtual int XCombine (float, const Image&, float, const Image&, float) = 0;

General scaled-add: Image A (*this) = Image A + factor*Image B. Image A can be Filled or ListImage type, while B can be any image type. Images A and B must be conformant: same ImageUnits, same CoordSys, same ImPixStep and their "imcornpix" reference corners must be separated by an integral number of ImPixSteps. The history file of Image B will be added to that of Image A. The scaled-add operation will take place only for pixels in A that have corresponsding pixels in B. The method returns FALSE if the images are non-conformant.

   virtual int ScaledAdd(float, const Image&) = 0;


   // Destructor.
   virtual  ~Image();

PROTECTED DATA MEMBERS

Dimensions of image [x,y]

   ImageDim dim;

Image type identifier.

   K_String pImtype;

The ImPixel coordinates of the BLC and TLC of a region of interest.

   ImPixelCoord regblc, regtrc;

Image "centre", in pixel coordinates. Whenever the image dimensions are updated (at construction time or otherwise) this is set to the default value of (m/2, n/2-1) where the dimensions are [m,n]. The "CenterImage()" method uses this parameter.

   PixelCoord cenpix;

ImPixel coordinates of Pixel coordinate (0,0), the top-left corner. This defines the position of the image with respect to ImPixel (and hence Image) coordinates. The default value of this is (1,n) when the dimensions are [m,n], i.e. the BLC is (1,1).

   ImPixelCoord imcornpix;

Number of ImPixels per Pixel. This defines the ratio of ImPixel coordinates to Pixel coordinates, and the default value is (1,-1), corresponding to the CIC convention of having Pixel coordinate (0,0) at the TLC. When a new image is created by taking a sub-image of an existing image, this may change.

   ImPixStep pixstep;

Data units for the pixel values in the image.

   ImageUnits  datatype;

Associated coordinate system. Note that a coordinate system must be explicitly assigned (currently no constructor does this!) by inserting a pointer to it here.

   CoordSys *pCsys;

Associated history (pointer to Hist File object). This is usually assigned automatically by the constructor, and the destructor removes the storage.

   HistFile *pHist;

PROTECTED MEMBER FUNCTIONS

Methods for combining images. These are solely for the use of the derived classes in implementing dynamically bound combine and scaled add functions. Essentially they compute the ``union'' or ``intersection'' areas in terms of x and y values of ImPixel coordinates.
    int CombTwoImages(int, const Image&, const Image&, float&, float&,
		float&, float&);
    int CombOneImage(const Image&, float&, float&, float&, float&);

Update the "centre pixel". This method is for the use of the base and derived classes, to update the "center" definition whenever the dimensions are changed.

   void UpdateCenter();

ImageCoord.h

HEADER FILE DESCRIPTION

aips++

ENVIRONMENT

#define A_IMAGECOORD_H

#include <iostream.h>

CLASS DESCRIPTION

Class ImageCoord is used to define astronomical coordinates, or increments in astronomical coordinates. The units are usually assumed to be radians, but could have other units for specialized coordinate systems

CLASS SUMMARY

class ImageCoord
{
public:
        ImageCoord();
        ImageCoord(double i, double j);
        void SetImageCoord(int i, double m);
        void SetImageCoord(double *);
        double GetImageCoord(int i) const;
        double* GetImageCoord() const;
        ~ImageCoord();
};
ostream& operator<<(ostream&, ImageCoord);
ImageCoord operator + (const ImageCoord&, const ImageCoord&);
ImageCoord operator - (const ImageCoord&, const ImageCoord&);
ImageCoord operator * (const ImageCoord&, const float);
ImageCoord operator * (const float, const ImageCoord&);

MEMBER FUNCTIONS

Default constructor.
        ImageCoord();

Constructor which sets coordinates.

        ImageCoord(double i, double j);

Set i'th coordinate to m.

        void SetImageCoord(int i, double m);

Set coordinates to values.

        void SetImageCoord(double *);

Return i'th coordinate.

        double GetImageCoord(int i) const;

Return coordinates.

        double* GetImageCoord() const;

Destructor.

        ~ImageCoord();

NON-MEMBER FUNCTIONS

Print an ImageCoord.
   ostream& operator<<(ostream&, ImageCoord);

Add two ImageCoords

   ImageCoord operator + (const ImageCoord&, const ImageCoord&);

Subtract two ImageCoords

   ImageCoord operator - (const ImageCoord&, const ImageCoord&);

Multiply an ImageCoord by a float

   ImageCoord operator * (const ImageCoord&, const float);

Multiply a float by an ImageCoord

   ImageCoord operator * (const float, const ImageCoord&);

ImageDim.h

HEADER FILE DESCRIPTION

Header file for ImageDim class

ENVIRONMENT

#define IMAGEDIM_H

#include <iostream.h>

CLASS DESCRIPTION

Class ImageDim defines the (vector) dimensions of an image. Currently it is defined only for two-dimensional images, i.e. there are two vector (int) elements.

CLASS SUMMARY

class ImageDim
{
public:
        void SetDim(int i, int val);
        void SetDim(int*);
        int GetDim(int i) const;
        int* GetDim() const;
        ImageDim();
        ImageDim(int i, int j);
        ~ImageDim();
};
ostream& operator << (ostream& os, const ImageDim id);

MEMBER FUNCTIONS

Set the i'th dimension to value: val. The value of i must be greater than 0 and less than 3 (currently)

        Preconditions:
                  valid axis: 0 < i  < 3
                  valid dimension value: 0 <= val
          
        Postconditions:
                  invalid input parameters: assertion exit
        void SetDim(int i, int val);

Set the dimensions to the values given by an int pointer. There must be two valid values, and each must be positive.

        Preconditions:
                  valid number of values: 2
                  valid dimension value: 0 <= val
          
        Postconditions:
                  invalid input parameters: assertion exit
        void SetDim(int*);

Get the dimension of the i'th axis. The value i must be greater than 0 and less than 2.

        Preconditions:
                  valid axis: 0 < i  < 3
          
        Postconditions:
                  true
        int GetDim(int i) const;

Return the dimensions

        Preconditions:
                  true
          
        Postconditions:
                  true
        int* GetDim() const;


        ImageDim();
        ImageDim(int i, int j);
        ~ImageDim();

NON-MEMBER FUNCTIONS

   ostream& operator << (ostream& os, const ImageDim id);

ImageUnits.h

HEADER FILE DESCRIPTION

Header file for ImageUnits class

ENVIRONMENT

#define IMAGEUNITS_H

#include <iostream.h>
#include <K_String.h>

CLASS DESCRIPTION

Class ImageUnits defines the pixel units for an image. Currently this is defined by any arbitrary character string, but in future might be idefined as one of a number of pre-determined descriptors, unit scaling factors, etc.

CLASS SUMMARY

class ImageUnits
{
public:
        void SetImUnits(K_String& );
        K_String GetImUnits() const;
        ImageUnits();
        ImageUnits(K_String s);
        ~ImageUnits();
};
ostream& operator << (ostream& os, const ImageUnits& iun);
int operator == (const ImageUnits& iu1, const ImageUnits& iu2);

MEMBER FUNCTIONS

Set the image units descriptor
        void SetImUnits(K_String& );

Return the image units descriptor

        K_String GetImUnits() const;

        ImageUnits();
        ImageUnits(K_String s);
        ~ImageUnits();

NON-MEMBER FUNCTIONS

Print out an ImageUnits object
   ostream& operator << (ostream& os, const ImageUnits& iun);

Compare two ImageUnits for equality

   int operator == (const ImageUnits& iu1, const ImageUnits& iu2);

ImagingModel.h

HEADER FILE DESCRIPTION

Uses DummyImage, must be replaced by Image

ENVIRONMENT

#define A_IMAGINGMODEL_H

#include "YegSet.h"
#include "DummyImage.h"

CLASS DESCRIPTION

CLASS SUMMARY

class ImagingModel
{
public:
   ImagingModel();
   ~ImagingModel();
   virtual int InvertYeg(YegSet &, DummyImage &);
   virtual int PredictYeg(YegSet &, DummyImage &);
};

MEMBER FUNCTIONS

   //Constructor
   ImagingModel();

   //Destructor
   ~ImagingModel();

   //Services
   virtual int InvertYeg(YegSet &, DummyImage &);
   virtual int PredictYeg(YegSet &, DummyImage &);
};

Input.h

HEADER FILE DESCRIPTION

header file for class Input

ENVIRONMENT

#define A_INPUT_H

#include <iostream.h>
#include <stdarg.h>
#include "Param.h"
#include <K_DList.h>                // CIC

DECLARE_ONCE K_DList<Param>;        // Template kludge (CIC)
DECLARE_ONCE K_DLinkable<Param>;    // Template kludge (CIC)

CLASS DESCRIPTION

Class Input is: A linked list of parameters (defined by the helper class ``Param'') with various user interface attributes. Part of an example of a traditional ``key=value + help'' command-line user interface.

CLASS SUMMARY

class Input
{
public:
     Input();
    ~Input();
     void Create(String key, String value, String help);
     void StdCreate(String stdkey, String key, String value, String help);
     void Close();
     double GetDouble(String key);
     int GetInt(String key);
     String GetString(String key);
     bool GetBool(String key);
     int Count();
     bool Debug(int l);
     bool Put(String key, String value);
     bool Put(String keyval);
};
extern Input inputs;
void error(char *fmt ...);          // The aips stdarg family
void warning(char *fmt ...);
void debug(int l, char *fmt ...);

MEMBER FUNCTIONS

The default constructor is the only one! It enables the creation of parameters. It puts the program in no-prompt mode unless environment variable HELP is defined with value "prompt". The output debug level is set according to the value of the environment variable DEBUG. The maximum number of error messages to be outputed is set according to the value of the environment variable ERROR.

     Input();

Destructor.

    ~Input();

                                // parameter creation

Create a new parameter, either from scratch or looking it up from an internal list of templates. The function also checks whether parameters can still be created, and whether key is unique for the program. The value, help and remaining arguments are all optional.

     void Create(String key, String value, String help);
     void StdCreate(String stdkey, String key, String value, String help);

Disable the creation of parameters. Highly recommended, but not required?

    void Close();

                                // query functions

Get the double value of the parameter (or 0.0 if unknown key). If the program is in prompt mode, ask the user for the value.

    double GetDouble(String key);

Get the int value of the parameter (or 0 if unknown key). If the program is in prompt mode, ask the user for the value.

    int GetInt(String key);

Get the string-type value of the parameter (or "" if unknown key). If the program is in prompt mode, ask the user for the value.

    String GetString(String key);

Get the boolean value of the parameter (or FALSE if unknown key). If the program is in prompt mode, ask the user for the value.

    bool GetBool(String key);

Get the number of parameters of this program

    int Count();

See if the current debug level is thresholded

    bool Debug(int l);

                                // modify function

Set the value for a named parameter. Return FALSE if key is an unknown parameter name. The default value is "". The function can also be called with a single argument of the form `key=value', where key is a valid new parameter name, and where value may be empty (the `=' is required though). In this case a new parameter will be created (provided that creation is still allowed).

    bool Put(String key, String value);
    bool Put(String keyval);

NON-MEMBER FUNCTIONS

   void error(char *fmt ...);          // The aips stdarg family
   void warning(char *fmt ...);
   void debug(int l, char *fmt ...);

IntYegSet.h

HEADER FILE DESCRIPTION

This file contains the definitions for the IntYegSet class.

ENVIRONMENT

#define INTYEGSET_H

#include "YegSet.h"

CLASS DESCRIPTION

The IntYegSet class provides services to return telescope, data, weights and coordinates.

CLASS SUMMARY

class IntYegSet:public YegSet
{
public:
    IntYegSet(const YegSet&);
    DVector u() const;
    DVector v() const;
    DVector w() const;
    DVector time() const;
    DVector r1() const;
    DVector r2() const;
    virtual void ShowYegSet (int i1, int i2);
};

MEMBER FUNCTIONS

Construct an IntYegSet from an YegSet. Default copy constructor should also work OK.

    IntYegSet(const YegSet&);

Return u,v,w coordinates, time and receptor numbers.

    DVector u() const;     // u in wavelengths.
    DVector v() const;     // v in wavelengths.
    DVector w() const;     // w in wavelengths.
    DVector time() const;  // time in seconds.
    DVector r1() const;    // Number of ant1.
    DVector r2() const;    // Number of ant2.

Display

    virtual void ShowYegSet (int i1, int i2);

ListImage.h

HEADER FILE DESCRIPTION

Header file for ListImage class

ENVIRONMENT

#define LISTIMAGE_H

#include <iostream.h>
#include "Image.h"
#include "K_DList.h"
#include "Pixel.h"
#include "ModelImage.h"
#include "FilledImage.h"

DECLARE_ONCE K_DList<Pixel>;

class FilledImage;        // Needed for proper declaration order
class ModelImage;

CLASS DESCRIPTION

The ListImage class: pixels (values plus coordinates) are stored as a linked list.

CLASS SUMMARY

class ListImage : public Image
{
public:
        ListImage(int m = 0, int n = 0);
        ~ListImage();
        ListImage(const ListImage& src);
        ListImage(const ModelImage& src);
        ListImage(const FilledImage& src);
        ListImage & operator = (const ListImage&);
        ListImage & operator = (const ModelImage&);
        ListImage & operator = (const FilledImage&);
        int GetNumEl() const;
        void Scale(float);
        void Fill(float);
        void FillPixel(int, float);
        int Extrema(Pixel &, Pixel &) const;
        void SetPixel(PixelCoord, float);
        int PixelExists(int) const;
        int PixelExists(PixelCoord) const;
        float GetPixel(PixelCoord) const;
        int GetPixel(PixelCoord, float&) const;
        void DeletePixel(int);
        Pixel GetPixel(int) const;
        void SetToPix(int) const;
        Pixel GetNxtPixel() const;
        int GetImPixelVal(const ImPixelCoord&, float&) const;
        int GetFirstNeg() const;
        ListImage CloneEmpty() const;
        void SortMerge(int);
 friend ostream& operator << (ostream&, ListImage&);
        int ScaledAdd(float, const Image&);
        int UCombine(float, const Image&, float, const Image&, float);
        int XCombine(float, const Image&, float, const Image&, float);
};
end{verbatim}

\subsection*{MEMBER FUNCTIONS}

           Constructor and destructor
\begin{verbatim}
        ListImage(int m = 0, int n = 0);
        ~ListImage();

Copy constructors

        ListImage(const ListImage& src);
        ListImage(const ModelImage& src);
        ListImage(const FilledImage& src);

Assignment operators

        ListImage & operator = (const ListImage&);
        ListImage & operator = (const ModelImage&);
        ListImage & operator = (const FilledImage&);

Return number of elements

        int GetNumEl() const;

Scale all pixel values by a scaling factor

        void Scale(float);

Replace values of all existing pixels by a new value.

        void Fill(float);

Fill the value of the n'th pixel with a new number. n must be a valid serial pixel number (0 < n <= number of elements)

        void FillPixel(int, float);

Return maximum and minimum pixels in image. Returns FALSE if empty image.

        int Extrema(Pixel &, Pixel &) const;

Set a pixel (add a pixel to the list)

        void SetPixel(PixelCoord, float);

Check that pixel of serial number i exists.

        int PixelExists(int) const;

Check that a pixel having given Pixel Coords exists.

        int PixelExists(PixelCoord) const;

Retrieve the value of a pixel (scan through list). The value of the FIRST pixel with matching coordinates is returned. If there is no matching pixel, or if the image is empty, the method exits.

        float GetPixel(PixelCoord) const;

Retrieve the value of a pixel (scan through list). The value of the FIRST pixel with matching coordinates is returned. The method returns FALSE if the image is empty or no matching pixel is found, otherwise TRUE.

        int GetPixel(PixelCoord, float&) const;

Delete the n'th pixel in the list. The serial pixel number n must be > 0 and <= the number of pixels.

        void DeletePixel(int);

Retrieve the n'th pixel in the list. The serial pixel number n must be > 0 and <= the number of pixels.

        Pixel GetPixel(int) const;

Prepare to extract pixels having serial number n (and greater). This is a faster access method than the preceding. The number n must be in range 0 < n <= number of pixels in image.

        void SetToPix(int) const;

Get next pixel. Must be preceded by invocation of itself, or SetToPix(). Exits if one has run off end of pixel list!

        Pixel GetNxtPixel() const;

Return value of FIRST pixel having ImPixelCoords. If there is no matching pixel, it returns FALSE, otherwise TRUE.

        int GetImPixelVal(const ImPixelCoord&, float&) const;

Get serial pixel number of first negative pixel. Returns zero for empty image or no negative pixels.

        int GetFirstNeg() const;

"Clone" a new ListImage that has an empty list but all other attributes of the current image

        ListImage CloneEmpty() const;

Merge pixels with corresponding coordinates (i = 0), and merge and then sort into decreasing order of pixel value (i = 1). The latter is not yet implemented.

        void SortMerge(int);

Print out a ListImage object. Note that a CoordSys must be defined!

 friend ostream& operator << (ostream&, ListImage&);

Union and intersection combine and scaled-add. All methods used to implement these must be virtual methods!

        int ScaledAdd(float, const Image&);
        int UCombine(float, const Image&, float, const Image&, float);
        int XCombine(float, const Image&, float, const Image&, float);

ModelImage.h

HEADER FILE DESCRIPTION

aips++ header

ENVIRONMENT

#define A_MODELIMAGE_H

#include <assert.h>
#include <iostream.h>
#include "Image.h"

typedef float (*pFunc)(float *,ImPixelCoord);

CLASS DESCRIPTION

Class: ModelImage Image with pixel values defined by an analytical function. An example of how to use ModelImages follows: If one wished to have a 128 x 128 ModelImage of a Gaussian function centered on ImPixel coordinates (64,64) and having width paramters (5,5) and unity amplitude, the following is the procedure.
      float Gaussian(float   parms, ImPixelCoord imp);
          {
              float xim = imp.GetImPixCoord(1);
              float yim = imp.GetImPixCoord(2);
              float dx = (xim - parms[1])/parms[3];
              float dy = (yim - parms[2])/parms[4];
              double val = parms[0]*exp(-dx*dx - dy*dy);
              return (float)val;
           }
  
       float gparms[5] = {1,64,64,5,5};
  
  
       ModelImage mim(128,128);
       // Attach a coordinate system here!
       mim.SetFunction(Gaussian);
       mim.SetParmList(gparms);
               etc.
NOTE: If one wished to have the Gaussian centred at given Pixel coordinates, one must (before any image operation) set gparms[1:2] to the ImPixel coordinates corresponding to the Pixel coordinates. This requires a call to the Image method that makes this conversion.

CLASS SUMMARY

class ModelImage  : public Image
{
public:
   ModelImage ( int m = 0, int n = 0, pFunc f = 0, float *p = 0,
                float sc = 1.0);
   ModelImage(const ModelImage& src);
   ModelImage &operator=(const ModelImage& src);
   int GetNumEl() const;
   void SetParmList(float * pp);
   void SetFunction(pFunc fp);
   void Scale(float scl);
   void Fill(float);
   int Extrema(Pixel &maxpix, Pixel &minpix) const;
   void SetPixel(PixelCoord, float);
   float GetPixel(PixelCoord) const;
   int GetImPixelVal(const ImPixelCoord&, float&) const;
   int UCombine (float, const Image&, float, const Image&, float);
   int ScaledAdd(float, const Image&);
   int XCombine(float, const Image&, float, const Image&, float);
 friend ostream& operator << (ostream&, ModelImage&);
   ~ModelImage();
};

MEMBER FUNCTIONS

Make a ModelImage.

   ModelImage ( int m = 0, int n = 0, pFunc f = 0, float *p = 0, 
        float sc = 1.0);

Copy constructor

   ModelImage(const ModelImage& src);

Asignment operator

   ModelImage &operator=(const ModelImage& src);

Accessors

   int GetNumEl() const;
   void SetParmList(float * pp);
   void SetFunction(pFunc fp);

Data operations.

   void Scale(float scl);
   void Fill(float);

Find extrema. Returns FALSE if empty image.

   int Extrema(Pixel &maxpix, Pixel &minpix) const;
   void SetPixel(PixelCoord, float);

Return "pixel" value. It will return a model image value, even for non-integral values of PixelCoord.

   float GetPixel(PixelCoord) const;

Get pixel value, given ImPixel coordinates. Returns FALSE if the resulting PixelCoord is non-integral.

   int GetImPixelVal(const ImPixelCoord&, float&) const;

Union image operator.

   int UCombine (float, const Image&, float, const Image&, float);

Scaled Add and Intersection image operator.

   int ScaledAdd(float, const Image&);
   int XCombine(float, const Image&, float, const Image&, float);

Output a ModelImage object. Note that a CoordSys must be defined!

friend ostream& operator << (ostream&, ModelImage&);

Destructor.

   ~ModelImage();

Param.h

HEADER FILE DESCRIPTION

header file for class Param

ENVIRONMENT

#define A_PARAM_H

#include <iostream.h>
#include "String.h"             // Meant to be the GNU String !!!!
#include <string.h>             // things like strlen() and such

enum bool {FALSE, TRUE};

CLASS DESCRIPTION

Class Param ... Part of an example of a traditional `key=value + help' command-line user interface.

CLASS SUMMARY

class Param
{
public:
    Param();
    Param(String, String, String);
    Param(const Param&);
    ~Param();
    bool   operator == (const Param&) const;
    double GetDouble(bool do_prompt=FALSE);
    int    GetInt(bool do_prompt=FALSE);
    String GetString(bool do_prompt=FALSE);
    bool   GetBool(bool do_prompt=FALSE);
    String Get();
    String GetHelp();
    String GetKey();
    String KeyVal() const;
    bool   Put(const String a_value);
    void   Print(ostream& out) const;
};
 ostream& operator<< (ostream& os, const Param& p);

MEMBER FUNCTIONS

default constructor
    Param();

normal constructor with optional value and help strings

    Param(String, String, String);

copy constructor

    Param(const Param&);

destructor

    ~Param();

                                // operator functions:  =, == and <<

copy-assignment operator

    Param& operator= (const Param&);
comparison operator
    bool operator== (const Param&) const;

                                // query functions

get a double parameter value; prompt if switch is TRUE

    double GetDouble(bool do_prompt=FALSE);

get an int parameter value; prompt if switch is TRUE

    int GetInt(bool do_prompt=FALSE);

get a string-type parameter value; prompt if switch is TRUE

    String GetString(bool do_prompt=FALSE);

get a boolean parameter value; prompt if switch is TRUE

    bool GetBool(bool do_prompt=FALSE);

get parameter value as a string

    String Get();

get parameter help string

    String GetHelp();

get parameter name

    String GetKey();

get the string `key = value' for the parameter

    String KeyVal() const;

                                // modify function

set new parameter value; return FALSE if invalid value

    bool Put(const String a_value);

                                // Output function

    void Print(ostream& out) const;

NON-MEMBER FUNCTIONS

output operator
    inline ostream& operator<< (ostream& os, const Param& p)

Pixel.h

HEADER FILE DESCRIPTION

Class which stores a "float" pixel value and pixel coordinates.

ENVIRONMENT

#define A_PIXEL_H

#include <iostream.h>
#include "PixelCoord.h"

CLASS DESCRIPTION

CLASS SUMMARY

class Pixel
{
public:
        Pixel();
        Pixel(float v, float x, float y);
        void SetPixel(float v, PixelCoord pc);
        void SetPixel(float v);
        void SetPixel(PixelCoord c);
        float GetPixelValue() const;
        PixelCoord GetPixelCoord() const;
        ~Pixel();
};
ostream& operator<<(ostream&, Pixel);
int operator == (const Pixel&, const Pixel&);

MEMBER FUNCTIONS

Default constructor.
        Pixel();

Constructor which sets coordinates.

        Pixel(float v, float x, float y);

Set pixel coordinate and value.

        void SetPixel(float v, PixelCoord pc);

Set pixel value.

        void SetPixel(float v);

Set pixel coordinate.

        void SetPixel(PixelCoord c);

Get pixel value.

        float GetPixelValue() const;

Get pixel coordinate.

        PixelCoord GetPixelCoord() const;

Destructor.

        ~Pixel();

NON-MEMBER FUNCTIONS

Print a Pixel.

   ostream& operator<<(ostream&, Pixel);

Compare two pixels for equality

   int operator == (const Pixel&, const Pixel&);

PixelCoord.h

HEADER FILE DESCRIPTION

The PixelCoord class is used for holding positions in the "storage" coordinates. They may have fractional values, although in general use they are restricted to integers (indexes along the coordinate axes. If the dimensions of an image are m,n, the PixelCoords range from 0 to m-1, and 0 to n-1. The valid operations essentially consist of setting and getting values. Dimensionality is implicitly 2. PixelCoords must always be positive when being used within an image but can have negative values otherwise. Therefore there is trap for negative values. It would probably be very useful to define coordinate arithmetic and comparisons on this type. (<,>,-,= etc).

ENVIRONMENT

#define PIXELCOORD_H

#include <iostream.h>
#include <assert.h>

CLASS DESCRIPTION

CLASS SUMMARY

class PixelCoord
{
public:
    PixelCoord();
    PixelCoord(float ri, float rj);
    virtual ~PixelCoord();
    virtual int Ok() const;
    void SetPixelCoord(int i, float v);
    void SetPixelCoord(float *fp);
    float GetPixelCoord(int i) const;
    float* GetPixelCoord() const;
};
ostream& operator<< (ostream&, PixelCoord);
PixelCoord operator + (const PixelCoord&, const PixelCoord&);
PixelCoord operator * (const PixelCoord&, const float);
PixelCoord operator * (const float, const PixelCoord&);
PixelCoord operator - (const PixelCoord&, const PixelCoord&);
int operator == (const PixelCoord&, const PixelCoord&);

MEMBER FUNCTIONS

The default constructor sets the positions to 0.0
    PixelCoord();

Construct at a given position

    PixelCoord(float ri, float rj);

Destructor currently does nothing

    virtual ~PixelCoord() {}

Checks the state of this object

    virtual int Ok() const;             // This object always OK

Set the location on the i'th axis. Range checks i.

    void SetPixelCoord(int i, float v);

Sets the positions on all axes. Should be a vector type so we could check the length of the vector.

    void SetPixelCoord(float *fp);

Gets the value on the i'th axis

    float GetPixelCoord(int i) const;

Returns the value on all axes (should be vector)

    float* GetPixelCoord() const;

NON-MEMBER FUNCTIONS

Print a PixelCoord

   ostream& operator<< (ostream&, PixelCoord);

Add two PixelCoords

   PixelCoord operator + (const PixelCoord&, const PixelCoord&);

Multiply a PixelCoord by a float

   PixelCoord operator * (const PixelCoord&, const float);

Multiply a float by a PixelCoord

   PixelCoord operator * (const float, const PixelCoord&);

Subtract two PixelCoords

   PixelCoord operator - (const PixelCoord&, const PixelCoord&);

Compare two PixelCoords for equality

   int operator == (const PixelCoord&, const PixelCoord&);

TelModel.h

HEADER FILE DESCRIPTION

This file contains definitions for the TelModel class.

ENVIRONMENT

#define TELMODEL_H

#include <assert.h>
#include <math.h>
#include "String.h"
#include <complex.h>
#include "GainTable.h"
#include "YegSet.h"
#include "Telescope.h"

CLASS DESCRIPTION

TelModel class.

CLASS SUMMARY

class TelModel
{
public:
    TelModel(int, float, float, float);
    ~TelModel();
    void Update(YegSet&, YegSet&);
    YegSet& Apply(const YegSet&);
    complex InterpGain(int, float);
};

MEMBER FUNCTIONS

Constructor for TelescopeModel specifying: number of receptors; time of first entry; time of last entry; time interval between entries.
    TelModel(int, float, float, float);

Destructor.

    ~TelModel();

Update this model given a pair (measured and predicted) of YegSets. This model solves for and updates its internal state. The YegSets remain unchanged.

    void Update(YegSet&, YegSet&);

Create a new, corrected, YegSet and associated Telescope from an existing YegSet by applying this model. The preexisting YegSet remains unchanged. A copy of this model is attached to the new telescope as its default model.

    YegSet& Apply(const YegSet&);
Return an interpolated gain given: a receptor number; time. This simple performs a crude linear interpolation between the two nearest entries in the gain table.
    complex InterpGain(int, float);

Telescope.h

HEADER FILE DESCRIPTION

This file contains the defintions for the Telescope class.

CLASS DESCRIPTION

The Telescope class is mainly a book-keeping class, being a convenient place to hang together pointers to objects that are used by others.

ENVIRONMENT

#define TELESCOPE_H

#include <String.h>
#include <YegSet.h>
#include <TelModel.h>
#include <ImagingModel.h>

CLASS SUMMARY

class Telescope{
public:
    Telescope(const String&);
    Telescope(const TelModel&);
    Telescope(const String&, const TelModel&);
    void SetName(const String& myName);
    const String Name();
    void SetYegs(YegSet& myYegs);
    YegSet& Yegs();
    double Coord(const String&) const;
    void SetTelMod(TelModel& myModel);
    TelModel& TelMod() const;
    void SetImMod(ImagingModel& myModel);
    ImagingModel& ImMod() const;
};

MEMBER FUNCTIONS

Construct the telescope, just giving the telescope name. In this case, the default telescope model is a null.

    Telescope(const String&);

Construct the telescope, giving just the default telescope model. In this case, the telescope name is "Unknown-Telescope" !!

    Telescope(const TelModel&);

Construct the telescope giving both the telescope name and the default model.

    Telescope(const String&, const TelModel&);

Set and return the name of the telescope.

   void SetName(const String& myName);
   const String Name();
Set and return the YegSet associated with this telescope.
    void SetYegs(YegSet& myYegs);
    YegSet& Yegs();

Inquire about coordinates of this observation. e.g. freq.

    double Coord(const String&) const;

Set and return the telescope model associated with this telescope.

    void SetTelMod(TelModel& myModel);
    TelModel& TelMod() const;
Set and return the imaging model associated with this telescope.
    void SetImMod(ImagingModel& myModel);
    ImagingModel& ImMod() const;

XYZ.h

HEADER FILE DESCRIPTION

This file contains the definitions for the XYZ position class.

ENVIRONMENT

#define XYZ_H

#include "Vector.h"
#include <assert.h>

CLASS DESCRIPTION

The XYZ position class is used to store the location of various antennas. Positions are assumed to be in an equatorial system. That is, Y axis points east, Z axis is parallel to the pole, and the X axis to defined to make a right-handed orthogonal system. Units are assumed to be nanoseconds.

CLASS SUMMARY

class XYZ
{
public:
    XYZ(int n, const double* myx, const double* myy, const double* myz);
    int Dim() const;
    double X(int i) const;
    double Y(int i) const;
    double Z(int i) const;
};

MEMBER FUNCTIONS

Construct the antenna locations from arrays of the positions. Input are the antenna locations and the number of antenna.
    XYZ(int n,                  // Number of antennas.
      const double* myx,        // Antenna locations in X.
      const double* myy,        // Antenna locations in Y.
      const double* myz)        // Antenna locations in Z.
Function to return the number of antenna.
    int Dim() const;

Functions to return the locations of the various antenna.

    double X(int i) const;
    double Y(int i) const;
    double Z(int i) const;

YegRep.h

HEADER FILE DESCRIPTION

This file contains the definitions for the YegRep class.

ENVIRONMENT

#define YEGREP_H

#include "Vector.h"
#include "AssArray.h"

declare(AssArray,DVector)

class Telescope;

CLASS DESCRIPTION

The YegRep class provides services to return telescope, data, weights and coordinates.

CLASS SUMMARY

class YegRep
{
public:
    YegRep(const Telescope&,CVector);
    YegRep(const YegRep&);
    void SetData(CVector);
    void SetWeight(RVector);
    void SetCoord(const String&,DVector);
    const Telescope& tel() const;
    int NumYegs() const;
    CVector Data() const;
    RVector Weight() const;
    DVector Coord(const String&) const;
    int CoordPresent(const String& name) const;
    int RefInc();
    int RefDec();
};

MEMBER FUNCTIONS

Construct the YegRep from a telescope and a vector of complex data.
    YegRep(const Telescope&,CVector);
The copy constructor: Make a true copy of a YegRep.
  YegRep(const YegRep&);

Overwrite the data.

  void SetData(CVector);

Initialise the weights.

    void SetWeight(RVector);

Initialise a coordinate.

    void SetCoord(const String&,DVector);

Return a reference to the associated telescope.

    const Telescope& tel() const;
Return the number of yegs.
    int NumYegs() const;
Return the vector giving the data.
    CVector Data() const;

Return a single precision vector of the weights.

    RVector Weight() const;

Return a double precision vector of a particular coordinate.

    DVector Coord(const String&) const;
Check if a particular coordinate is available.
    int CoordPresent(const String& name) const;
Allow access to the reference counting mechanism.
    int RefInc();
    int RefDec();

YegSet.h

HEADER FILE DESCRIPTION

This file contains the definitions for the YegSet class.

ENVIRONMENT

#define YEGSET_H

#include "Vector.h"
#include "String.h"
#include "YegRep.h"

class Telescope;

CLASS DESCRIPTION

The YegSet class provides services to return telescope, data, weights and coordinates.

CLASS SUMMARY

class YegSet
{
  friend class IntYegSet;
public:
    YegSet(const Telescope& tel,CVector data);
    YegSet(const YegSet& ys);
    virtual ~YegSet();
    void SetData(CVector cv);
    void SetWeight(RVector rv);
    void SetCoord(const String& name,DVector dv);
    const Telescope& tel() const;
    int NumYegs() const;
    CVector Data() const;
    RVector Weight() const;
    DVector Coord(const String& name) const;
    virtual void ShowYegSet (int i1, int i2);
    int CoordPresent(const String& name) const;
};

MEMBER FUNCTIONS

The only constructor.
    YegSet(const Telescope& tel,CVector data);
Constructed from another YegSet.
   YegSet(const YegSet& ys);

The destuctor.

  virtual ~YegSet();
Overwrite the data.
  void SetData(CVector cv);
Initialise the weights.
    void SetWeight(RVector rv);

Initialise a coordinate.

    void SetCoord(const String& name,DVector dv);

Return a reference to the associated telescope.

    const Telescope& tel() const;

Return the number of yegs.

    int NumYegs() const;
Return the vector giving the data.
    CVector Data() const;

Return a single precision vector of the weights.

    RVector Weight() const;
Return a double precision vector of a particular coordinate.
    DVector Coord(const String& name) const;

Virtual Display Function

    virtual void ShowYegSet (int i1, int i2);

Check if a particular coordinate is available.

    int CoordPresent(const String& name) const;


next up previous contents
Next: Details Up: aips++ prototype Previous: System management   Contents
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15