File: firandom.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 (116 lines) | stat: -rw-r--r-- 3,456 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
/*****************************************************************************/
/* firandom.h								     */
/*****************************************************************************/

#ifndef	__FIRANDOM_H_INCLUDED
#define	__FIRANDOM_H_INCLUDED	1

#include "magnitude.h"

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

#define		VAR_X		0
#define		VAR_Y		1
#define		VAR_AX		2
#define		VAR_AY		3
#define		VAR_I		4
#define		VAR_M		5
#define		VAR_SH_F	6
#define		VAR_SH_E	7
#define		VAR_SH_P	8
#define		VAR_SN_S	9
#define		VAR_SN_D	10
#define		VAR_SN_K	11
#define		VAR_SI_S	12
#define		VAR_SI_D	13
#define		VAR_SI_K	14

#define		MSK_X		(1<<VAR_X)
#define		MSK_Y		(1<<VAR_Y)
#define		MSK_AX		(1<<VAR_AX)
#define		MSK_AY		(1<<VAR_AY)
#define		MSK_COORD	(MSK_X|MSK_Y|MSK_AX|MSK_AY)
#define		MSK_I		(1<<VAR_I)
#define		MSK_M		(1<<VAR_M)
#define		MSK_INTENSITY	(MSK_I|MSK_M)
#define		MSK_SH_F	(1<<VAR_SH_F)
#define		MSK_SH_E	(1<<VAR_SH_E)
#define		MSK_SH_P	(1<<VAR_SH_P)
#define		MSK_SH		(MSK_SH_F|MSK_SH_E|MSK_SH_P)
#define		MSK_SN_S	(1<<VAR_SN_S)
#define		MSK_SN_D	(1<<VAR_SN_D)
#define		MSK_SN_K	(1<<VAR_SN_K)
#define		MSK_SN		(MSK_SN_S|MSK_SN_D|MSK_SN_K)
#define		MSK_SI_S	(1<<VAR_SI_S)
#define		MSK_SI_D	(1<<VAR_SI_D)
#define		MSK_SI_K	(1<<VAR_SI_K)
#define		MSK_SI		(MSK_SI_S|MSK_SI_D|MSK_SI_K)
#define		MSK_SHAPE	(MSK_SH|MSK_SN|MSK_SI)

#define		NUM_SET		15

#define		PARAM_CNTR	15
#define		RND_1		16
#define		RND_2		17
#define		RND_3		18
#define		RND_4		19
#define		PARAM_SX	20
#define		PARAM_SY	21

#define		NUM_TOTAL	22

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

typedef struct
 {	int	subg;
	double	**subpixeldata;
	double	gain;
	int	is_photnoise,method;
	int	is_intinelect,dontquantize;
	double	nsuppress;
	psf	*tpd;
 } stargenparam;

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

#define		LISTTYPE_FEP	0   /* --fep : x,y,flux,FWHM,ELL,PA	   */
#define		LISTTYPE_SIG	1   /* --sdk : x,y,flux,sigma,delta,kappa  */
#define		LISTTYPE_SDK	2   /* --SDK : x,y,flux,S/D/K momenta      */
#define		LISTTYPE_SMM	3   /* --Smom: x,y,flux,S, M20/M11/M02/... */
#define		LISTTYPE_PSF	4   /* --psf : x,y,flux + external PSF!    */
#define		LISTTYPE_PDS	5   /* --psfdst : x,y,flux + PSF + distort */

typedef struct
 {	magflux	mf0;
	double	ox,oy,scale;
	int	sx,sy,basetype;
 } starlistparam;

typedef struct
 {	int	colx,coly;
	int	colflux,colmag;
	int	colsh1,colsh2,colsh3,colsh4;
	int	listtype;
	magflux	mf0;
 } inlistparam;

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

double	get_gaussian(double mean,double stddev);
int	get_gaussian_2d(double x0,double y0,double is,double id,double ik,double *rx,double *ry);

int	fep_to_sdk(double f,double e,double p,double *s,double *d,double *k);
int	sdk_to_fep(double s,double d,double k,double *f,double *e,double *p);
int	sdk_to_isdk(double s,double d,double k,double *is,double *id,double *ik);
int	isdk_to_sdk(double is,double id,double ik,double *s,double *d,double *k);

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

int	create_background(fitsimage *img,char *bgarg,double stddev,double ox,double oy,double scale,int zoom);

int	replace_limiters(char *buff);
int	create_input_list(char *buff,starlistparam *lp,star **rstars,int *rnstar,int sseed);

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

#endif