File: combine.h

package info (click to toggle)
fitsh 0.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 2,768 kB
  • ctags: 4,050
  • sloc: ansic: 53,352; makefile: 1,120; sh: 25
file content (84 lines) | stat: -rw-r--r-- 2,706 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*****************************************************************************/
/* combine.h								     */
/*****************************************************************************/

#ifndef	__COMBINE_H_INCLUDED
#define	__COMBINE_H_INCLUDED	1

/*****************************************************************************/

#include <fits/fits.h>

#include "fitsmask.h"

/*****************************************************************************/

/* classic averaging modes (REJ_AVG and REJ_MED uses `niter` and `[lh]sigma`)*/
#define		COM_MODE_AVG		0	/* average, simple mean	     */
#define		COM_MODE_MED		1	/* median		     */
#define		COM_MODE_REJ_AVG	2	/* sigma rejection mean	     */
#define		COM_MODE_REJ_MED	3	/* sigma rejection median    */

/* some other combinations for other purposes: */
#define		COM_MODE_SUM		4	/* sum of the images/pixels  */
#define		COM_MODE_SQSUM		5	/* squared sum		     */
#define		COM_MODE_SCT		6	/* standard deviation	     */

#define		COM_MODE_MIN		8	/* minimum		     */
#define		COM_MODE_MAX		9	/* maximum		     */

#define		COM_MODE_REJ_DEPRECATED	255	/* old stuff		     */

/* ignore modes: */
#define		COM_IGNORE_NEGATIVE	0x01
#define		COM_IGNORE_ZERO		0x02
#define		COM_IGNORE_POSITIVE	0x04

typedef struct
 {	fitsimage	*img;
	double		scale;
	int		x0,y0;			
 } presubdata;

typedef struct
 {	int		mode;			/* see COM_MODE_* definition */
	int		niter;			/* used by COM_MODE_REJ_*    */
	double		lower,upper;		/* used by COM_MODE_REJ_*    */
	int		ignore_flag;		/* see COM_IGNORE_*	     */
	int		logicalmethod;		/* (0): or (!0): and 	     */
 } compar;

typedef struct 
 {	fits		*img;
	FILE		*fr;
 } comimg;

/*****************************************************************************/

/* Combination of images: user interface specific stuff (gonna be removed?!) */

int	combine_parse_mode(char *modstr,compar *cp);

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

/* Combination of images: lower and higher level combination specific stuff  */

double	combine_points(double *points,int n,compar *cp);

int	combine_lines(double **lines,int n,int sx,double *out,
		compar *cp,char **wmask,char *outmask);

int	combine_images_from_files(comimg *inputs,int n,fits *outimg,
		compar *cp,char **inmask,char **outmask,
		presubdata *pss,int nps,size_t maxmem);

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

int	combine_cleanup(comimg *inputs,int ninput);

/*****************************************************************************/

#endif
                                                              
/*****************************************************************************/