dataops.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "dataops.h"
Include dependency graph for dataops.c:
This graph shows which files directly or indirectly include this file:

Defines

#define MIN(a, b)   ( (a)<(b)? (a) : (b) )
#define MAX(a, b)   ( (a)>(b)? (a) : (b) )
#define ELEM_SWAP(a, b)   { register float t=(a);(a)=(b);(b)=t; }

Functions

void make_overlay (double theta, int npixx, int npixy, float *overlay, char *arrowfile)
 Make an overlay containing N-E axes.
void scaleasinh (float *buffer, int npixx, int npixy, float median, float minval, float maxval, float sdev, double theta, int neoverlay, float contrast, char *coordfile)
 Apply asinh scaling to the image.
float get_binned (int ix, int iy, int binsize, int npixx, float *buffer)
void get_zscales (float contrast, int n1, int n2, float *buffer, float *z1, float *z2)
void get_maxmin (float *buffer, long long npixels, float *min, float *max, float *median, float *mean, float *sdev)
 Calculate max and min from a subset of the fits image pixels.
int compare (const float *v1, const float *v2)
void lsfit (int ndata, float *xdata, float *ydata, float *a, float *b)
float quick_select (float arr[], long long n)

Detailed Description

Author:
Ian Bond, IfA, University of Edinburgh

Define Documentation

#define ELEM_SWAP ( a,
 )     { register float t=(a);(a)=(b);(b)=t; }

Referenced by quick_select().

#define MAX ( a,
 )     ( (a)>(b)? (a) : (b) )
#define MIN ( a,
 )     ( (a)<(b)? (a) : (b) )

Referenced by scaleasinh().


Function Documentation

int compare ( const float *  v1,
const float *  v2 
)

Comparison operation that is used in conjunction with the standard C library qsort function.

Referenced by get_zscales().

float get_binned ( int  ix,
int  iy,
int  binsize,
int  npixx,
float *  buffer 
)

Bin the image buffer data at the given pixel (ix, iy) and given binsize

Referenced by get_jbuffer().

void get_maxmin ( float *  buffer,
long long  npixels,
float *  min,
float *  max,
float *  median,
float *  mean,
float *  sdev 
)

Calculate max and min from a subset of the fits image pixels.

References MAX, and quick_select().

Referenced by mef2jpeg().

void get_zscales ( float  contrast,
int  n1,
int  n2,
float *  buffer,
float *  z1,
float *  z2 
)

Calculate z1 and z2 using the "z scale" algorithm for a given contrast. The calculation of z1 and z2 is done by implementating the algorithm used in IRAF. See the IRAF documentation for "display" for more details.

References compare(), and lsfit().

void lsfit ( int  ndata,
float *  xdata,
float *  ydata,
float *  a,
float *  b 
)

Implement the least squares formula on the two arrays of a and y data. Here we have y = a + bx.

Referenced by get_zscales().

void make_overlay ( double  theta,
int  npixx,
int  npixy,
float *  overlay,
char *  arrowfile 
)

Make an overlay containing N-E axes.

References MAX.

Referenced by scaleasinh().

float quick_select ( float  arr[],
long long  n 
)

References ELEM_SWAP.

Referenced by get_maxmin().

void scaleasinh ( float *  buffer,
int  npixx,
int  npixy,
float  median,
float  minval,
float  maxval,
float  sdev,
double  theta,
int  neoverlay,
float  contrast,
char *  coordfile 
)

Apply asinh scaling to the image.

References make_overlay(), MAX, and MIN.

Referenced by mef2jpeg().

Generated on Mon Oct 4 10:39:50 2010 for WsaTools by  doxygen 1.6.3