Main Page   Compound List   File List   Compound Members  

Fits Class Reference

A class to handle up to 3-dimensional marices. More...

#include <fits.h>

List of all members.

Public Methods

 Fits ()
 Fits (Fits &)
 ~Fits ()
bool create (int x, int y, FitsBitpix t=R4)
bool create (int x, int y, int z, FitsBitpix t=R4)
bool recreate (int x, int y)
bool recreate (int x, int y, int z)
bool copy (const Fits &)
void copyIndex (ULONG, ULONG)
void swapIndex (ULONG, ULONG)
void operator= (const Fits &a)
bool OpenFITS (const char *fname)
bool CreateFITS (const char *fname)
void CloseFITS ()
bool ReadFITSData (ULONG=0, ULONG=0, ULONG=0, ULONG=0, ULONG=0, ULONG=0)
bool ReadFITSCubeImage (int which)
bool WriteFITSData (void)
bool ReadFITS (const char *fname, ULONG=0, ULONG=0, ULONG=0, ULONG=0, ULONG=0, ULONG=0)
bool ReadFITSExtension (const char *fname, int ext, ULONG=0, ULONG=0, ULONG=0, ULONG=0, ULONG=0, ULONG=0)
bool WriteFITS (const char *fname)
bool updateHeader (void)
bool getHeaderInformation ()
bool isSHARPIdata ()
void convertSHARPIdata ()
bool WriteBMP (const char *fname)
void InitHeader (void)
bool SetIntKey (const char *, int, const char *=NULL)
bool SetIntKeys (const char *, int *, int)
bool SetFloatKey (const char *, double, const char *=NULL)
bool SetFloatKeys (const char *, double *, int)
bool SetStringKey (const char *, const char *, const char *=NULL)
bool SetStringKeys (const char *, char **, int)
bool GetIntKey (const char *, int *)
bool GetIntKeys (const char *, int *, int)
bool GetFloatKey (const char *, double *) const
bool GetFloatKeys (const char *, double *, int)
bool GetStringKey (const char *, char *)
bool GetStringKeys (const char *, char **, int)
bool DeleteKey (const char *)
bool InsertLine (const char *)
int ReadFitsHeader (gzFile gfd)
int ReadFitsExtensionHeader (gzFile gfd, int extendNumber)
bool WriteFitsHeader (FILE *fd)
void CopyHeader (const Fits &)
char * GetHeader () const
bool GetHeaderExtend ()
bool allocateMemory (size_t=0)
void setCasts ()
bool matches (const Fits &a)
ULONG Nelements (void) const
long Naxis (const UCHAR which) const
void setNaxis (const UCHAR which, const long what)
double ValueAt (const ULONG index) const
bool fits_error (char *msg)
void Progress (int percent)
int at (const int x, const int y, const int z=1) const
bool setValue (double v, int x, int y, int z=1)
bool add (const double &a)
bool sub (const double &a)
bool mul (const double &a)
bool div (const double &a)
bool power (const double &a)
bool ipower (const double &a)
bool add (const Fits &a)
bool sub (const Fits &a)
bool mul (const Fits &a)
bool div (const Fits &a)
bool power (const Fits &a)
double operator[] (const ULONG &a)
double operator() (const ULONG &a)
double operator() (const ULONG &a, const ULONG &b)
double operator() (const ULONG &a, const ULONG &b, const ULONG &c)
void operator= (const double &a)
Fits & operator^= (const float &r)
bool Sin (bool=TRUE)
bool Cos (bool=TRUE)
bool Tan (bool=TRUE)
bool Sinh (bool=TRUE)
bool Cosh (bool=TRUE)
bool Tanh (bool=TRUE)
bool Asin (bool=TRUE)
bool Acos (bool=TRUE)
bool Atan (bool=TRUE)
bool Asinh (bool=TRUE)
bool Acosh (bool=TRUE)
bool Atanh (bool=TRUE)
bool Exp ()
bool Log (const double &base=10.0)
bool Ln ()
bool Sqrt ()
bool Abs ()
bool ginvert ()
Fits & invert ()
bool checkRange (int *, int *, int *, int *, int *, int *)
bool setRange (double value, int x1, int x2, int y1, int y2, int z1=1, int z2=-1)
bool setRange (Fits &value, int x1, int x2, int y1, int y2, int z1=1, int z2=-1)
bool extractRange (Fits &result, int x1, int x2, int y1, int y2, int z1, int z2)
bool extractRange (Fits &result, Fits &indices)
bool addRange (double v, int n, long *x)
bool addRange (const Fits &f, int n, long *x)
void deflate (void)
bool norm (void)
bool norf (int nfact)
bool clip (double lo, double hi)
bool inclip (double lo, double hi, double value)
void limits (long *, long *, long *=NULL, long *=NULL, long *=NULL, long *=NULL)
void max_pixel (int *x, int *y, int r)
double max_pos (int *x, int *y, int *z=NULL)
void max_pos_in_mask (int *x, int *y, const Fits &mask)
void min_pos (int *x, int *y, int *z=NULL)
void centroid (double *x, double *y, double *z=NULL)
bool centroids (Fits &result, Fits &positions, int radius)
bool maxima (Fits &positions, int radius, int flag=0, float fraction=1.0)
double get_max (void)
double get_min (void)
void get_minmax (double *min, double *max)
void get_minmax (double *min, double *max, double ignore)
double get_flux (bool check=FALSE, ULONG *nv=NULL)
bool histogram (Fits &data, double min, double max, double binsize=0.0)
bool histeq (Fits &data, double min, double max)
bool sort (Fits &result, bool=FALSE)
bool createFitsIndex (const Fits &array, bool reverse=FALSE)
bool createStringIndex (const QString &, bool=FALSE)
bool createStringArrayIndex (const QStringList &stringarray, bool reverse=FALSE)
void makeStat (double *min, double *max, double *flux, double *avg)
bool qgauss (int n1, int n2, float xcen, float ycen, float fwhm, int speed)
bool gauss (int n1, int n2, float xcen, float ycen, float fwhm1, float fwhm2=-1.0, float angle=0.0)
bool ellipse (int n1, int n2, float xcen, float ycen, float fwhm1, float fwhm2=-1.0, float angle=0.0)
bool circle (int n1, int n2, float xcen, float ycen, float radius)
bool airy (int n1, int n2, float dia, float scl, float wav)
bool lftf (int n1, int n2, float x1)
bool hftf (int n1, int n2, float x1)
bool cosbell (int n1, int n2, float xcen, float ycen, float radius1, float radius2)
bool chinese_hat (int n1, int n2, float xcen, float ycen, float r)
bool rect (int n1, int n2, int xcen, int ycen, int width, int height)
bool delta (int n1, int n2, int x, int y)
void conj (void)
bool rot90 (int angle)
bool flip (int axes)
bool reass (void)
bool fft (void)
bool mosaic (const char *fname)
bool mosaic (QStringList, float *, float *, float *=NULL)
bool ishift (int ssx, int ssy, int ssz)
bool fshift (float ssx, float ssy, int flag)
bool lineshift (int line, float s, int axis)
bool wrap (int ssx, int ssy, int ssz)
bool CubeMedian (const Fits &cube)
bool CubeMedian (const Fits &cube, float reject)
bool CubeMedian (const char *, int=1, int=0)
bool CubeMedian (const char *, double reject)
bool enlarge (int scale, int flag=0)
void shrink (int fact=2)
bool resize (int new1=-1, int new2=-1, int new3=-1)
bool rebin (int new1, int new2)
void cblank (double v=0.0)
void czero (double v=0.0)
bool CubeAverage (const QStringList &)
bool CubeMinimum (const Fits &)
bool CubeMaximum (const Fits &)
bool CubeSum (const Fits &, int first=1, int last=0)
bool CubeMerge (const char *outname, QStringList &innames)
bool ravg (char *templ, int first, int last)
bool sssa (const char *fname, Fits stats, int method, Fits *sky, Fits *flat, Fits *dpl, Fits *mask)
int F_I (long x, long y=1, long z=1) const
int C_I (long x, long y=0, long z=0)

Static Public Methods

bool WriteBMP (const char *fname, Fits &red, Fits &green, Fits &blue)

Private Attributes

char * header
int HeaderLength


Detailed Description

A class to handle up to 3-dimensional marices.

The FITS class provides all the standard operations on matrices. Those include addition, subtraction, multiplication, division, but also taking sine, cosine, ... of a complete matrix.

Filter creation functions are provided for circular, elliptical, ... filters.


Constructor & Destructor Documentation

Fits::Fits  
 

Constructor; we only supply one since constructors don't allow for reporting errors

Fits::Fits Fits &    a
 

Constructor; We need to supply this one in order to be able to use temporary classes

Fits::~Fits  
 

Destructor


Member Function Documentation

bool Fits::Abs  
 

Absolute value of all array elements. If the array is of complex type (C16), it will be changed to double (R8). If the array is of integer type, it will be changed to float (R4).

Returns:
TRUE if successful, FALSE otherwise.

bool Fits::Acos bool    radians = TRUE
 

Arcus Cosine of all array elements. If the array is of integer type, it will be changed to float (R4). If the minimum value of array elements is < -1.0 or the maximum is > 1.0, the array type will be changed to complex (C16).

Returns:
TRUE if successful, FALSE otherwise.

bool Fits::Acosh bool    radians = TRUE
 

Arcus Cosine hyperbolicus of all array elements. If the array is of integer type, it will be changed to float (R4). If the minimum value of array elements is < 1.0 the array type will be changed to complex (C16).

Returns:
TRUE if successful, FALSE otherwise.

bool Fits::add const Fits &    a
 

Add an array to the array (Pixel by pixel). If the number of axes in the current array is exactly one greater than in a, we will loop over the current array. If membits of the current array is I1, I2, or I4, it will be changed to at least R4, or to whatever a.membits is. This is in order to assure no loss in data.

bool Fits::add const double &    a
 

Add a constant to the array. If the array is of integer type (i.e. membits = I1, I2 or I4), this is very fast since only the bzero entry is modified.

bool Fits::addRange const Fits &    f,
int    n,
long *    x
 

Add the Fits f to a part of the array.

bool Fits::addRange double    v,
int    n,
long *    x
 

Add the constant v to a part of the array.

bool Fits::airy int    n1,
int    n2,
float    dia,
float    scl,
float    wav
 

Create an airy function at the center of the array.

bool Fits::allocateMemory size_t    s = 0
 

(Re)allocate of memory and update the pointers to data.

bool Fits::Asin bool    radians = TRUE
 

Arcus Sine of all array elements. If the array is of integer type, it will be changed to float (R4). If the minimum value of array elements is < -1.0 or the maximum is > 1.0, the array type will be changed to complex (C16).

Returns:
TRUE if successful, FALSE otherwise.

bool Fits::Asinh bool    radians = TRUE
 

Arcus Sine hyperbolicus of all array elements. If the array is of integer type, it will be changed to float (R4).

Returns:
TRUE if successful, FALSE otherwise.

int Fits::at const int    x,
const int    y,
const int    z = 1
const [inline]
 

Return linear index of array element x, y, z (fortran-notation)

bool Fits::Atan bool    radians = TRUE
 

Arcus Tangent of all array elements. If the array is of integer type, it will be changed to float (R4).

Returns:
TRUE if successful, FALSE otherwise.

bool Fits::Atanh bool    radians = TRUE
 

Arcus Tangent hyperbolicus of all array elements. If the array is of integer type, it will be changed to float (R4). If the minimum value of array elements is <= -1.0 or the maximum is >= 1.0, the array type will be changed to complex (C16).

Returns:
TRUE if successful, FALSE otherwise.

int Fits::C_I long    x,
long    y = 0,
long    z = 0
[inline]
 

Return the linear index of the array element at [x, y, z] (C-notation)

void Fits::cblank double    v = 0.0
 

Replace all values which do not represent a value (i.e. which are NaN or INF) by v.

void Fits::centroid double *    x,
double *    y,
double *    z = NULL
 

Return the centroid of the array (fortran-notation).

bool Fits::centroids Fits &    result,
Fits &    positions,
int    radius
 

Return an array of centroids around given pixel coordinates.

bool Fits::checkRange int *    x1,
int *    x2,
int *    y1,
int *    y2,
int *    z1,
int *    z2
 

Check the range given by integer arguments, and replace -1's by correct values

bool Fits::chinese_hat int    n1,
int    n2,
float    xcen,
float    ycen,
float    r
 

Create a chinese hat function

bool Fits::circle int    n1,
int    n2,
float    xcen,
float    ycen,
float    radius
 

create a 2-dimensional circle with bitpix = 8

bool Fits::clip double    lo,
double    hi
 

Clip: All values below lo will be set to lo, all values above hi will be set to hi.

If hi < lo, only values lower than lo will be clipped.

void Fits::CloseFITS  
 

Close a previously opened FITS file. If the file was opened for read/write, append enough 0's so its total length is an integer multiple of 2880 bytes (FITS standard).

void Fits::conj void   
 

If a complex array, replace all values by its complex conjugate. Does nothing for any other array type.

void Fits::convertSHARPIdata  
 

Convert SHARP I data to valid FITS format: SHARP I data is unsigned short, which does not exist in FITS standard. So we subtract 32767 from each pixel and typecast to signed short. The data values represent the correct values if we also set bzero to 32767 and bscale to 1.0.

bool Fits::copy const Fits &    a
 

Copies a Fits.

void Fits::CopyHeader const Fits &    source
 

Copies a FITS header

void Fits::copyIndex ULONG    dest,
ULONG    source
 

Copy the value at array index source to array index dest.

bool Fits::Cos bool    radians = TRUE
 

Cosine of all array elements. If the array is of integer type, it will be changed to float (R4).

Returns:
TRUE if successful, FALSE otherwise.

bool Fits::cosbell int    n1,
int    n2,
float    xcen,
float    ycen,
float    radius1,
float    radius2
 

Create a cosine bell function

bool Fits::Cosh bool    radians = TRUE
 

Cosine hyperbolicus of all array elements. If the array is of integer type, it will be changed to float (R4).

Returns:
TRUE if successful, FALSE otherwise.

bool Fits::create int    x,
int    y,
int    z,
FitsBitpix    t = R4
 

Create a Fits cube (3-dimensional).

bool Fits::create int    x,
int    y,
FitsBitpix    t = R4
 

Create a Fits image (2-dimensional).

bool Fits::CreateFITS const char *    fname
 

Open a FITS file for WRITING

bool Fits::createFitsIndex const Fits &    array,
bool    reverse = FALSE
 

Create an index table of the array in ascending or descending order.

bool Fits::createStringArrayIndex const QStringList &    stringarray,
bool    reverse = FALSE
 

Create an index table of the string in ascending or descending order.

bool Fits::createStringIndex const QString &    string,
bool    reverse = FALSE
 

Create an index table of the string in ascending or descending order.

bool Fits::CubeAverage const QStringList &    files
 

Take a fits cube and do an average of the images therein.

bool Fits::CubeMaximum const Fits &    cube
 

Go through the cube and select the maximum of each pixel in the 3rd dimension. Returns an image.

bool Fits::CubeMedian const char *    fname,
double    reject
 

Take a fits cube and do a median of the images therein. This version reads parts of the single images consecutively from disk in order to save memory. (the maximum amount of memory allocated is define below.)

bool Fits::CubeMedian const char *    fname,
int    first = 1,
int    last = 0
 

Take a fits cube and do a median of the images therein. This version reads parts of the single images consecutively from disk in order to save memory. (the maximum amount of memory allocated is define below.)

bool Fits::CubeMedian const Fits &    cube,
float    reject
 

Go through the cube and select the median of each pixel in the 3rd dimension. Returns an image. Values which correspond to reject are discarded.

bool Fits::CubeMedian const Fits &    cube
 

Go through the cube and select the median of each pixel in the 3rd dimension. Returns an image.

bool Fits::CubeMerge const char *    outname,
QStringList &    innames
 

Take a number of FITS cubes and write them to disk as a single FITS cube.

bool Fits::CubeMinimum const Fits &    cube
 

Go through the cube and select the minimum of each pixel in the 3rd dimension. Returns an image.

bool Fits::CubeSum const Fits &    cube,
int    first = 1,
int    last = 0
 

Go through the cube and add all pixels up. Returns an image.

void Fits::czero double    v = 0.0
 

Replace all values which are equal to zero by v.

void Fits::deflate void   
 

Remove all axis information of axes whose length is 1.

bool Fits::DeleteKey const char *    key
 

Delete a key.

bool Fits::delta int    n1,
int    n2,
int    x,
int    y
 

create a delta function

bool Fits::div const Fits &    a
 

Divide one array by another (Pixel by pixel). If the number of axes in the current array is exactly one greater than in a, we will loop over the current array. If membits of the current array is I1, I2, or I4, it will be changed to at least R4, or to whatever a.membits is. This is in order to assure no loss in data.

bool Fits::div const double &    a
 

Divide the array by a constant. If the array is of integer type (i.e. membits = I1, I2 or I4), this is very fast since only the bzero and bscale entries are modified.

bool Fits::ellipse int    n1,
int    n2,
float    xcen,
float    ycen,
float    fwhm1,
float    fwhm2 = -1.0,
float    angle = 0.0
 

create a 2-dimensional elliptical with bitpix = 8 if fwhm2 < 0, it will be a circle

bool Fits::enlarge int    scale,
int    flag = 0
 

Enlarge the array by an integer amount Keep flux constant flag can have 2 values: 0: Center original image 1: Center original image, edge values are mean of edge 2: Blow up pixels

bool Fits::Exp  
 

Exponential of all array elements. If the array is of integer type, it will be changed to float (R4).

Returns:
TRUE if successful, FALSE otherwise.

bool Fits::extractRange Fits &    result,
Fits &    indices
 

extract part of the array, indices given by another FITS

bool Fits::extractRange Fits &    result,
int    x1,
int    x2,
int    y1,
int    y2,
int    z1,
int    z2
 

extract part of the array

int Fits::F_I long    x,
long    y = 1,
long    z = 1
const [inline]
 

Return the linear index of the array element at [x, y, z] (fortran-notation)

bool Fits::fft void   
 

Perform the forward Fast Fourier Transform if the array is float Perform the inverse Fast Fourier Transform if the array is complex This uses the FFTW package

bool Fits::fits_error char *    msg [inline]
 

error message reporting

bool Fits::flip int    axes
 

flip about specified axis

bool Fits::fshift float    ssx,
float    ssy,
int    method
 

sub-pixel shift the complete array

float ssx, ssy are the shift vectors int method can have the following values: 0: Take weighted mean of next pixels 1: Use fft 2...: Use n-th order polynomial approximation

bool Fits::gauss int    n1,
int    n2,
float    xcen,
float    ycen,
float    fwhm1,
float    fwhm2 = -1.0,
float    angle = 0.0
 

create a 2-dimensional elliptical gaussian with bitpix = -32 if fwhm2 < 0, it will be a circular gaussian

double Fits::get_flux bool    check = FALSE,
ULONG *    nv = NULL
 

Return the total value.

double Fits::get_max void   
 

Return the maximum value.

double Fits::get_min void   
 

Return the minimum value.

void Fits::get_minmax double *    min,
double *    max,
double    ignore
 

Compute minimum and maximum values, ignoring one value.

void Fits::get_minmax double *    min,
double *    max
 

Compute minimum and maximum values.

bool Fits::GetFloatKey const char *    key,
double *    value
const
 

Get a floating point key.

bool Fits::GetFloatKeys const char *    base,
double *    values,
int    n
 

Get several floating point keys. The key name is generated from base and the numbers 1...n, where n < 10.

char * Fits::GetHeader   const
 

Return a pointer to the string representing the header.

bool Fits::GetHeaderExtend  
 

Determine if the file contains a FITS extension.

bool Fits::getHeaderInformation  
 

Update local variables to that of the FITS header

bool Fits::GetIntKey const char *    key,
int *    value
 

Get an integer key

bool Fits::GetIntKeys const char *    base,
int *    values,
int    n
 

Get several integer keys. The key name is generated from base and the numbers 1...n, where n < 10.

bool Fits::GetStringKey const char *    key,
char *    value
 

Get a string key.

bool Fits::GetStringKeys const char *    base,
char **    values,
int    n
 

Get several string keys. The key name is generated from base and the numbers 1...n, where n < 10.

bool Fits::ginvert  
 

Invert a 2D-matrix

bool Fits::hftf int    n1,
int    n2,
float    x1
 

Create a 2-dimensional high transfer function

bool Fits::histeq Fits &    data,
double    min,
double    max
 

Create a histogram equalization of an image with 256 entries.

bool Fits::histogram Fits &    data,
double    min,
double    max,
double    binsize = 0.0
 

Create a histogram of the data.

bool Fits::inclip double    lo,
double    hi,
double    value
 

Inclusive clipping: All values between lo and hi will be set to value.

void Fits::InitHeader void   
 

Constructor: Allocates minimum space for a FITS conforming header (2880 bytes). The first line is set to "SIMPLE = T", the last to "END"

bool Fits::InsertLine const char *    line
 

Insert a line in the FITS header. If no space is left, the header is expanded by 2880 bytes, according to the FITS standard.

Fits& Fits::invert   [inline]
 

Replace all values by 1/value

bool Fits::ipower const double &    a
 

Raise a constant to the power of the array. If the array is of integer type (i.e. membits = I1, I2 or I4), it will be changed to R4. If any resulting array value is complex, the array type will be changed to C16.

bool Fits::ishift int    ssx,
int    ssy,
int    ssz
 

Shift the array by an integer amount

bool Fits::isSHARPIdata  
 

Find out if the header represents SHARP I data: This is the case, if: 1> The keys INSTRUME and BITPIX do exist and have "SHARPI " and 16, respectively 2> The keys BSCALE and BZERO don't exist.

bool Fits::lftf int    n1,
int    n2,
float    x1
 

Create a 2-dimensional low transfer function

void Fits::limits long *    xlow,
long *    xhigh,
long *    ylow = NULL,
long *    yhigh = NULL,
long *    zlow = NULL,
long *    zhigh = NULL
 

Return limits for which the array is non-zero.

bool Fits::lineshift int    line,
float    s,
int    axis
 

sub-pixel shift one single line in the array

bool Fits::Ln  
 

Natural logarithm of all array elements. If the array is of integer type, it will be changed to float (R4). If the minimum value of array elements is <= 0.0, the array type will be changed to complex (C16).

Returns:
TRUE if successful, FALSE otherwise.

bool Fits::Log const double &    base = 10.0
 

Logarithm of all array elements to the base (default 10). If the array is of integer type, it will be changed to float (R4). If the minimum value of array elements is <= 0.0, the array type will be changed to complex (C16).

Returns:
TRUE if successful, FALSE otherwise.

void Fits::makeStat double *    min,
double *    max,
double *    flux,
double *    avg
 

Return minimum, maximum, total value and average value.

bool Fits::matches const Fits &    a [inline]
 

Compare to another Fits structure

void Fits::max_pixel int *    x,
int *    y,
int    r
 

Return pixel coordinates of brightest pixel around (x, y) within a search box of radius r.

double Fits::max_pos int *    x,
int *    y,
int *    z = NULL
 

Return the index of the pixel with the highest value (fortran-notation).

void Fits::max_pos_in_mask int *    x,
int *    y,
const Fits &    mask
 

Return the index of the pixel with the highest value within a mask (fortran-notation).

bool Fits::maxima Fits &    positions,
int    radius,
int    flag = 0,
float    fraction = 1.0
 

Find local maxima in the Fits around a given radius. Flag can have 3 values: Flag = 0 means search in a circle Flag = 1 means search in a box Flag = 2 means search for maxima without a given set of positions

void Fits::min_pos int *    x,
int *    y,
int *    z = NULL
 

Return the index of the pixel with the lowest value (fortran-notation).

bool Fits::mosaic QStringList    files,
float *    xshift,
float *    yshift,
float *    scale = NULL
 

Make a mosaic of the images specified.

bool Fits::mosaic const char *    fname
 

Put together images specified in the file pointed to by fname File format: 3(4) Columns: Filename, xshift, yshift, (scale factor) Negative Shifts result in clipping of the image

bool Fits::mul const Fits &    a
 

Multiply an array to the array (Pixel by pixel). If the number of axes in the current array is exactly one greater than in a, we will loop over the current array. If membits of the current array is I1, I2, or I4, it will be changed to at least R4, or to whatever a.membits is. This is in order to assure no loss in data.

bool Fits::mul const double &    a
 

Multiply a constant to the array. If the array is of integer type (i.e. membits = I1, I2 or I4), this is very fast since only the bzero and bscale entries are modified.

long Fits::Naxis const UCHAR    which const [inline]
 

Length of specified axes

ULONG Fits::Nelements void    const [inline]
 

Number of elements

bool Fits::norf int    nfact
 

Normalize: if nfact is 1, the average value will be 1, else the total value will be 1.

bool Fits::norm void   
 

Normalize array, i.e. all values will be scaled to lie between 0 and 1.

bool Fits::OpenFITS const char *    fname
 

Open a FITS file for READ ONLY

double Fits::operator() const ULONG &    a,
const ULONG &    b,
const ULONG &    c
[inline]
 

Return value of array element at (a, b, c) (fortran-notation)

double Fits::operator() const ULONG &    a,
const ULONG &    b
[inline]
 

Return value of array element at (a, b) (fortran-notation)

double Fits::operator() const ULONG &    a [inline]
 

Return value at linear index position

void Fits::operator= const double &    a [inline]
 

Set all elements to value of a

void Fits::operator= const Fits &    a [inline]
 

Copy operator.

See also:
copy

double Fits::operator[] const ULONG &    a [inline]
 

Return value at linear index position

Fits & Fits::operator^= const float &    r
 

Raise all array elements to the power of r. Array elements whose value is < 0 will be set to 0.

bool Fits::power const Fits &    a
 

Raise one array to the power of another (Pixel by pixel). If the number of axes in the current array is exactly one greater than in a, we will loop over the current array. If membits of the current array is I1, I2, or I4, it will be changed to at least R4, or to whatever a.membits is. This is in order to assure no loss in data.

bool Fits::power const double &    a
 

Raise the array to the power of a constant. If the array is of integer type (i.e. membits = I1, I2 or I4), it will be changed to R4. If any resulting array value is complex, the array type will be changed to C16.

void Fits::Progress int    percent [inline]
 

progress information

bool Fits::qgauss int    n1,
int    n2,
float    xcen,
float    ycen,
float    fwhm,
int    speed
 

create a 2-dimensional circular gaussian with bitpix = -32 Speed gives the number of fwhm that the gaussian spans.

bool Fits::ravg char *    templ,
int    first,
int    last
 

Read consecutive files and make a long exposure

bool Fits::ReadFITS const char *    fname,
ULONG    x1 = 0,
ULONG    x2 = 0,
ULONG    y1 = 0,
ULONG    y2 = 0,
ULONG    z1 = 0,
ULONG    z2 = 0
 

Read in a complete FITS file by default, the image(s) is stored in a float array

bool Fits::ReadFITSCubeImage int    which
 

Read in one image of a FITS cube The data is converted to T_R4 or T_C16

bool Fits::ReadFITSData ULONG    x1 = 0,
ULONG    x2 = 0,
ULONG    y1 = 0,
ULONG    y2 = 0,
ULONG    z1 = 0,
ULONG    z2 = 0
 

Read in data in the FITS file The data is converted to T_R4 or T_C16 Partial loading is supported

bool Fits::ReadFITSExtension const char *    fname,
int    ext,
ULONG    x1 = 0,
ULONG    x2 = 0,
ULONG    y1 = 0,
ULONG    y2 = 0,
ULONG    z1 = 0,
ULONG    z2 = 0
 

Read in a complete FITS file by default, the image(s) is stored in a float array

int Fits::ReadFitsExtensionHeader gzFile    gfd,
int    extendNumber
 

Read a FITS header extension from a file. The file pointer will be placed at the end of the extension header.

int Fits::ReadFitsHeader gzFile    gfd
 

Read a FITS header from a file. The file pointer fd must be at the correct position.

bool Fits::reass void   
 

Reassemble the array, i.e. re-arrange the quadrants after 2 fft's.

bool Fits::rebin int    new1,
int    new2
 

Resize the array to new axis lengths. The aspect ratio is NOT preserved. Intermediate Pixels will be interpolated by bilinear interpolation. At the moment only works for 2-dimensional arrays. 3-dim will loop over the 3rd dimension.

bool Fits::recreate int    x,
int    y,
int    z
 

Create a Fits cube (3-dimensional). Values are NOT initialized.

bool Fits::recreate int    x,
int    y
 

Create a Fits image (2-dimensional). Values are NOT initialized.

bool Fits::rect int    n1,
int    n2,
int    xcen,
int    ycen,
int    width,
int    height
 

create a rectangle

bool Fits::resize int    new1 = -1,
int    new2 = -1,
int    new3 = -1
 

Resize the array to new axis lengths Image will be in lower left corner

bool Fits::rot90 int    angle
 

Rotate by specified amount of degrees, which is an integer multiple of 90 degrees. This is reversible.

void Fits::setCasts  
 

Update all casts to memory

bool Fits::SetFloatKey const char *    key,
double    value,
const char *    comment = NULL
 

Set a floating point key, optionally with a comment

bool Fits::SetFloatKeys const char *    base,
double *    values,
int    n
 

Set several floating point keys; The key names are generated from the base and the numbers 1..n, where n < 10;

bool Fits::SetIntKey const char *    key,
int    value,
const char *    comment = NULL
 

Set an integer key, optionally with a comment

bool Fits::SetIntKeys const char *    base,
int *    values,
int    n
 

Set several integer keys; The key names are generated from the base and the numbers 1..n, where n < 10;

void Fits::setNaxis const UCHAR    which,
const long    what
[inline]
 

Set length of specified axes

bool Fits::setRange Fits &    value,
int    x1,
int    x2,
int    y1,
int    y2,
int    z1 = 1,
int    z2 = -1
 

Set a range in the fits array to values in another fits array

bool Fits::setRange double    value,
int    x1,
int    x2,
int    y1,
int    y2,
int    z1 = 1,
int    z2 = -1
 

Set a range in the fits array to a certain value

bool Fits::SetStringKey const char *    key,
const char *    value,
const char *    comment = NULL
 

Set a string key, optionally with a comment

bool Fits::SetStringKeys const char *    base,
char **    values,
int    n
 

Set several string keys; The key names are generated from the base and the numbers 1..n, where n < 10;

bool Fits::setValue double    v,
int    x,
int    y,
int    z = 1
 

Set the value of the element at location x, y, z (fortran-notation)

void Fits::shrink int    fact = 2
 

Shrink the array such that 4 original pixel becomes one new pixel which is set to the sum of those 4 pixels. This way the total flux in the array is kept constant.

bool Fits::Sin bool    radians = TRUE
 

Sine of all array elements. If the array is of integer type, it will be changed to float (R4).

Returns:
TRUE if successful, FALSE otherwise.

bool Fits::Sinh bool    radians = TRUE
 

Sine hyperbolicus of all array elements. If the array is of integer type, it will be changed to float (R4).

Returns:
TRUE if successful, FALSE otherwise.

bool Fits::sort Fits &    result,
bool    reverse = FALSE
 

Create an index array which holds a sorted index of the values.

bool Fits::Sqrt  
 

Square root of all array elements. If the array is of integer type, it will be changed to float (R4). If the minimum value of array elements is < 0.0, the array type will be changed to complex (C16).

Returns:
TRUE if successful, FALSE otherwise.

bool Fits::sssa const char *    fname,
Fits    stats,
int    method,
Fits *    sky,
Fits *    flat,
Fits *    dpl,
Fits *    mask
 

Perform Simple Shift-and-Add using previously calculated statistics

bool Fits::sub const Fits &    a
 

Subtract an array from the array (Pixel by pixel). If the number of axes in the current array is exactly one greater than in a, we will loop over the current array. If membits of the current array is I1, I2, or I4, it will be changed to at least R4, or to whatever a.membits is. This is in order to assure no loss in data.

bool Fits::sub const double &    a
 

Subtract a constant from the array. If the array is of integer type (i.e. membits = I1, I2 or I4), this is very fast since only the bzero entry is modified.

void Fits::swapIndex ULONG    dest,
ULONG    source
 

Swap the values at array index source and array index dest.

bool Fits::Tan bool    radians = TRUE
 

Tangent of all array elements. If the array is of integer type, it will be changed to float (R4).

Returns:
TRUE if successful, FALSE otherwise.

bool Fits::Tanh bool    radians = TRUE
 

Tangent hyperbolicus of all array elements. If the array is of integer type, it will be changed to float (R4).

Returns:
TRUE if successful, FALSE otherwise.

bool Fits::updateHeader void   
 

Update Header values

double Fits::ValueAt const ULONG    index const [inline]
 

Return value at specified position

bool Fits::wrap int    ssx,
int    ssy,
int    ssz
 

Shift and wrap the array by an integer amount

bool Fits::WriteBMP const char *    fname,
Fits &    red,
Fits &    green,
Fits &    blue
[static]
 

Write a color BMP file.

bool Fits::WriteBMP const char *    fname
 

Write a BMP file.

bool Fits::WriteFITS const char *    fname
 

Write a fits file

bool Fits::WriteFITSData void   
 

Write the data to file.

bool Fits::WriteFitsHeader FILE *    fd
 

Write a FITS header to a file. The file pointer fd must be at the correct position.


Member Data Documentation

char* Fits::header [private]
 

The storage place of the FITS header (HeaderLength + 1 for the trailing 0)

int Fits::HeaderLength [private]
 

Length (in bytes) of the FITS header, not including the trailing zero.


The documentation for this class was generated from the following files:
Generated on Mon May 24 16:26:33 2004 for FITS handling library by doxygen1.2.18