#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "dataops.h"
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) |
#define ELEM_SWAP | ( | a, | |||
b | ) | { register float t=(a);(a)=(b);(b)=t; } |
Referenced by quick_select().
#define MAX | ( | a, | |||
b | ) | ( (a)>(b)? (a) : (b) ) |
Referenced by get_maxmin(), make_overlay(), and scaleasinh().
#define MIN | ( | a, | |||
b | ) | ( (a)<(b)? (a) : (b) ) |
Referenced by scaleasinh().
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 | |||
) |
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 | |||
) |
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().