Main Page | Class List | Directories | File List | Class Members | File Members

ObitImage.c File Reference

ObitImage class function definitions. More...

#include "ObitImage.h"
#include "ObitIOImageFITS.h"
#include "ObitIOImageAIPS.h"
#include "ObitAIPSDir.h"
#include "ObitSystem.h"
#include "ObitMem.h"
#include "ObitHistory.h"

Functions

void ObitImageInit (gpointer in)
 Private: Initialize newly instantiated object.
void ObitImageClear (gpointer in)
 Private: Deallocate members.
ObitImagenewObitImage (gchar *name)
 Public: Constructor.
ObitImagenewObitImageScratch (ObitImage *in, ObitErr *err)
 Public: Copy Constructor for scratch file.
gconstpointer ObitImageGetClass (void)
 Public: ClassInfo pointer.
gboolean ObitImageSame (ObitImage *in1, ObitImage *in2, ObitErr *err)
 Public: Do two Imagess have the same underlying structures?.
ObitImageObitImageZap (ObitImage *in, ObitErr *err)
 Public: Delete underlying structures.
void ObitImageRename (ObitImage *in, ObitErr *err)
 Public: Rename underlying structures.
ObitImageObitImageCopy (ObitImage *in, ObitImage *out, ObitErr *err)
 Public: Copy (deep) constructor.
void ObitImageClone (ObitImage *in, ObitImage *out, ObitErr *err)
 Public: Copy structure.
void ObitImageClone2 (ObitImage *in1, ObitImage *in2, ObitImage *out, ObitErr *err)
 Public: Copy structure of in1 on grid of in2.
void ObitImageCloneMem (ObitImage *in, ObitImage *out, ObitErr *err)
 Public: Copy structure of in to memory resident Image out.
ObitIOCode ObitImageOpen (ObitImage *in, ObitIOAccess access, ObitErr *err)
 Public: Create ObitIO structures and open file.
ObitIOCode ObitImageClose (ObitImage *in, ObitErr *err)
 Public: Close file and become inactive.
void ObitImageFullInstantiate (ObitImage *in, gboolean exist, ObitErr *err)
 Public: Fully instantiate.
ObitIOCode ObitImageRead (ObitImage *in, gfloat *data, ObitErr *err)
 Public: Read specified data.
ObitIOCode ObitImageWrite (ObitImage *in, gfloat *data, ObitErr *err)
 Public: Write specified data.
ObitIOCode ObitImageGetPlane (ObitImage *in, gfloat *data, gint plane[5], ObitErr *err)
 Public: Read specified image plane.
ObitIOCode ObitImagePutPlane (ObitImage *in, gfloat *data, gint plane[5], ObitErr *err)
 Public: Write specified image plane.
ObitTablenewObitImageTable (ObitImage *in, ObitIOAccess access, gchar *tabType, glong *tabVer, ObitErr *err)
 Public: Return an associated Table.
ObitIOCode ObitImageZapTable (ObitImage *in, gchar *tabType, glong tabVer, ObitErr *err)
 Public: Destroy an associated Table.
ObitIOCode ObitImageCopyTables (ObitImage *in, ObitImage *out, gchar **exclude, gchar **include, ObitErr *err)
 Public: Copy associated Tables.
ObitIOCode ObitImageUpdateTables (ObitImage *in, ObitErr *err)
 Public: Update disk resident tables information.
ObitIOCode ObitImageIOSet (ObitImage *in, ObitErr *err)
 Reposition IO to beginning of file.
void ObitImageSetBeamName (ObitImage *image, ObitErr *err)
 Public: Set name etc for a beam associated with an image.
void ObitImageWriteKeyword (ObitImage *in, gchar *name, ObitInfoType type, gint32 *dim, gconstpointer data, ObitErr *err)
 Public: Write header keyword.
void ObitImageReadKeyword (ObitImage *in, gchar *name, ObitInfoType *type, gint32 *dim, gpointer data, ObitErr *err)
 Public: Read header keyword.
void ObitImageClassInit (void)
 Public: Class initializer.


Detailed Description

ObitImage class function definitions.

This class is derived from the ObitData base class.

This class contains an astronomical image and allows access. An ObitImage is the front end to a persistent disk resident structure.


Function Documentation

ObitImage* newObitImage gchar *  name  ) 
 

Public: Constructor.

Initializes class if needed on first call.

Parameters:
name An optional name for the object.
Returns:
the new object.

ObitImage* newObitImageScratch ObitImage in,
ObitErr err
 

Public: Copy Constructor for scratch file.

A scratch Image is more or less the same as a normal Image except that it is automatically deleted on the final unreference. The output will have the underlying files of the same type as in already allocated.

Parameters:
in The object to copy, info may have
  • ScrSize OBIT_int (?,1,1) Dimension of the desired scratch Image
err Error stack, returns if not empty.
Returns:
pointer to the new object.

ObitTable* newObitImageTable ObitImage in,
ObitIOAccess  access,
gchar *  tabType,
glong *  tabVer,
ObitErr err
 

Public: Return an associated Table.

If such an object exists, a reference to it is returned, else a new object is created and entered in the ObitTableList.

Parameters:
in Pointer to object with associated tables. This MUST have been opened before this call.
access access (OBIT_IO_ReadOnly,OBIT_IO_ReadWrite, or OBIT_IO_WriteOnly). This is used to determine defaulted version number and a different value may be used for the actual Open.
tabType The table type (e.g. "AIPS CC").
tabVer Desired version number, may be zero in which case the highest extant version is returned for read and the highest+1 for write.
err ObitErr for reporting errors.
Returns:
pointer to created ObitTable, NULL on failure.

void ObitImageClassInit void   ) 
 

Public: Class initializer.

void ObitImageClear gpointer  inn  ) 
 

Private: Deallocate members.

Does (recursive) deallocation of parent class members.

Parameters:
inn Pointer to the object to deallocate. Actually it should be an ObitImage* cast to an Obit*.

void ObitImageClone ObitImage in,
ObitImage out,
ObitErr err
 

Public: Copy structure.

Output version set to floating pixels

Parameters:
in The object to copy, info may have
out An existing object pointer for output, info may have
  • Size OBIT_int (?,1,1) Dimension of the desired Image
err Error stack, returns if not empty.

void ObitImageClone2 ObitImage in1,
ObitImage in2,
ObitImage out,
ObitErr err
 

Public: Copy structure of in1 on grid of in2.

Only sets descriptor and data buffer members on out. Suitable for memory only image, out->mySel->FileType set to OBIT_IO_MEM. Returns without error if in1 cannot be projected onto in2. Routine translated from the AIPSish 4MASS/SUB/FLATEN.FOR/FLTMSC

Parameters:
in1 Image whose region is to be covered, must have actual descriptor
in2 Image whose geometry is to be copied , must have actual descriptor
out An existing object pointer for output. If the image (FArray) member exists, it is resized if needed. Descriptor updated to reflect any resizing
err Error stack, returns if not empty.

void ObitImageCloneMem ObitImage in,
ObitImage out,
ObitErr err
 

Public: Copy structure of in to memory resident Image out.

out->mySel->FileType set to OBIT_IO_MEM.

Parameters:
in Image to be duplicated
out An existing object pointer for output. If the image (FArray) member exists, it is resized if needed. Descriptor updated to reflect any resizing
err Error stack, returns if not empty.

ObitIOCode ObitImageClose ObitImage in,
ObitErr err
 

Public: Close file and become inactive.

Parameters:
in Pointer to object to be closed.
err ObitErr for reporting errors.
Returns:
error code, OBIT_IO_OK=> OK

ObitImage* ObitImageCopy ObitImage in,
ObitImage out,
ObitErr err
 

Public: Copy (deep) constructor.

Copies are made of complex members including disk files; these will be copied applying whatever selection is associated with the input. Objects should be closed on input and will be closed on output. In order for the disk file structures to be copied, the output file must be sufficiently defined that it can be written. The copy will be attempted but no errors will be logged until both input and output have been successfully opened. ObitInfoList and ObitThread members are only copied if the output object didn't previously exist. Parent class members are included but any derived class info is ignored.

Parameters:
in The object to copy
out An existing object pointer for output or NULL if none exists.
err Error stack, returns if not empty.
Returns:
pointer to the new object.

ObitIOCode ObitImageCopyTables ObitImage in,
ObitImage out,
gchar **  exclude,
gchar **  include,
ObitErr err
 

Public: Copy associated Tables.

Parameters:
in The ObitImage with tables to copy.
out An ObitImage to copy the tables to, old ones replaced.
exclude a NULL termimated list of table types NOT to copy. If NULL, use include
include a NULL termimated list of table types to copy. ignored if exclude nonNULL.
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK=> OK

void ObitImageFullInstantiate ObitImage in,
gboolean  exist,
ObitErr err
 

Public: Fully instantiate.

If object has previously been opened, as demonstrated by the existance of its myIO member, this operation is a no-op. Virtual - calls actual class member

Parameters:
in Pointer to object
exist TRUE if object should previously exist, else FALSE
err ObitErr for reporting errors.
Returns:
error code, OBIT_IO_OK=> OK

gconstpointer ObitImageGetClass void   ) 
 

Public: ClassInfo pointer.

Returns:
pointer to the class structure.

ObitIOCode ObitImageGetPlane ObitImage in,
gfloat *  data,
gint  plane[5],
ObitErr err
 

Public: Read specified image plane.

If the object is open on call it is returned open, otherwise closed. The ObitImageDesc maintains the current location in the image. This is a NOP if in is a memory only image Note: the underlying routines need more work for > 3 dimensions, descriptor plane needs to be turned into an array.

Parameters:
in Pointer to object to be read.
data Pointer to buffer to write results. if NULL, use the image member of in.
plane 5 element array giving pixel numbers (1-rel) on axes 3-7
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK => OK

void ObitImageInit gpointer  inn  ) 
 

Private: Initialize newly instantiated object.

Parent classes portions are (recursively) initialized first

Parameters:
inn Pointer to the object to initialize.

ObitIOCode ObitImageIOSet ObitImage in,
ObitErr err
 

Reposition IO to beginning of file.

Parameters:
in Pointer to object to be rewound.
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK=> OK

ObitIOCode ObitImageOpen ObitImage in,
ObitIOAccess  access,
ObitErr err
 

Public: Create ObitIO structures and open file.

The image descriptor is read if OBIT_IO_ReadOnly or OBIT_IO_ReadWrite and written to disk if opened OBIT_IO_WriteOnly. Update for selection (blc,trc) is only done on OBIT_IO_ReadOnly . After the file has been opened, the member image is initialized for storing the image unless member extBuffer is TRUE. The file etc. info should have been stored in the ObitInfoList: "FileType" OBIT_int scalar = OBIT_IO_FITS or OBIT_IO_AIPS or OBIT_IO_MEM (no persistent form ) for file type.

Parameters:
in Pointer to object to be opened.
access access (OBIT_IO_ReadOnly,OBIT_IO_ReadWrite or OBIT_IO_WriteOnly).
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK=> OK

ObitIOCode ObitImagePutPlane ObitImage in,
gfloat *  data,
gint  plane[5],
ObitErr err
 

Public: Write specified image plane.

If the object is open on call it is returned open, otherwise closed. The ObitImageDesc maintains the current location in the image. This is a NOP if in is a memory only image Note: the underlying routines need more work for > 3 dimensions, descriptor plane needs to be turned into an array.

Parameters:
in Pointer to object to be read.
data Pointer to buffer with pixel data if NULL, use the image member of in.
plane 5 element array giving pixel numbers (1-rel) on axes 3-7
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK => OK

ObitIOCode ObitImageRead ObitImage in,
gfloat *  data,
ObitErr err
 

Public: Read specified data.

Reads row in->myDesc->row + 1; plane in->myDesc->plane + 1 A series of calls will read sequential sections of the image, either a row at a time or a plane at a time as specified to ObitImageOpen. The ObitImageDesc maintains the current location in the image. This is a NOP if in is a memory only image

Parameters:
in Pointer to object to be read.
data pointer to buffer to write results. if NULL, use the image member of in.
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK => OK

void ObitImageReadKeyword ObitImage in,
gchar *  name,
ObitInfoType *  type,
gint32 *  dim,
gpointer  data,
ObitErr err
 

Public: Read header keyword.

Parameters:
in object to update, must be fully instantiated
name [out] The label (keyword) of the information. Max 8 char
type [out] Data type of data element (enum defined in ObitInfoList class).
dim [out] Dimensionality of datum. Only scalars and strings up to 8 char are supported Note: for strings, the first element is the length in char.
data [out] Pointer to the data.
err ObitErr for reporting errors.

void ObitImageRename ObitImage in,
ObitErr err
 

Public: Rename underlying structures.

For FITS files:

  • "newFileName" OBIT_string (?,1,1) New Name of disk file.
For AIPS:
  • "newName" OBIT_string (12,1,1) New AIPS Name Blank = don't change
  • "newClass" OBIT_string (6,1,1) New AIPS Class Blank = don't changeO
  • "newSeq" OBIT_int (1,1,1) New AIPS Sequence 0 => unique value
    Parameters:
    in Pointer to object to be renamed.
    err ObitErr for reporting errors.

gboolean ObitImageSame ObitImage in1,
ObitImage in2,
ObitErr err
 

Public: Do two Imagess have the same underlying structures?.

This test is done using values entered into the ObitInfoList in case the object has not yet been opened.

Parameters:
in1 First object to compare
in2 Second object to compare
err ObitErr for reporting errors.
Returns:
TRUE if to objects have the same underlying structures else FALSE

void ObitImageSetBeamName ObitImage image,
ObitErr err
 

Public: Set name etc for a beam associated with an image.

Parameters:
image Image whose beam name is to be set
err ObitErr stack for reporting problems.

ObitIOCode ObitImageUpdateTables ObitImage in,
ObitErr err
 

Public: Update disk resident tables information.

Parameters:
in Pointer to object to be updated.
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK=> OK

ObitIOCode ObitImageWrite ObitImage in,
gfloat *  data,
ObitErr err
 

Public: Write specified data.

Writes row in->myDesc->row + 1; plane in->myDesc->plane + 1 A series of calls will write sequential sections of the image, either a row at a time or a plane at a time as specified to ObitImageOpen. The ObitImageDesc maintains the current location in the image. This is a NOP if in is a memory only image

Parameters:
in Pointer to object to be written.
data pointer to buffer containing input data. if NULL, use the image member of in.
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK=> OK

void ObitImageWriteKeyword ObitImage in,
gchar *  name,
ObitInfoType  type,
gint32 *  dim,
gconstpointer  data,
ObitErr err
 

Public: Write header keyword.

Parameters:
in object to update, must be open during call with Write access
name The label (keyword) of the information. Max 8 char
type Data type of data element (enum defined in ObitInfoList class).
dim Dimensionality of datum. Only scalars and strings up to 8 char are allowed Note: for strings, the first element is the length in char.
data Pointer to the data.
err ObitErr for reporting errors.

ObitImage* ObitImageZap ObitImage in,
ObitErr err
 

Public: Delete underlying structures.

Parameters:
in Pointer to object to be zapped.
err ObitErr for reporting errors.
Returns:
pointer for input object, NULL if deletion successful

ObitIOCode ObitImageZapTable ObitImage in,
gchar *  tabType,
glong  tabVer,
ObitErr err
 

Public: Destroy an associated Table.

The table is removed from the ObitTableList but the external form may not be updated.

Parameters:
in Pointer to object with associated tables.
tabType The table type (e.g. "AIPS CC").
tabVer Desired version number, may be zero in which case the highest extant version is returned for read and the highest+1 for write. -1 => all versions of tabType
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK=> OK


Generated on Fri Aug 31 22:13:06 2007 for Obit by  doxygen 1.3.9.1