File: fiphot.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 (132 lines) | stat: -rw-r--r-- 3,674 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*****************************************************************************/
/* fiphot.h								     */
/*****************************************************************************/

#ifndef	__FIPHOT_H_INCLUDED
#define	__FIPHOT_H_INCLUDED	1

#include "apphot.h"		/* typedef: bgmode */

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

#define		USE_WEIGHT_SUBTRACTED		1
#define		USE_WEIGHT_WEIGHTED		2

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

#define		APGEOM_TYPE_CIRCULAR		1
#define		APGEOM_TYPE_POLYGON		2

typedef struct
 {	int	apgeom_type;
	double	r0,ra,da;
	double	*r0_poly,*ra_poly,*da_poly;
	int	nr0,nra,nda;
 } apgeom;

typedef struct
 {	apgeom	ag;
	double	bgarea,bgflux,bgmedian,bgsigma;
	double	flux,fluxerr;
	double	cntr_x,cntr_x_err,
		cntr_y,cntr_y_err,
		cntr_width,cntr_w_err,cntr_w_d,cntr_w_k;
	double	mag ,magerr ;
	int	flag,rtot,rbad,rign,atot,abad;
 } photflux;

typedef struct
 {	double		x,y;

	apgeom		*inaps;
	int		ninap;

	int		n;		
	photflux	*fluxes;	/* size == n 			     */
	apgeom		optimal;

	photflux	*rfflux;	/* size == n 			     */
					/* these are read from the raw pho-  */
					/* tometry file			     */

	int		use_ref;	/* use a reference magnitude?	     */
	double		ref_mag;	/* reference magnitude for imgsub    */
	double		ref_col;	/* reference color for postmagfit    */
	double		ref_err;	/* reference magnitude error	     */

	char		*id;
 } photstar;

typedef struct
 {	int	colx,coly;
	int	colid,colmag,colcol,colerr;
	int	*colap;	
 } colread;

typedef struct
 {	bgmode	bgm;
	int	maskignore;
	int	use_biquad;
	double	wconfdist;
	double	sky;
	int	use_sky;
	int	is_disjoint_rings;
	int	is_disjoint_apertures;
	double	disjoint_radius;
	double	**subpixeldata;
	int	subg;
 } xphotpar;

typedef struct
 {	int	orders[4];	/* spatial orders		*/
	int	norder;		/* order in the color		*/
	int	niter;		/* number of iterations		*/
	double	sigma;		/* rejection limit in sigma	*/
 } magfitparams;

typedef struct
 {	int	nstar;		/* total number of stars		*/
	int	naperture;	/* total number of apertures used	*/
	int	*ninit;		/* number of initially used stars	*/
	int	*nrejs;		/* number of rejected stars		*/
 } magfitstat;

typedef struct
 {	int	order;		/* spatial order of gain variations	     */
	double	*coeff;		/* gain variation coefficients, B(order+2,2) */
	double	vmin;		/* minimal value of the gain		     */
 } spatialgain;

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

extern	int	is_comment,is_verbose;

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

int	read_input_star_list(FILE *fr,photstar **rps,int *rnp,colread *col,int zoom);
int	read_raw_photometry(FILE *fr,photstar **rps,int *rnp);

int	get_id_format_parameters(photstar *ps,int np,int *rid_len,char *idf,char *ndf);
int	write_output_star_list(FILE *fw,photstar *ps,int np);

int	photometry_status(char *buff,photflux *pf);
int	write_photometry(FILE *fw,photstar *ps,int np,char *ofxy,char *ofph,spatialgain *sg,char *nanstring,char *serialstring,int sx,int sy);
int	write_raw_photometry(FILE *fw,photstar *ps,int np,char *nanstring);

char *	output_format_xy(char *oformat);
char *	output_format_ph(char *oformat);

char *	subtracted_format_xy(char *sformat);
char *	subtracted_format_ph(char *sformat);

int *	create_col_ap_data(char *apcolpar);
int	create_input_ap_data(char *appar,apgeom **rinaps,int *rninap,int zoom);

int	check_apertures(photstar *ps,int np);

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

#endif

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